diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-12-21 23:44:10 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-12-23 10:01:37 -0500 |
commit | 740b97f9509ac5a015278940747178af4eb0900d (patch) | |
tree | aa1bb483caf1e97401390e52c3344906b536c513 /tools/perf/builtin-report.c | |
parent | ac931f87a647ca156f65a4c00e7297165e4fa2d8 (diff) |
perf report: Show progress bar for output resorting
Sometimes it takes a long time to resort hist entries for output in case
of a large data file. Show a progress bar window and inform user.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1419223455-4362-3-git-send-email-namhyung@kernel.org
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 | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 39367609c707..072ae8ad67fc 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -457,6 +457,19 @@ static void report__collapse_hists(struct report *rep) | |||
457 | ui_progress__finish(); | 457 | ui_progress__finish(); |
458 | } | 458 | } |
459 | 459 | ||
460 | static void report__output_resort(struct report *rep) | ||
461 | { | ||
462 | struct ui_progress prog; | ||
463 | struct perf_evsel *pos; | ||
464 | |||
465 | ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); | ||
466 | |||
467 | evlist__for_each(rep->session->evlist, pos) | ||
468 | hists__output_resort(evsel__hists(pos), &prog); | ||
469 | |||
470 | ui_progress__finish(); | ||
471 | } | ||
472 | |||
460 | static int __cmd_report(struct report *rep) | 473 | static int __cmd_report(struct report *rep) |
461 | { | 474 | { |
462 | int ret; | 475 | int ret; |
@@ -505,13 +518,20 @@ static int __cmd_report(struct report *rep) | |||
505 | if (session_done()) | 518 | if (session_done()) |
506 | return 0; | 519 | return 0; |
507 | 520 | ||
521 | /* | ||
522 | * recalculate number of entries after collapsing since it | ||
523 | * might be changed during the collapse phase. | ||
524 | */ | ||
525 | rep->nr_entries = 0; | ||
526 | evlist__for_each(session->evlist, pos) | ||
527 | rep->nr_entries += evsel__hists(pos)->nr_entries; | ||
528 | |||
508 | if (rep->nr_entries == 0) { | 529 | if (rep->nr_entries == 0) { |
509 | ui__error("The %s file has no samples!\n", file->path); | 530 | ui__error("The %s file has no samples!\n", file->path); |
510 | return 0; | 531 | return 0; |
511 | } | 532 | } |
512 | 533 | ||
513 | evlist__for_each(session->evlist, pos) | 534 | report__output_resort(rep); |
514 | hists__output_resort(evsel__hists(pos)); | ||
515 | 535 | ||
516 | return report__browse_hists(rep); | 536 | return report__browse_hists(rep); |
517 | } | 537 | } |