mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: arnaldo.melo@gmail.com
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	Yuanfang Chen <cyfmxc@gmail.com>
Subject: [PATCH] perf, tools, script: Always print raw IP
Date: Fri,  6 Mar 2015 18:48:06 -0800	[thread overview]
Message-ID: <1425696486-8048-1-git-send-email-andi@firstfloor.org> (raw)

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


                 reply	other threads:[~2015-03-07  2:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425696486-8048-1-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=cyfmxc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®