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: <20160816145511.GA11382@danjae.aot.lge.com>
Date:	Tue, 16 Aug 2016 23:55:11 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Jiri Olsa <jolsa@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: RFC: callchain showing same entry as hist_entry

Hi Arnaldo,

On Tue, Aug 16, 2016 at 11:36:28AM -0300, Arnaldo Carvalho de Melo wrote:
> Hi Namhyung, Jiri,
> 
> 	please take a look at the patch below, and Ack if possible, it
> is a problem introduced in:
> 
>   cfaa154b2335 ("perf tools: Get rid of obsolete hist_entry__sort_list")
> 
> That is not equivalent to the code that was there and results in having
> the same entry as the first entry for the callchain as in the
> hist_entry, which is annoying and doesn't match the original intent of
> that 'continue' branch, as described in the comment right above it.

AFAIK the intent was to skip first callchain entry iff the first sort
key is 'symbol'.  The sort_order being NULL means it'd use the default
sort key which is 'comm,dso,sym' so it should not skip the first
callchain entry.

The original code (before cfaa154b2335) was like below:

-                       if (!i++ && sort__first_dimension == SORT_SYM)
+                       if (!i++ && field_order == NULL &&
+                           sort_order && !prefixcmp(sort_order, "sym"))

I think the current code works as intended, no?

Thanks,
Namhyung


> 
> Now looking at doing the same for the TUI...
> 
> - Arnaldo
> 
> diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
> index 9b65f4a6b35a..46a083e59ce9 100644
> --- a/tools/perf/ui/stdio/hist.c
> +++ b/tools/perf/ui/stdio/hist.c
> @@ -207,7 +207,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
>  			 * displayed twice.
>  			 */
>  			if (!i++ && field_order == NULL &&
> -			    sort_order && !prefixcmp(sort_order, "sym"))
> +			    (sort_order == NULL || !prefixcmp(sort_order, "sym")))
>  				continue;
>  			if (!printed) {
>  				ret += callchain__fprintf_left_margin(fp, left_margin);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ