From: Adrian Hunter <adrian.hunter@intel.com>
To: Changbin Du <changbin.du@huawei.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Hui Wang <hw.huiwang@huawei.com>
Subject: Re: [PATCH v5 1/3] perf script: print raw ip instead of binary offset for callchain
Date: Mon, 24 Apr 2023 08:24:39 +0300 [thread overview]
Message-ID: <8459fe09-7f89-3713-b4b8-fddeff7d4855@intel.com> (raw)
In-Reply-To: <20230418031825.1262579-2-changbin.du@huawei.com>
On 18/04/23 06:18, Changbin Du wrote:
> 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>
> ---
> tools/perf/util/evsel_fprintf.c | 9 ++-------
> 1 file 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, " ");
next prev parent reply other threads:[~2023-04-24 5:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 3:18 [PATCH v5 0/3] perf script: Have consistent output for symbol address Changbin Du
2023-04-18 3:18 ` [PATCH v5 1/3] perf script: print raw ip instead of binary offset for callchain Changbin Du
2023-04-24 5:24 ` Adrian Hunter [this message]
2023-04-18 3:18 ` [PATCH v5 2/3] perf: add helper map__fprintf_dsoname_dsoff Changbin Du
2023-04-19 18:58 ` Adrian Hunter
2023-04-20 2:55 ` Changbin Du
2023-04-20 8:39 ` Adrian Hunter
2023-04-21 5:04 ` Changbin Du
2023-04-21 7:30 ` Adrian Hunter
2023-04-23 4:32 ` Changbin Du
2023-04-24 5:25 ` Adrian Hunter
2023-04-24 5:25 ` Adrian Hunter
2023-04-18 3:18 ` [PATCH v5 3/3] perf: script: add new output field 'dsoff' to print dso offset Changbin Du
2023-04-24 5:26 ` Adrian Hunter
2023-04-29 1:40 ` Arnaldo Carvalho de Melo
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=8459fe09-7f89-3713-b4b8-fddeff7d4855@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=changbin.du@huawei.com \
--cc=hw.huiwang@huawei.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@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
all inboxes | Powered by JetHome®