diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-05-23 11:15:47 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-03 15:34:59 -0400 |
commit | f29984226978313039d7dfe9b45eaa55a3aad03d (patch) | |
tree | 63ddd8b0f5ad2c748a5b419c44b2eb70af906d68 /tools/perf/ui/browsers/hists.c | |
parent | 2ec85c628c4cecef0f82d177279c579aed0f9706 (diff) |
perf tools: Move elide bool into perf_hpp_fmt struct
After output/sort fields refactoring, it's expensive
to check the elide bool in its current location inside
the 'struct sort_entry'.
The perf_hpp__should_skip function gets highly noticable in
workloads with high number of output/sort fields, like for:
$ perf report -i perf-test.data -F overhead,sample,period,comm,pid,dso,symbol,cpu --stdio
Performance report:
9.70% perf [.] perf_hpp__should_skip
Moving the elide bool into the 'struct perf_hpp_fmt', which
makes the perf_hpp__should_skip just single struct read.
Got speedup of around 22% for my test perf.data workload.
The change should not harm any other workload types.
Performance counter stats for (10 runs):
before:
358,319,732,626 cycles ( +- 0.55% )
467,129,581,515 instructions # 1.30 insns per cycle ( +- 0.00% )
150.943975206 seconds time elapsed ( +- 0.62% )
now:
278,785,972,990 cycles ( +- 0.12% )
370,146,797,640 instructions # 1.33 insns per cycle ( +- 0.00% )
116.416670507 seconds time elapsed ( +- 0.31% )
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20140601142622.GA9131@krava.brq.redhat.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/ui/browsers/hists.c')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 5905acde5f1d..52c03fbbba17 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1706,14 +1706,14 @@ zoom_dso: | |||
1706 | zoom_out_dso: | 1706 | zoom_out_dso: |
1707 | ui_helpline__pop(); | 1707 | ui_helpline__pop(); |
1708 | browser->hists->dso_filter = NULL; | 1708 | browser->hists->dso_filter = NULL; |
1709 | sort_dso.elide = false; | 1709 | perf_hpp__set_elide(HISTC_DSO, false); |
1710 | } else { | 1710 | } else { |
1711 | if (dso == NULL) | 1711 | if (dso == NULL) |
1712 | continue; | 1712 | continue; |
1713 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", | 1713 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", |
1714 | dso->kernel ? "the Kernel" : dso->short_name); | 1714 | dso->kernel ? "the Kernel" : dso->short_name); |
1715 | browser->hists->dso_filter = dso; | 1715 | browser->hists->dso_filter = dso; |
1716 | sort_dso.elide = true; | 1716 | perf_hpp__set_elide(HISTC_DSO, true); |
1717 | pstack__push(fstack, &browser->hists->dso_filter); | 1717 | pstack__push(fstack, &browser->hists->dso_filter); |
1718 | } | 1718 | } |
1719 | hists__filter_by_dso(hists); | 1719 | hists__filter_by_dso(hists); |
@@ -1725,13 +1725,13 @@ zoom_thread: | |||
1725 | zoom_out_thread: | 1725 | zoom_out_thread: |
1726 | ui_helpline__pop(); | 1726 | ui_helpline__pop(); |
1727 | browser->hists->thread_filter = NULL; | 1727 | browser->hists->thread_filter = NULL; |
1728 | sort_thread.elide = false; | 1728 | perf_hpp__set_elide(HISTC_THREAD, false); |
1729 | } else { | 1729 | } else { |
1730 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", | 1730 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", |
1731 | thread->comm_set ? thread__comm_str(thread) : "", | 1731 | thread->comm_set ? thread__comm_str(thread) : "", |
1732 | thread->tid); | 1732 | thread->tid); |
1733 | browser->hists->thread_filter = thread; | 1733 | browser->hists->thread_filter = thread; |
1734 | sort_thread.elide = true; | 1734 | perf_hpp__set_elide(HISTC_THREAD, false); |
1735 | pstack__push(fstack, &browser->hists->thread_filter); | 1735 | pstack__push(fstack, &browser->hists->thread_filter); |
1736 | } | 1736 | } |
1737 | hists__filter_by_thread(hists); | 1737 | hists__filter_by_thread(hists); |