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/builtin-report.c | |
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/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index e3598a456017..98d3891392e2 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -496,6 +496,7 @@ static int __cmd_report(struct perf_report *rep) | |||
496 | struct map *kernel_map; | 496 | struct map *kernel_map; |
497 | struct kmap *kernel_kmap; | 497 | struct kmap *kernel_kmap; |
498 | const char *help = "For a higher level overview, try: perf report --sort comm,dso"; | 498 | const char *help = "For a higher level overview, try: perf report --sort comm,dso"; |
499 | struct ui_progress prog; | ||
499 | struct perf_data_file *file = session->file; | 500 | struct perf_data_file *file = session->file; |
500 | 501 | ||
501 | signal(SIGINT, sig_handler); | 502 | signal(SIGINT, sig_handler); |
@@ -558,13 +559,19 @@ static int __cmd_report(struct perf_report *rep) | |||
558 | } | 559 | } |
559 | 560 | ||
560 | nr_samples = 0; | 561 | nr_samples = 0; |
562 | list_for_each_entry(pos, &session->evlist->entries, node) | ||
563 | nr_samples += pos->hists.nr_entries; | ||
564 | |||
565 | ui_progress__init(&prog, nr_samples, "Merging related events..."); | ||
566 | |||
567 | nr_samples = 0; | ||
561 | list_for_each_entry(pos, &session->evlist->entries, node) { | 568 | list_for_each_entry(pos, &session->evlist->entries, node) { |
562 | struct hists *hists = &pos->hists; | 569 | struct hists *hists = &pos->hists; |
563 | 570 | ||
564 | if (pos->idx == 0) | 571 | if (pos->idx == 0) |
565 | hists->symbol_filter_str = rep->symbol_filter_str; | 572 | hists->symbol_filter_str = rep->symbol_filter_str; |
566 | 573 | ||
567 | hists__collapse_resort(hists); | 574 | hists__collapse_resort(hists, &prog); |
568 | nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 575 | nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
569 | 576 | ||
570 | /* Non-group events are considered as leader */ | 577 | /* Non-group events are considered as leader */ |
@@ -576,6 +583,7 @@ static int __cmd_report(struct perf_report *rep) | |||
576 | hists__link(leader_hists, hists); | 583 | hists__link(leader_hists, hists); |
577 | } | 584 | } |
578 | } | 585 | } |
586 | ui_progress__finish(); | ||
579 | 587 | ||
580 | if (session_done()) | 588 | if (session_done()) |
581 | return 0; | 589 | return 0; |