[3.13.y-ckt stable] Patch "perf hists: Update the column width for the "srcline" sort key" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Oct 20 21:33:34 UTC 2015


This is a note to let you know that I have just added a patch titled

    perf hists: Update the column width for the "srcline" sort key

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt28.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 5675835c71ad9ae77b299dfc78cabcc6b4d85b0c Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme at redhat.com>
Date: Mon, 10 Aug 2015 16:53:54 -0300
Subject: perf hists: Update the column width for the "srcline" sort key

commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream.

When we introduce a new sort key, we need to update the
hists__calc_col_len() function accordingly, otherwise the width
will be limited to strlen(header).

We can't update it when obtaining a line value for a column (for
instance, in sort__srcline_cmp()), because we reset it all when doing a
resort (see hists__output_recalc_col_len()), so we need to, from what is
in the hist_entry fields, set each of the column widths.

Cc: Namhyung Kim <namhyung at kernel.org>
Cc: Andi Kleen <andi at firstfloor.org>
Cc: Jiri Olsa <jolsa at kernel.org>
Fixes: 409a8be61560 ("perf tools: Add sort by src line/number")
Link: http://lkml.kernel.org/n/tip-jgbe0yx8v1gs89cslr93pvz2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 tools/perf/util/hist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 822903e..c848cf5 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -161,6 +161,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 	hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12);
 	hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12);

+	if (h->srcline)
+		hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline));
+
 	if (h->transaction)
 		hists__new_col_len(hists, HISTC_TRANSACTION,
 				   hist_entry__transaction_len());
--
1.9.1





More information about the kernel-team mailing list