From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
Andi Kleen <andi@firstfloor.org>, David Ahern <dsahern@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/15] perf tools: Fix column width setting on 'trace' sort key
Date: Mon, 22 Feb 2016 15:02:51 -0300 [thread overview]
Message-ID: <1456164180-23154-7-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1456164180-23154-1-git-send-email-acme@kernel.org>
From: Namhyung Kim <namhyung@kernel.org>
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.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1456064558-13086-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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 a7d73e503b1b..6d0f85894f38 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -483,9 +483,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.5.0
next prev parent reply other threads:[~2016-02-22 18:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 18:02 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 01/15] perf tools: Fix build on older systems Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 02/15] perf tools: Remove duplicate typedef config_term_func_t definition Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 03/15] perf tools: Fix segfault on dynamic entries Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 04/15] perf tools: Update srcline/file if needed Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 05/15] perf tools: Fix alignment on some sort keys Arnaldo Carvalho de Melo
2016-02-22 18:02 ` Arnaldo Carvalho de Melo [this message]
2016-02-22 18:02 ` [PATCH 07/15] perf tools: Fix assertion failure on dynamic entry Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 08/15] perf bpf: Add API to set values to map entries in a bpf object Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 09/15] perf tools: Enable BPF object configure syntax Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 10/15] perf record: Apply config to BPF objects before recording Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 11/15] perf tools: Enable passing event to BPF object Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 12/15] perf tools: Support setting different slots in a BPF map separately Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 13/15] perf tools: Enable indices setting syntax for BPF map Arnaldo Carvalho de Melo
2016-02-22 18:02 ` [PATCH 14/15] perf tools: Apply tracepoint event definition options to BPF script Arnaldo Carvalho de Melo
2016-02-22 18:03 ` [PATCH 15/15] perf tools: Introduce bpf-output event Arnaldo Carvalho de Melo
2016-02-24 7:21 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456164180-23154-7-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.