summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@huawei.com>2023-04-18 11:18:23 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-05-02 08:36:14 -0300
commit0e20f4311254193fbf9eebafb4dc5c922a885397 (patch)
tree331a5f05a914304446ea972a8ec5fc8b922ee2e7 /tools
parent1511e4696acb715a4fe48be89e1e691daec91c0e (diff)
perf script: Print raw ip instead of binary offset for callchain
Before this, the raw ip is printed for non-callchain and dso offset for callchain. This inconsistent output for address may confuse people. And mostly what we expect is the raw ip. 'dso offset' is printed in callchain: $ perf script ... ls 1341034 2739463.008343: 2162417 cycles: ffffffff99d657a7 [unknown] ([unknown]) ffffffff99e00b67 [unknown] ([unknown]) 235d3 memset+0x53 (/usr/lib/x86_64-linux-gnu/ld-2.31.so) # dso offset a61b _dl_map_object+0x1bb (/usr/lib/x86_64-linux-gnu/ld-2.31.so) raw ip is printed for non-callchain: $ perf script -G ... ls 1341034 2739463.008876: 2053304 cycles: ffffffffc1596923 [unknown] ([unknown]) ls 1341034 2739463.009381: 1917049 cycles: 14def8e149e6 __strcoll_l+0xd96 (/usr/lib/x86_64-linux-gnu/libc-2.31.so) # raw ip Let's have consistent output for it. Later I'll add a new field 'dsoff' to print dso offset. Signed-off-by: Changbin Du <changbin.du@huawei.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Hui Wang <hw.huiwang@huawei.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20230418031825.1262579-2-changbin.du@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/evsel_fprintf.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index a09ac00810b7..cc80ec554c0a 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -153,13 +153,8 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
if (map)
addr = map__map_ip(map, node->ip);
- if (print_ip) {
- /* Show binary offset for userspace addr */
- if (map && !map__dso(map)->kernel)
- printed += fprintf(fp, "%c%16" PRIx64, s, addr);
- else
- printed += fprintf(fp, "%c%16" PRIx64, s, node->ip);
- }
+ if (print_ip)
+ printed += fprintf(fp, "%c%16" PRIx64, s, node->ip);
if (print_sym) {
printed += fprintf(fp, " ");