mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] perf, tools: Fix crash while reading old perf.data
@ 2014-11-21 21:37 Andi Kleen
  2014-11-21 21:38 ` [PATCH 2/2] perf, tools: Allow to force redirect pr_debug to stderr Andi Kleen
  2014-11-25  9:53 ` [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Jiri Olsa
  0 siblings, 2 replies; 4+ messages in thread
From: Andi Kleen @ 2014-11-21 21:37 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, namhyung, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

In some cases when reading perf.data generated by much
older perf I got segfaults with dso->long_name being zero.
This patch fixes them for me.

Haven't tracked down the exact cause. I assume it's
some error path that doesn't set it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 52e9490..6266041 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1106,7 +1106,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
 		if (__machine__create_kernel_maps(machine, kernel) < 0)
 			goto out_problem;
 
-		if (strstr(dso->long_name, "vmlinux"))
+		if (dso->long_name && strstr(dso->long_name, "vmlinux"))
 			dso__set_short_name(dso, "[kernel.vmlinux]", false);
 
 		machine__set_kernel_mmap_len(machine, event);
-- 
1.9.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-08  6:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21 21:37 [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Andi Kleen
2014-11-21 21:38 ` [PATCH 2/2] perf, tools: Allow to force redirect pr_debug to stderr Andi Kleen
2014-12-08  6:50   ` [tip:perf/core] perf " tip-bot for Andi Kleen
2014-11-25  9:53 ` [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®