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

Commit d3aaf09f authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo' of...

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

New features:

 - Add 'L' hotkey to dynamicly set the percent threshold for histogram
   entries and callchains, i.e. dynamicly do what the --percent-limit
   command line option to 'top' and 'report' does. (Namhyung Kim)

Infrastructure changes:

 - Per hists field and sort lists, that will be used, for instance,
   in the c2c tool (Jiri Olsa)

Documentation changes:

 - Update documentation of --sort and --perf-limit options
   for 'perf report' (Namhyung Kim)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents b83ea91f b62e8dfc
Loading
Loading
Loading
Loading
+20 −17
Original line number Diff line number Diff line
@@ -117,6 +117,22 @@ OPTIONS
	And default sort keys are changed to comm, dso_from, symbol_from, dso_to
	and symbol_to, see '--branch-stack'.

	If the --mem-mode option is used, the following sort keys are also available
	(incompatible with --branch-stack):
	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.

	- symbol_daddr: name of data symbol being executed on at the time of sample
	- dso_daddr: name of library or module containing the data being executed
	on at the time of the sample
	- locked: whether the bus was locked at the time of the sample
	- tlb: type of tlb access for the data at the time of the sample
	- mem: type of memory access for the data at the time of the sample
	- snoop: type of snoop (if any) for the data at the time of the sample
	- dcacheline: the cacheline the data address is on at the time of the sample

	And the default sort keys are changed to local_weight, mem, sym, dso,
	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.

	If the data file has tracepoint event(s), following (dynamic) sort keys
	are also available:
	trace, trace_fields, [<event>.]<field>[/raw]
@@ -151,22 +167,6 @@ OPTIONS
	By default, every sort keys not specified in -F will be appended
	automatically.

	If --mem-mode option is used, following sort keys are also available
	(incompatible with --branch-stack):
	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.

	- symbol_daddr: name of data symbol being executed on at the time of sample
	- dso_daddr: name of library or module containing the data being executed
	on at the time of sample
	- locked: whether the bus was locked at the time of sample
	- tlb: type of tlb access for the data at the time of sample
	- mem: type of memory access for the data at the time of sample
	- snoop: type of snoop (if any) for the data at the time of sample
	- dcacheline: the cacheline the data address is on at the time of sample

	And default sort keys are changed to local_weight, mem, sym, dso,
	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.

-p::
--parent=<regex>::
        A regex filter to identify parent. The parent is a caller of this
@@ -351,7 +351,10 @@ OPTIONS

--percent-limit::
	Do not show entries which have an overhead under that percent.
	(Default: 0).
	(Default: 0).  Note that this option also sets the percent limit (threshold)
	of callchains.  However the default value of callchain threshold is
	different than the default value of hist entries.  Please see the
	--call-graph option for details.

--percentage::
	Determine how to display the overhead percentage of filtered entries.
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
			hists__collapse_resort(hists, NULL);
			/* Don't sort callchain */
			perf_evsel__reset_sample_bit(pos, CALLCHAIN);
			hists__output_resort(hists, NULL);
			perf_evsel__output_resort(pos, NULL);

			if (symbol_conf.event_group &&
			    !perf_evsel__is_group_leader(pos))
+10 −10
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ static void report__output_resort(struct report *rep)
	ui_progress__init(&prog, rep->nr_entries, "Sorting events for output...");

	evlist__for_each(rep->session->evlist, pos)
		hists__output_resort(evsel__hists(pos), &prog);
		perf_evsel__output_resort(pos, &prog);

	ui_progress__finish();
}
@@ -912,15 +912,6 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
		symbol_conf.cumulate_callchain = false;
	}

	if (setup_sorting(session->evlist) < 0) {
		if (sort_order)
			parse_options_usage(report_usage, options, "s", 1);
		if (field_order)
			parse_options_usage(sort_order ? NULL : report_usage,
					    options, "F", 1);
		goto error;
	}

	/* Force tty output for header output and per-thread stat. */
	if (report.header || report.header_only || report.show_threads)
		use_browser = 0;
@@ -930,6 +921,15 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
	else
		use_browser = 0;

	if (setup_sorting(session->evlist) < 0) {
		if (sort_order)
			parse_options_usage(report_usage, options, "s", 1);
		if (field_order)
			parse_options_usage(sort_order ? NULL : report_usage,
					    options, "F", 1);
		goto error;
	}

	if (report.header || report.header_only) {
		perf_session__fprintf_info(session, stdout,
					   report.show_full_info);
+13 −11
Original line number Diff line number Diff line
@@ -252,7 +252,8 @@ static void perf_top__print_sym_table(struct perf_top *top)
	char bf[160];
	int printed = 0;
	const int win_width = top->winsize.ws_col - 1;
	struct hists *hists = evsel__hists(top->sym_evsel);
	struct perf_evsel *evsel = top->sym_evsel;
	struct hists *hists = evsel__hists(evsel);

	puts(CONSOLE_CLEAR);

@@ -288,7 +289,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
	}

	hists__collapse_resort(hists, NULL);
	hists__output_resort(hists, NULL);
	perf_evsel__output_resort(evsel, NULL);

	hists__output_recalc_col_len(hists, top->print_entries - printed);
	putchar('\n');
@@ -540,6 +541,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
static void perf_top__sort_new_samples(void *arg)
{
	struct perf_top *t = arg;
	struct perf_evsel *evsel = t->sym_evsel;
	struct hists *hists;

	perf_top__reset_sample_counters(t);
@@ -547,7 +549,7 @@ static void perf_top__sort_new_samples(void *arg)
	if (t->evlist->selected != NULL)
		t->sym_evsel = t->evlist->selected;

	hists = evsel__hists(t->sym_evsel);
	hists = evsel__hists(evsel);

	if (t->evlist->enabled) {
		if (t->zero) {
@@ -559,7 +561,7 @@ static void perf_top__sort_new_samples(void *arg)
	}

	hists__collapse_resort(hists, NULL);
	hists__output_resort(hists, NULL);
	perf_evsel__output_resort(evsel, NULL);
}

static void *display_thread_tui(void *arg)
@@ -1243,6 +1245,13 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
	/* display thread wants entries to be collapsed in a different tree */
	sort__need_collapse = 1;

	if (top.use_stdio)
		use_browser = 0;
	else if (top.use_tui)
		use_browser = 1;

	setup_browser(false);

	if (setup_sorting(top.evlist) < 0) {
		if (sort_order)
			parse_options_usage(top_usage, options, "s", 1);
@@ -1252,13 +1261,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
		goto out_delete_evlist;
	}

	if (top.use_stdio)
		use_browser = 0;
	else if (top.use_tui)
		use_browser = 1;

	setup_browser(false);

	status = target__validate(target);
	if (status) {
		target__strerror(target, status, errbuf, BUFSIZ);
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static int do_test(struct hists *hists, struct result *expected, size_t nr_expec
	 * function since TEST_ASSERT_VAL() returns in case of failure.
	 */
	hists__collapse_resort(hists, NULL);
	hists__output_resort(hists, NULL);
	perf_evsel__output_resort(hists_to_evsel(hists), NULL);

	if (verbose > 2) {
		pr_info("use callchain: %d, cumulate callchain: %d\n",
Loading