lkml.org 
[lkml]   [2013]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf tools: Prevent condition that all sort keys are elided
Date
From: Namhyung Kim <namhyung.kim@lge.com>

If given sort keys are all elided there'll be no output except for the
overhead column - actually the TUI shows a noisy output. In this case
it'd be better to show up the sort keys rather than elide.

Before:

$ perf report -s comm -c perf
(...)
# Overhead
# ........
#
100.00%

After:

$ perf report -s comm -c perf
(...)
# Overhead Command
# ........ .......
#
100.00% perf

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/sort.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 3c1b75c8b9a6..fb7d556ad721 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1137,6 +1137,8 @@ static void sort_entry__setup_elide(struct sort_entry *se,

void sort__setup_elide(FILE *output)
{
+ struct sort_entry *se;
+
sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list,
"dso", output);
sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list,
@@ -1172,4 +1174,14 @@ void sort__setup_elide(FILE *output)
"snoop", output);
}

+ /*
+ * It makes no sense to elide all of sort entries.
+ * Just revert them to show up again.
+ */
+ list_for_each_entry(se, &hist_entry__sort_list, list)
+ if (!se->elide)
+ return;
+
+ list_for_each_entry(se, &hist_entry__sort_list, list)
+ se->elide = false;
}
--
1.7.11.7


\
 
 \ /
  Last update: 2013-11-08 10:41    [W:0.068 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site