mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf, tools, script: Always print raw IP
@ 2015-03-07  2:48 Andi Kleen
  0 siblings, 0 replies; only message in thread
From: Andi Kleen @ 2015-03-07  2:48 UTC (permalink / raw)
  To: arnaldo.melo; +Cc: linux-kernel, Andi Kleen, Yuanfang Chen

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

Fix regression caused by 85c116a6cb

We did not print the IP anymore for perf script -o ip, but instead
symbol+offset, and if there was no symbol only +offset.

Print the raw IP correctly again in this case.

Reported-by: Yuanfang Chen <cyfmxc@gmail.com>
Cc: Yuanfang Chen <cyfmxc@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/srcline.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index c93fb0c..7d61f8b 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -293,8 +293,14 @@ out:
 		dso__free_a2l(dso);
 	}
 	if (sym) {
-		if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "",
-					addr - sym->start) < 0)
+		int err;
+
+		if (show_sym)
+			err = asprintf(&srcline, "%s+%" PRIu64, sym->name,
+					addr - sym->start);
+		else
+			err = asprintf(&srcline, "%" PRIx64, addr);
+		if (err < 0)
 			return SRCLINE_UNKNOWN;
 	} else if (asprintf(&srcline, "%s[%" PRIx64 "]", dso->short_name, addr) < 0)
 		return SRCLINE_UNKNOWN;
-- 
1.9.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-07  2:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-07  2:48 [PATCH] perf, tools, script: Always print raw IP Andi Kleen

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®