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

Commit 0a157124 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

Merge tag 'perf-core-for-mingo-5.1-20190220' 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:

perf report:

  He Kuang:

  - Don't shadow inlined symbol with different addr range.

perf script:

  Jiri Olsa:

  - Allow +- operator to ask for -F to add/remove fields to
    the default set, for instance to ask for the removal of the
    'cpu' field in tracepoint events, adding 'period' to that
    kind of events, etc.

perf test:

  Thomas Richter:

  - Fix scheduler tracepoint signedness of COMM fields failure of
    'evsel-tp-sched' test on s390 and other arches.

  Tommi Rantala:

  - Skip trace+probe_vfs_getname.sh when 'perf trace' is not built.

perf trace:

  Arnaldo Carvalho de Melo:

  - Add initial BPF map dumper, initially just for the current, minimal
    needs of the augmented_raw_syscalls BPF example used to collect
    pointer args payloads that uses BPF maps for pid and syscall filtering,
    but will in time have features similar to 'perf stat' --interval-print,
    --interval-clear, ways to signal from a BPF event that a specific
    map (or range of that map) should be printed, optionally as a
    histogram, etc.

General:

  Jiri Olsa:

  - Add CPU and NUMA topologies classes for further reuse, fixing some
    issues in the process.

  - Fixup some warnings and debug levels.

  - Make rm_rf() remove single file, not just directories.

Documentation:

  Jonas Rabenstein:

  - Fix HEADER_CMDLINE description in perf.data documentation.

  - Fix documentation of the Flags section in perf.data.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 9ed8f1a6 b4409ae1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -159,6 +159,12 @@ OPTIONS
	the override, and the result of the above is that only S/W and H/W
	events are displayed with the given fields.

	It's possible tp add/remove fields only for specific event type:

		-Fsw:-cpu,-period

	removes cpu and period from software events.

	For the 'wildcard' option if a user selected field is invalid for an
	event type, a message is displayed to the user that the option is
	ignored for that type. For example:
+8 −0
Original line number Diff line number Diff line
@@ -210,6 +210,14 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
	may happen, for instance, when a thread gets migrated to a different CPU
	while processing a syscall.

--map-dump::
	Dump BPF maps setup by events passed via -e, for instance the augmented_raw_syscalls
	living in tools/perf/examples/bpf/augmented_raw_syscalls.c. For now this
	dumps just boolean map values and integer keys, in time this will print in hex
	by default and use BTF when available, as well as use functions to do pretty
	printing using the existing 'perf trace' syscall arg beautifiers to map integer
	arguments to strings (pid to comm, syscall id to syscall name, etc).


PAGEFAULTS
----------
+5 −6
Original line number Diff line number Diff line
@@ -43,11 +43,10 @@ struct perf_file_section {

Flags section:

The header is followed by different optional headers, described by the bits set
in flags. Only headers for which the bit is set are included. Each header
consists of a perf_file_section located after the initial header.
The respective perf_file_section points to the data of the additional
header and defines its size.
For each of the optional features a perf_file_section it placed after the data
section if the feature bit is set in the perf_header flags bitset. The
respective perf_file_section points to the data of the additional header and
defines its size.

Some headers consist of strings, which are defined like this:

@@ -131,7 +130,7 @@ An uint64_t with the total memory in bytes.

	HEADER_CMDLINE = 11,

A perf_header_string with the perf command line used to collect the data.
A perf_header_string_list with the perf arg-vector used to collect the data.

	HEADER_EVENT_DESC = 12,

+8 −0
Original line number Diff line number Diff line
@@ -2560,6 +2560,10 @@ static int parse_output_fields(const struct option *opt __maybe_unused,
			pr_warning("Overriding previous field request for %s events.\n",
				   event_type(type));

		/* Don't override defaults for +- */
		if (strchr(tok, '+') || strchr(tok, '-'))
			goto parse;

		output[type].fields = 0;
		output[type].user_set = true;
		output[type].wildcard_set = false;
@@ -2644,6 +2648,10 @@ static int parse_output_fields(const struct option *opt __maybe_unused,
				rc = -EINVAL;
				goto out;
			}
			if (change == REMOVE)
				output[type].fields &= ~all_output_options[i].field;
			else
				output[type].fields |= all_output_options[i].field;
			output[type].user_set = true;
			output[type].wildcard_set = true;
		}
+19 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <traceevent/event-parse.h>
#include <api/fs/tracing_path.h>
#include <bpf/bpf.h>
#include "util/bpf_map.h"
#include "builtin.h"
#include "util/cgroup.h"
#include "util/color.h"
@@ -87,6 +88,9 @@ struct trace {
					  *augmented;
		}		events;
	} syscalls;
	struct {
		struct bpf_map *map;
	} dump;
	struct record_opts	opts;
	struct perf_evlist	*evlist;
	struct machine		*host;
@@ -2997,6 +3001,9 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
	if (err < 0)
		goto out_error_apply_filters;

	if (trace->dump.map)
		bpf_map__fprintf(trace->dump.map, trace->output);

	err = perf_evlist__mmap(evlist, trace->opts.mmap_pages);
	if (err < 0)
		goto out_error_mmap;
@@ -3686,6 +3693,7 @@ int cmd_trace(int argc, const char **argv)
		.max_stack = UINT_MAX,
		.max_events = ULONG_MAX,
	};
	const char *map_dump_str = NULL;
	const char *output_name = NULL;
	const struct option trace_options[] = {
	OPT_CALLBACK('e', "event", &trace, "event",
@@ -3718,6 +3726,9 @@ int cmd_trace(int argc, const char **argv)
	OPT_CALLBACK(0, "duration", &trace, "float",
		     "show only events with duration > N.M ms",
		     trace__set_duration),
#ifdef HAVE_LIBBPF_SUPPORT
	OPT_STRING(0, "map-dump", &map_dump_str, "BPF map", "BPF map to periodically dump"),
#endif
	OPT_BOOLEAN(0, "sched", &trace.sched, "show blocking scheduler events"),
	OPT_INCR('v', "verbose", &verbose, "be more verbose"),
	OPT_BOOLEAN('T', "time", &trace.full_time,
@@ -3812,6 +3823,14 @@ int cmd_trace(int argc, const char **argv)

	err = -1;

	if (map_dump_str) {
		trace.dump.map = bpf__find_map_by_name(map_dump_str);
		if (trace.dump.map == NULL) {
			pr_err("ERROR: BPF map \"%s\" not found\n", map_dump_str);
			goto out;
		}
	}

	if (trace.trace_pgfaults) {
		trace.opts.sample_address = true;
		trace.opts.sample_time = true;
Loading