perf tools: Prevent condition that all sort keys are elided
Namhyung Kim
maintainerPATCH 1/1 perf tools: Prevent condition that all sort keys are elided
From: Namhyung Kim <[email protected]>
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--- tools/perf/util/sort.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tools/perf/util/sort.c +12 -0
@@ -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; }
Signature · 1 line
1.7.11.7
Quoted 43 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
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% perfSigned-off-by Namhyung Kim <[email protected]>--- tools/perf/util/sort.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)tools/perf/util/sort.c +2
-0@@ -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,
tools/perf/util/sort.c void sort__setup_elide(FILE *output) · line 1183
Quoted 10 lines
tools/perf/util/sort.c +7
-0@@ -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 ;
(Nit: please use curly braces around multi-line statements.)
tools/perf/util/sort.c void sort__setup_elide(FILE *output) · line 1186
Quoted 3 lines
tools/perf/util/sort.c +3
-0+ +list_for_each_entry (se, &hist_entry__sort_list, list) + se->elide = false;
Looks good otherwise - this is the first step in the sort/key behavior improvements that we talked about a few days ago, right?
Thanks,
Ingo
Namhyung Kim
maintainerHi Ingo,
Quoted 10 lines · Ingo Molnar
tools/perf/util/sort.c void sort__setup_elide(FILE *output) · line 1183
Quoted 7 lines · Namhyung Kim
tools/perf/util/sort.c +7
-0+/* +* 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 ;(Nit: please use curly braces around multi-line statements.)
Ah, okay.
Quoted 7 lines
tools/perf/util/sort.c void sort__setup_elide(FILE *output) · line 1186
Quoted 4 lines
tools/perf/util/sort.c +3
-0+ +list_for_each_entry (se, &hist_entry__sort_list, list) + se->elide = false;Looks good otherwise - this is the first step in the sort/key behavior improvements that we talked about a few days ago, right?
Right. And I'd like to wait bit more to hear other's opinion on this.
Quoted 2 lines
Acked-by Ingo Molnar <[email protected]>
Thanks,
Namhyung
tip-bot for Namhyung Kim
merge botperf tools: Prevent condition that all sort keys are elided
Commit-ID: 7524f63b997cc02a80aa073558728ae3ee242cf8 Gitweb: http://git.kernel.org/tip/7524f63b997cc02a80aa073558728ae3ee242cf8 Author: Namhyung Kim <[email protected]> AuthorDate: Fri, 8 Nov 2013 17:53:42 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 11 Nov 2013 15:56:40 -0300
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--- tools/perf/util/sort.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
tools/perf/util/sort.c +13 -0
@@ -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,15 @@ 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; }