Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1338886
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/5] perf tools: Fix alignment on some sort keys |
| Date | 2016-02-21 18:50 +0100 |
| Message-ID | <r4GiU-12G-59@gated-at.bofh.it> (permalink) |
| References | <r4FZw-Tg-15@gated-at.bofh.it> <r4GiU-12G-61@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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@kernel.org>
thanks,
jirka
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.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
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/5] perf tools: Fix assertion failure on dynamic entry Namhyung Kim <namhyung@kernel.org> - 2016-02-21 18:30 +0100
Re: [PATCH 1/5] perf tools: Fix assertion failure on dynamic entry Jiri Olsa <jolsa@redhat.com> - 2016-02-21 18:40 +0100
Re: [PATCH 1/5] perf tools: Fix assertion failure on dynamic entry Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-22 16:10 +0100
Re: [PATCH 3/5] perf tools: Update srcline/file if needed Jiri Olsa <jolsa@redhat.com> - 2016-02-21 18:40 +0100
[PATCH v2 3/5] perf tools: Update srcline/file if needed Namhyung Kim <namhyung@kernel.org> - 2016-02-22 01:40 +0100
Re: [PATCH v2 3/5] perf tools: Update srcline/file if needed Jiri Olsa <jolsa@redhat.com> - 2016-02-22 07:50 +0100
Re: [PATCH 2/5] perf tools: Fix segfault on dynamic entries Jiri Olsa <jolsa@redhat.com> - 2016-02-21 18:40 +0100
Re: [PATCH 5/5] perf tools: Fix column width setting on 'trace' sort key Jiri Olsa <jolsa@redhat.com> - 2016-02-21 18:50 +0100
Re: [PATCH 4/5] perf tools: Fix alignment on some sort keys Jiri Olsa <jolsa@redhat.com> - 2016-02-21 18:50 +0100
[PATCH v2 4/5] perf tools: Fix alignment on some sort keys Namhyung Kim <namhyung@kernel.org> - 2016-02-22 01:40 +0100
[PATCH 2/5] perf tools: Fix segfault on dynamic entries Namhyung Kim <namhyung@kernel.org> - 2016-02-21 19:30 +0100
[PATCH 4/5] perf tools: Fix alignment on some sort keys Namhyung Kim <namhyung@kernel.org> - 2016-02-21 19:30 +0100
[PATCH 5/5] perf tools: Fix column width setting on 'trace' sort key Namhyung Kim <namhyung@kernel.org> - 2016-02-21 19:30 +0100
[PATCH 3/5] perf tools: Update srcline/file if needed Namhyung Kim <namhyung@kernel.org> - 2016-02-21 19:40 +0100
csiph-web