diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-03-26 20:16:22 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-02 15:27:55 -0400 |
commit | 5f4d3f8816461300ce54505c9117bf85b3044aa0 (patch) | |
tree | b69a6f22792480ab1ee02c67e5f8a650d66f208d /tools/perf/util/hist.c | |
parent | 7e5e1b1404c30db5f6bc3f5203b6c21c1d244f99 (diff) |
perf report: Add progress bars
For when we are processing the events and inserting the entries in the
browser.
Experimentation here: naming "ui_something" we may be treading into
creating a TUI/GUI set of routines that can then be implemented in terms
of multiple backends.
Also the time it takes for adding things to the "browser" takes, visually
(I guess I should do some profiling here ;-) ), more time than for
processing the events...
That means we probably need to create a custom hist_entry browser, so
that we reuse the structures we have in place instead of duplicating
them in newt.
But progress was made and at least we can see something while long files
are being loaded, that must be one of UI 101 bullet points :-)
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index de3190102cc8..a46d09332462 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -185,12 +185,13 @@ static void perf_session__insert_output_hist_entry(struct rb_root *root, | |||
185 | rb_insert_color(&he->rb_node, root); | 185 | rb_insert_color(&he->rb_node, root); |
186 | } | 186 | } |
187 | 187 | ||
188 | void perf_session__output_resort(struct rb_root *hists, u64 total_samples) | 188 | u64 perf_session__output_resort(struct rb_root *hists, u64 total_samples) |
189 | { | 189 | { |
190 | struct rb_root tmp; | 190 | struct rb_root tmp; |
191 | struct rb_node *next; | 191 | struct rb_node *next; |
192 | struct hist_entry *n; | 192 | struct hist_entry *n; |
193 | u64 min_callchain_hits; | 193 | u64 min_callchain_hits; |
194 | u64 nr_hists = 0; | ||
194 | 195 | ||
195 | min_callchain_hits = | 196 | min_callchain_hits = |
196 | total_samples * (callchain_param.min_percent / 100); | 197 | total_samples * (callchain_param.min_percent / 100); |
@@ -205,9 +206,11 @@ void perf_session__output_resort(struct rb_root *hists, u64 total_samples) | |||
205 | rb_erase(&n->rb_node, hists); | 206 | rb_erase(&n->rb_node, hists); |
206 | perf_session__insert_output_hist_entry(&tmp, n, | 207 | perf_session__insert_output_hist_entry(&tmp, n, |
207 | min_callchain_hits); | 208 | min_callchain_hits); |
209 | ++nr_hists; | ||
208 | } | 210 | } |
209 | 211 | ||
210 | *hists = tmp; | 212 | *hists = tmp; |
213 | return nr_hists; | ||
211 | } | 214 | } |
212 | 215 | ||
213 | static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) | 216 | static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) |