lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8459fe09-7f89-3713-b4b8-fddeff7d4855@intel.com>
Date:   Mon, 24 Apr 2023 08:24:39 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Changbin Du <changbin.du@...wei.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>
Cc:     Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hui Wang <hw.huiwang@...wei.com>
Subject: Re: [PATCH v5 1/3] perf script: print raw ip instead of binary offset
 for callchain

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@...wei.com>

Acked-by: Adrian Hunter <adrian.hunter@...el.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, " ");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ