linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	eranian@google.com, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 4/8] perf, tools: Only print base source file for srcline
Date: Mon, 15 Sep 2014 16:54:29 -0700	[thread overview]
Message-ID: <1410825273-7054-5-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1410825273-7054-1-git-send-email-andi@firstfloor.org>

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

For perf report with --sort srcline only print the base source file
name. This makes the results generally fit much better to the
screen. The path is usually not that useful anyways because it is
often from different systems.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/srcline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index c6a7cdc..ac877f9 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -274,7 +274,7 @@ char *get_srcline(struct dso *dso, unsigned long addr)
 	if (!addr2line(dso_name, addr, &file, &line, dso))
 		goto out;
 
-	if (asprintf(&srcline, "%s:%u", file, line) < 0) {
+	if (asprintf(&srcline, "%s:%u", basename(file), line) < 0) {
 		free(file);
 		goto out;
 	}
-- 
1.9.3


  parent reply	other threads:[~2014-09-16  0:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 23:54 Implement lbr-as-callgraph v9 Andi Kleen
2014-09-15 23:54 ` [PATCH 1/8] perf, tools: Support handling complete branch stacks as histograms Andi Kleen
2014-09-15 23:54 ` [PATCH 2/8] perf, tools: Add --branch-history option to report Andi Kleen
2014-09-15 23:54 ` [PATCH 3/8] perf, tools: Enable printing the srcline in the history Andi Kleen
2014-09-15 23:54 ` Andi Kleen [this message]
2014-09-15 23:54 ` [PATCH 5/8] perf, tools: Support source line numbers in annotate Andi Kleen
2014-09-15 23:54 ` [PATCH 6/8] tools, perf: Make get_srcline fall back to sym+offset Andi Kleen
2014-09-15 23:54 ` [PATCH 7/8] tools, perf: Make srcline output address with -v Andi Kleen
2014-09-15 23:54 ` [PATCH 8/8] tools, perf: Add asprintf replacement Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2014-09-26 23:37 Implement lbr-as-callgraph v10 Andi Kleen
2014-09-26 23:37 ` [PATCH 4/8] perf, tools: Only print base source file for srcline Andi Kleen
2014-03-11  1:05 Implement lbr-as-callgraph v5 Andi Kleen
2014-03-11  1:05 ` [PATCH 4/8] perf, tools: Only print base source file for srcline Andi Kleen

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=1410825273-7054-5-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).