Commit 59126901 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'perf-tools-fixes-for-v5.9-2020-09-03' of...

Merge tag 'perf-tools-fixes-for-v5.9-2020-09-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull more perf tools fixes from Arnaldo Carvalho de Melo:

 - Use uintptr_t when casting numbers to pointers

 - Keep output expected by 3rd parties: Turn off summary for interval
   mode by default.

 - BPF is in kernel space, make sure do_validate_kcore_modules() knows
   about that.

 - Explicitly call out event modifiers in the documentation.

 - Fix jevents() allocation of space for regular expressions.

 - Address libtraceevent build warnings on 32-bit arches.

 - Fix checking of functions returns using ERR_PTR() in 'perf bench'.

* tag 'perf-tools-fixes-for-v5.9-2020-09-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
  perf tools: Add bpf image check to __map__is_kmodule
  perf record/stat: Explicitly call out event modifiers in the documentation
  perf bench: The do_run_multi_threaded() function must use IS_ERR(perf_session__new())
  perf stat: Turn off summary for interval mode by default
  libtraceevent: Fix build warning on 32-bit arches
  perf jevents: Fix suspicious code in fixregex()
  perf parse-events: Use uintptr_t when casting numbers to pointers
parents 3e8d3bdc 830fadfd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5259,7 +5259,7 @@ static int print_arg_pointer(struct trace_seq *s, const char *format, int plen,
	default:
		ret = 0;
		val = eval_num_arg(data, size, event, arg);
		trace_seq_printf(s, "%p", (void *)val);
		trace_seq_printf(s, "%p", (void *)(intptr_t)val);
		break;
	}

+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ OPTIONS
        - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
	  hexadecimal event descriptor.

        - a symbolic or raw PMU event followed by an optional colon
	  and a list of event modifiers, e.g., cpu-cycles:p.  See the
	  linkperf:perf-list[1] man page for details on event modifiers.

	- a symbolically formed PMU event like 'pmu/param1=0x3,param2/' where
	  'param1', 'param2', etc are defined as formats for the PMU in
	  /sys/bus/event_source/devices/<pmu>/format/*.
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,10 @@ report::
	- a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
	  hexadecimal event descriptor.

        - a symbolic or raw PMU event followed by an optional colon
	  and a list of event modifiers, e.g., cpu-cycles:p.  See the
	  linkperf:perf-list[1] man page for details on event modifiers.

	- a symbolically formed event like 'pmu/param1=0x3,param2/' where
	  param1 and param2 are defined as formats for the PMU in
	  /sys/bus/event_source/devices/<pmu>/format/*
@@ -416,6 +420,9 @@ counts for all hardware threads in a core but show the sum counts per
hardware thread. This is essentially a replacement for the any bit and
convenient for post processing.

--summary::
Print summary for interval mode (-I).

EXAMPLES
--------

+2 −2
Original line number Diff line number Diff line
@@ -162,8 +162,8 @@ static int do_run_multi_threaded(struct target *target,
	init_stats(&event_stats);
	for (i = 0; i < multi_iterations; i++) {
		session = perf_session__new(NULL, false, NULL);
		if (!session)
			return -ENOMEM;
		if (IS_ERR(session))
			return PTR_ERR(session);

		atomic_set(&event_count, 0);
		gettimeofday(&start, NULL);
+5 −3
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static void read_counters(struct timespec *rs)
{
	struct evsel *counter;

	if (!stat_config.summary && (read_affinity_counters(rs) < 0))
	if (!stat_config.stop_read_counter && (read_affinity_counters(rs) < 0))
		return;

	evlist__for_each_entry(evsel_list, counter) {
@@ -897,9 +897,9 @@ try_again_reset:
	if (stat_config.walltime_run_table)
		stat_config.walltime_run[run_idx] = t1 - t0;

	if (interval) {
	if (interval && stat_config.summary) {
		stat_config.interval = 0;
		stat_config.summary = true;
		stat_config.stop_read_counter = true;
		init_stats(&walltime_nsecs_stats);
		update_stats(&walltime_nsecs_stats, t1 - t0);

@@ -1164,6 +1164,8 @@ static struct option stat_options[] = {
		    "Use with 'percore' event qualifier to show the event "
		    "counts of one hardware thread by sum up total hardware "
		    "threads of same physical core"),
	OPT_BOOLEAN(0, "summary", &stat_config.summary,
		       "print summary for interval mode"),
#ifdef HAVE_LIBPFM
	OPT_CALLBACK(0, "pfm-events", &evsel_list, "event",
		"libpfm4 event selector. use 'perf list' to list available events",
Loading