From ff6f7778a66edc033044a6baa2459ce79519e571 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Wed, 7 Nov 2012 10:30:15 +0900 Subject: [PATCH] perf tools: Don't try to lookup objdump for live mode Arnaldo reported that annotation during perf top resulted in a segfault. It was because the env->arch was NULL and we don't set it for a live session. In fact, no need to look up objdump in this case since we can use system's default (native) objdump. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Namhyung Kim Cc: David Ahern Cc: Ingo Molnar Cc: Irina Tirdea Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1352251815-12615-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c index 5683529135b1..3e975cb6232e 100644 --- a/tools/perf/arch/common.c +++ b/tools/perf/arch/common.c @@ -199,6 +199,13 @@ out_error: int perf_session_env__lookup_objdump(struct perf_session_env *env) { + /* + * For live mode, env->arch will be NULL and we can use + * the native objdump tool. + */ + if (env->arch == NULL) + return 0; + return perf_session_env__lookup_binutils_path(env, "objdump", &objdump_path); } -- 2.30.2