diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-11-08 03:53:42 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-11 13:56:40 -0500 |
commit | 7524f63b997cc02a80aa073558728ae3ee242cf8 (patch) | |
tree | 1a6d4ed801a225ff88ade9b29a6846cedce54683 /tools/perf | |
parent | a33fbd56ec83b5421090b4d8f2032f635e6a9488 (diff) |
perf tools: Prevent condition that all sort keys are elided
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>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1383900822-14609-1-git-send-email-namhyung@kernel.org
[ Us curly braces around multi-line statements, as requested by Ingo Molnar ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/sort.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 3c1b75c8b9a6..8b0bb1f4494a 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, | |||
1137 | 1137 | ||
1138 | void sort__setup_elide(FILE *output) | 1138 | void sort__setup_elide(FILE *output) |
1139 | { | 1139 | { |
1140 | struct sort_entry *se; | ||
1141 | |||
1140 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | 1142 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, |
1141 | "dso", output); | 1143 | "dso", output); |
1142 | sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, | 1144 | sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, |
@@ -1172,4 +1174,15 @@ void sort__setup_elide(FILE *output) | |||
1172 | "snoop", output); | 1174 | "snoop", output); |
1173 | } | 1175 | } |
1174 | 1176 | ||
1177 | /* | ||
1178 | * It makes no sense to elide all of sort entries. | ||
1179 | * Just revert them to show up again. | ||
1180 | */ | ||
1181 | list_for_each_entry(se, &hist_entry__sort_list, list) { | ||
1182 | if (!se->elide) | ||
1183 | return; | ||
1184 | } | ||
1185 | |||
1186 | list_for_each_entry(se, &hist_entry__sort_list, list) | ||
1187 | se->elide = false; | ||
1175 | } | 1188 | } |