[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160221174155.GJ10701@krava.homerouter.cpe>
Date: Sun, 21 Feb 2016 18:41:55 +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 5/5] perf tools: Fix column width setting on 'trace' sort
key
On Sun, Feb 21, 2016 at 11:22:38PM +0900, Namhyung Kim wrote:
> It missed to update column length of the 'trace' sort key in the
> hists__calc_col_len() so it might truncate the output. It calculated
> the column length in the ->cmp() callback originally but it doesn't
> guarantee it's called always.
Acked-by: Jiri Olsa <jolsa@...nel.org>
thanks,
jirka
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
> tools/perf/util/hist.c | 3 +++
> tools/perf/util/sort.c | 3 ---
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> index 827c6cbcd05d..017eb5c42c37 100644
> --- a/tools/perf/util/hist.c
> +++ b/tools/perf/util/hist.c
> @@ -179,6 +179,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
> if (h->transaction)
> hists__new_col_len(hists, HISTC_TRANSACTION,
> hist_entry__transaction_len());
> +
> + if (h->trace_output)
> + hists__new_col_len(hists, HISTC_TRACE, strlen(h->trace_output));
> }
>
> void hists__output_recalc_col_len(struct hists *hists, int max_rows)
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 1d2b85c808d0..ea05497cfee9 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -501,9 +501,6 @@ sort__trace_cmp(struct hist_entry *left, struct hist_entry *right)
> if (right->trace_output == NULL)
> right->trace_output = get_trace_output(right);
>
> - hists__new_col_len(left->hists, HISTC_TRACE, strlen(left->trace_output));
> - hists__new_col_len(right->hists, HISTC_TRACE, strlen(right->trace_output));
> -
> return strcmp(right->trace_output, left->trace_output);
> }
>
> --
> 2.7.1
>
Powered by blists - more mailing lists