mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: Don't try to lookup objdump for live mode
@ 2012-11-07  1:30 Namhyung Kim
  2012-11-14  7:35 ` [tip:perf/core] perf tools: Don' t " tip-bot for Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2012-11-07  1:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, LKML, Namhyung Kim,
	David Ahern, Irina Tirdea

From: Namhyung Kim <namhyung.kim@lge.com>

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>
Cc: David Ahern <dsahern@gmail.com>
Cc: Irina Tirdea <irina.tirdea@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 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);
 }
-- 
1.7.11.7


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

* [tip:perf/core] perf tools: Don' t try to lookup objdump for live mode
  2012-11-07  1:30 [PATCH] perf tools: Don't try to lookup objdump for live mode Namhyung Kim
@ 2012-11-14  7:35 ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Namhyung Kim @ 2012-11-14  7:35 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, acme,
	namhyung.kim, namhyung, dsahern, irina.tirdea, tglx

Commit-ID:  ff6f7778a66edc033044a6baa2459ce79519e571
Gitweb:     http://git.kernel.org/tip/ff6f7778a66edc033044a6baa2459ce79519e571
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Wed, 7 Nov 2012 10:30:15 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 8 Nov 2012 17:26:52 -0300

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>
---
 tools/perf/arch/common.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index 5683529..3e975cb 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);
 }

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

end of thread, other threads:[~2012-11-14  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-07  1:30 [PATCH] perf tools: Don't try to lookup objdump for live mode Namhyung Kim
2012-11-14  7:35 ` [tip:perf/core] perf tools: Don' t " tip-bot for Namhyung Kim

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

Powered by JetHome