Skip to content

Commit

Permalink
perf tools: Don't try to lookup objdump for live mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Nov 8, 2012
1 parent eef9ba9 commit ff6f777
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/perf/arch/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ static int perf_session_env__lookup_binutils_path(struct perf_session_env *env,

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);
}

0 comments on commit ff6f777

Please sign in to comment.