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: <20160221174022.GI10701@krava.homerouter.cpe>
Date:	Sun, 21 Feb 2016 18:40:22 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Jiri Olsa <jolsa@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 4/5] perf tools: Fix alignment on some sort keys

On Sun, Feb 21, 2016 at 11:22:37PM +0900, Namhyung Kim wrote:
> The srcline, srcfile and trace sort keys can have long entries.  With
> commit 89fee7094323 ("perf hists: Do column alignment on the format
> iterator"), it now aligns output with hist_entry__snprintf_alignment().
> So each (possibly long) sort entries don't need to do it themselves.

Acked-by: Jiri Olsa <jolsa@...nel.org>

thanks,
jirka

> 
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/sort.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 6808d73164b5..1d2b85c808d0 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -325,7 +325,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
>  						  he->ms.sym, true);
>  		}
>  	}
> -	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcline);
> +	return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
>  }
>  
>  struct sort_entry sort_srcline = {
> @@ -384,7 +384,7 @@ static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf,
>  		else
>  			he->srcfile = get_srcfile(he);
>  	}
> -	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcfile);
> +	return repsep_snprintf(bf, size, "%-.*s", width, he->srcfile);
>  }
>  
>  struct sort_entry sort_srcfile = {
> @@ -514,11 +514,11 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf,
>  
>  	evsel = hists_to_evsel(he->hists);
>  	if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
> -		return scnprintf(bf, size, "%-*.*s", width, width, "N/A");
> +		return scnprintf(bf, size, "%-.*s", width, "N/A");
>  
>  	if (he->trace_output == NULL)
>  		he->trace_output = get_trace_output(he);
> -	return repsep_snprintf(bf, size, "%-*.*s", width, width, he->trace_output);
> +	return repsep_snprintf(bf, size, "%-.*s", width, he->trace_output);
>  }
>  
>  struct sort_entry sort_trace = {
> -- 
> 2.7.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ