From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Michael Petlan <mpetlan@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf annotate: Support of full source file paths for srcline fix
Date: Mon, 9 Nov 2015 16:39:54 -0300 [thread overview]
Message-ID: <20151109193954.GD4715@kernel.org> (raw)
In-Reply-To: <1447083211.15375.57.camel@Rudolf-RHEL-7>
Em Mon, Nov 09, 2015 at 04:33:31PM +0100, Michael Petlan escreveu:
>
> The --full-paths option did not show the full source file paths
> in the perf annotate tool, because the value of the option was
> not propagated into the related functions.
>
> With this patch the value of the --full-paths option is known to
> the function that composes the srcline string, so it prints the
> full path when necessary.
Thanks, applied, but you forgot to show when this happens, how it looks
before and after, I did it this time, please consider doing it this way
next time, so that I can more quickly reproduce your steps, reproduce
the problem, apply the patch, test the end result, matching your
findings.
Also please send it to me, CC ing other people that touched this code,
then CC it to linux-perf-users/lkml.
Thanks for the patch,
- Arnaldo
commit e1d13c36cd043a335de33845443f5d172f0eb543
Author: Michael Petlan <mpetlan@redhat.com>
Date: Mon Nov 9 16:33:31 2015 +0100
perf annotate: Support full source file paths for srcline fix
The --full-paths option did not show the full source file paths in the 'perf
annotate' tool, because the value of the option was not propagated into the
related functions.
With this patch the value of the --full-paths option is known to the function
that composes the srcline string, so it prints the full path when necessary.
Committer Note:
This affects annotate when the --print-line option is used:
# perf annotate -h 2>&1 | grep print-line
-l, --print-line print matching source lines (may be slow)
Looking just at the lines that should be affected by this change:
Before:
# perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
94.44 atomic64_64.h:114
5.56 file_table.c:265
file_table.c:265 5.56 : ffffffff81219a00: callq ffffffff81769360 <__fentry__>
atomic64_64.h:114 94.44 : ffffffff81219a05: lock decq 0x38(%rdi)
After:
# perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
94.44 /home/git/linux/arch/x86/include/asm/atomic64_64.h:114
5.56 /home/git/linux/fs/file_table.c:265
/home/git/linux/fs/file_table.c:265 5.56 : ffffffff81219a00: callq ffffffff81769360 <__fentry__>
/home/git/linux/arch/x86/include/asm/atomic64_64.h:114 94.44 : ffffffff81219a05: lock decq 0x38(%rdi)
#
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://permalink.gmane.org/gmane.linux.kernel.perf.user/2365
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index f2974da0185a..1dd1949b0e79 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1620,6 +1620,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
len = symbol__size(sym);
if (print_lines) {
+ srcline_full_filename = full_paths;
symbol__get_source_line(sym, map, evsel, &source_line, len);
print_summary(&source_line, dso->long_name);
}
next prev parent reply other threads:[~2015-11-09 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 15:33 [PATCH] perf annotate: Support of full source file paths for srcline fix Michael Petlan
2015-11-09 19:39 ` Arnaldo Carvalho de Melo [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-11-09 15:33 Michael Petlan
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=20151109193954.GD4715@kernel.org \
--to=acme@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mpetlan@redhat.com \
/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).