aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-11-06 20:30:15 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-08 15:26:52 -0500
commitff6f7778a66edc033044a6baa2459ce79519e571 (patch)
treef79f9776ffff5d8b67cc6cfa7b0511fd0c48eac8 /tools
parenteef9ba98b9ee96f52e544b09f581c397d8cc8265 (diff)
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 <acme@ghostprotocols.net> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Irina Tirdea <irina.tirdea@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1352251815-12615-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/arch/common.c7
1 files changed, 7 insertions, 0 deletions
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:
199 199
200int perf_session_env__lookup_objdump(struct perf_session_env *env) 200int perf_session_env__lookup_objdump(struct perf_session_env *env)
201{ 201{
202 /*
203 * For live mode, env->arch will be NULL and we can use
204 * the native objdump tool.
205 */
206 if (env->arch == NULL)
207 return 0;
208
202 return perf_session_env__lookup_binutils_path(env, "objdump", 209 return perf_session_env__lookup_binutils_path(env, "objdump",
203 &objdump_path); 210 &objdump_path);
204} 211}