Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1fb5651 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarNamhyung 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4d3001fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ static int __cmd_annotate(struct perf_annotate *ann)

		if (nr_samples > 0) {
			total_nr_samples += nr_samples;
			hists__collapse_resort(hists);
			hists__collapse_resort(hists, NULL);
			hists__output_resort(hists);

			if (symbol_conf.event_group &&
+1 −1
Original line number Diff line number Diff line
@@ -369,7 +369,7 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
	list_for_each_entry(evsel, &evlist->entries, node) {
		struct hists *hists = &evsel->hists;

		hists__collapse_resort(hists);
		hists__collapse_resort(hists, NULL);
	}
}

+9 −1
Original line number Diff line number Diff line
@@ -496,6 +496,7 @@ static int __cmd_report(struct perf_report *rep)
	struct map *kernel_map;
	struct kmap *kernel_kmap;
	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
	struct ui_progress prog;
	struct perf_data_file *file = session->file;

	signal(SIGINT, sig_handler);
@@ -557,6 +558,12 @@ static int __cmd_report(struct perf_report *rep)
		return 0;
	}

	nr_samples = 0;
	list_for_each_entry(pos, &session->evlist->entries, node)
		nr_samples += pos->hists.nr_entries;

	ui_progress__init(&prog, nr_samples, "Merging related events...");

	nr_samples = 0;
	list_for_each_entry(pos, &session->evlist->entries, node) {
		struct hists *hists = &pos->hists;
@@ -564,7 +571,7 @@ static int __cmd_report(struct perf_report *rep)
		if (pos->idx == 0)
			hists->symbol_filter_str = rep->symbol_filter_str;

		hists__collapse_resort(hists);
		hists__collapse_resort(hists, &prog);
		nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];

		/* Non-group events are considered as leader */
@@ -576,6 +583,7 @@ static int __cmd_report(struct perf_report *rep)
			hists__link(leader_hists, hists);
		}
	}
	ui_progress__finish();

	if (session_done())
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
		return;
	}

	hists__collapse_resort(&top->sym_evsel->hists);
	hists__collapse_resort(&top->sym_evsel->hists, NULL);
	hists__output_resort(&top->sym_evsel->hists);
	hists__decay_entries(&top->sym_evsel->hists,
			     top->hide_user_symbols,
@@ -552,7 +552,7 @@ static void perf_top__sort_new_samples(void *arg)
	if (t->evlist->selected != NULL)
		t->sym_evsel = t->evlist->selected;

	hists__collapse_resort(&t->sym_evsel->hists);
	hists__collapse_resort(&t->sym_evsel->hists, NULL);
	hists__output_resort(&t->sym_evsel->hists);
	hists__decay_entries(&t->sym_evsel->hists,
			     t->hide_user_symbols,
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ int test__hists_link(void)
		goto out;

	list_for_each_entry(evsel, &evlist->entries, node) {
		hists__collapse_resort(&evsel->hists);
		hists__collapse_resort(&evsel->hists, NULL);

		if (verbose > 2)
			print_hists(&evsel->hists);
Loading