diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-10-11 01:15:38 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-23 14:48:24 -0400 |
commit | c1fb5651bb40f9efaf32d280f39e06df7e352673 (patch) | |
tree | d4bbd2fadb55737c20e96ed0f2db9101c9ba24a0 /tools/perf/util | |
parent | 4d3001fdfdfacd2b35ee74ff0f037274eeebd3f6 (diff) |
perf tools: Show progress on histogram collapsing
It can take quite amount of time so add progress bar UI to inform user.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1381468543-25334-4-git-send-email-namhyung@kernel.org
[ perf_progress -> ui_progress ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/hist.c | 5 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index f0b863ef4896..7e80253074b0 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -399,6 +399,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
399 | if (!he) | 399 | if (!he) |
400 | return NULL; | 400 | return NULL; |
401 | 401 | ||
402 | hists->nr_entries++; | ||
402 | rb_link_node(&he->rb_node_in, parent, p); | 403 | rb_link_node(&he->rb_node_in, parent, p); |
403 | rb_insert_color(&he->rb_node_in, hists->entries_in); | 404 | rb_insert_color(&he->rb_node_in, hists->entries_in); |
404 | out: | 405 | out: |
@@ -604,7 +605,7 @@ static void hists__apply_filters(struct hists *hists, struct hist_entry *he) | |||
604 | hists__filter_entry_by_symbol(hists, he); | 605 | hists__filter_entry_by_symbol(hists, he); |
605 | } | 606 | } |
606 | 607 | ||
607 | void hists__collapse_resort(struct hists *hists) | 608 | void hists__collapse_resort(struct hists *hists, struct ui_progress *prog) |
608 | { | 609 | { |
609 | struct rb_root *root; | 610 | struct rb_root *root; |
610 | struct rb_node *next; | 611 | struct rb_node *next; |
@@ -631,6 +632,8 @@ void hists__collapse_resort(struct hists *hists) | |||
631 | */ | 632 | */ |
632 | hists__apply_filters(hists, n); | 633 | hists__apply_filters(hists, n); |
633 | } | 634 | } |
635 | if (prog) | ||
636 | ui_progress__update(prog, 1); | ||
634 | } | 637 | } |
635 | } | 638 | } |
636 | 639 | ||
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 20b175808cd3..0c7ce8bb8eba 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <pthread.h> | 5 | #include <pthread.h> |
6 | #include "callchain.h" | 6 | #include "callchain.h" |
7 | #include "header.h" | 7 | #include "header.h" |
8 | #include "ui/progress.h" | ||
8 | 9 | ||
9 | extern struct callchain_param callchain_param; | 10 | extern struct callchain_param callchain_param; |
10 | 11 | ||
@@ -108,7 +109,7 @@ struct hist_entry *__hists__add_mem_entry(struct hists *self, | |||
108 | u64 weight); | 109 | u64 weight); |
109 | 110 | ||
110 | void hists__output_resort(struct hists *self); | 111 | void hists__output_resort(struct hists *self); |
111 | void hists__collapse_resort(struct hists *self); | 112 | void hists__collapse_resort(struct hists *self, struct ui_progress *prog); |
112 | 113 | ||
113 | void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel); | 114 | void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel); |
114 | void hists__output_recalc_col_len(struct hists *hists, int max_rows); | 115 | void hists__output_recalc_col_len(struct hists *hists, int max_rows); |