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

Commit 91e48b7d 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:

User visible changes:

 - Add 'perf record' --all-user/--all-kernel options, so that one can tell
   that all the events in the command line should be restricted to the user
   or kernel levels (Jiri Olsa), i.e.:

	perf record -e cycles:u,instructions:u

   is equivalent to:

        perf record --all-user -e cycles,instructions

 - Fix percentage update on key press, due to the buffering code
   (that creates hist_entries that will later be consumed) touching
   per hists state that is used by the display thread (Namhyung Kim)

 - Bail out when event modifiers not supported by 'perf stat' are
   specified, i.e.: (Wang Nan)

   # perf stat -e cycles/no-inherit/ usleep 1
   event syntax error: 'cycles/no-inherit/'
                        \___ 'no-inherit' is not usable in 'perf stat'
   # perf stat -e cycles/foo/ usleep 1
   event syntax error: 'cycles/foo/'
                               \___ unknown term

   valid terms: config,config1,config2,name
   #

 - Enable setting names for legacy cache, raw and numeric events, e.g: (Wang Nan)

   # perf record -e cycles -e 4:0x6530160/name=evtx,call-graph=fp/ -a sleep 1
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 1.659 MB perf.data (844 samples) ]
   # perf evlist
   cycles
   evtx
   #

Miscelaneous/Infrastructure changes:

 - Handled scaled == -1 case for counters in 'perf stat', fixing
   recent, only in perf/core, regression (Andi Kleen)

 - Reference count the cpu and thread maps at set_maps(), fixing the
   'object code reading' 'perf test' entry when it was requesting a
   perf_event_attr.sample_freq > /proc/sys/kernel/perf_event_max_sample_rate
   (Arnaldo Carvalho de Melo)

 - Improve perf_evlist__strerror_open() to provide hints for -EINVAL due
   to perf_event_attr.sample_freq > /proc/sys/kernel/perf_event_max_sample_rate
   (Arnaldo Carvalho de Melo)

 - Add checks to various callchain and histogram routines (Namhyung Kim)

 - Fix checking asprintf return value when parsing additional event config terms (Wang Nan)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 3b364d7b 5b2ea6f2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -341,6 +341,12 @@ Specify vmlinux path which has debuginfo.
--buildid-all::
Record build-id of all DSOs regardless whether it's actually hit or not.

--all-kernel::
Configure all used events to run in kernel space.

--all-user::
Configure all used events to run in user space.

SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]
+6 −0
Original line number Diff line number Diff line
@@ -1140,6 +1140,12 @@ struct option __record_options[] = {
			"per thread proc mmap processing timeout in ms"),
	OPT_BOOLEAN(0, "switch-events", &record.opts.record_switch_events,
		    "Record context switch events"),
	OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
			 "Configure all used events to run in kernel space.",
			 PARSE_OPT_EXCLUSIVE),
	OPT_BOOLEAN_FLAG(0, "all-user", &record.opts.all_user,
			 "Configure all used events to run in user space.",
			 PARSE_OPT_EXCLUSIVE),
	OPT_STRING(0, "clang-path", &llvm_param.clang_path, "clang path",
		   "clang binary to use for compiling BPF scriptlets"),
	OPT_STRING(0, "clang-opt", &llvm_param.clang_opt, "clang options",
+11 −3
Original line number Diff line number Diff line
@@ -469,10 +469,11 @@ static int report__browse_hists(struct report *rep)
	return ret;
}

static void report__collapse_hists(struct report *rep)
static int report__collapse_hists(struct report *rep)
{
	struct ui_progress prog;
	struct perf_evsel *pos;
	int ret = 0;

	ui_progress__init(&prog, rep->nr_entries, "Merging related events...");

@@ -484,7 +485,9 @@ static void report__collapse_hists(struct report *rep)

		hists->socket_filter = rep->socket_filter;

		hists__collapse_resort(hists, &prog);
		ret = hists__collapse_resort(hists, &prog);
		if (ret < 0)
			break;

		/* Non-group events are considered as leader */
		if (symbol_conf.event_group &&
@@ -497,6 +500,7 @@ static void report__collapse_hists(struct report *rep)
	}

	ui_progress__finish();
	return ret;
}

static void report__output_resort(struct report *rep)
@@ -564,7 +568,11 @@ static int __cmd_report(struct report *rep)
		}
	}

	report__collapse_hists(rep);
	ret = report__collapse_hists(rep);
	if (ret) {
		ui__error("failed to process hist entry\n");
		return ret;
	}

	if (session_done())
		return 0;
+2 −1
Original line number Diff line number Diff line
@@ -860,7 +860,7 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval,

	nl = new_line_std;

	if (run == 0 || ena == 0) {
	if (run == 0 || ena == 0 || counter->counts->scaled == -1) {
		aggr_printout(counter, id, nr);

		fprintf(stat_config.output, "%*s%s",
@@ -1831,6 +1831,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
	if (evsel_list == NULL)
		return -ENOMEM;

	parse_events__shrink_config_terms();
	argc = parse_options_subcommand(argc, argv, stat_options, stat_subcommands,
					(const char **) stat_usage,
					PARSE_OPT_STOP_AT_NON_OPTION);
+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ struct record_opts {
	bool	     full_auxtrace;
	bool	     auxtrace_snapshot_mode;
	bool	     record_switch_events;
	bool	     all_kernel;
	bool	     all_user;
	unsigned int freq;
	unsigned int mmap_pages;
	unsigned int auxtrace_mmap_pages;
Loading