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

Commit 0e53909a 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:

  - Fix segfault using 'perf script --show-mmap-events', affects
    only current perf/core. (Adrian Hunter)

  - /proc/kcore requires CAP_SYS_RAWIO message too noisy, make it
    debug only. (Adrian Hunter)

  - Fix Intel PT timestamp handling. (Adrian Hunter)

  - Add Intel BTS support, with a call-graph script to show it and
    PT in use in a GUI using 'perf script' python scripting with
    postgresql and Qt. (Adrian Hunter)

  - Add checks for returned EVENT_ERROR type in libtraceevent, fixing
    a bug that surfaced on arm64 systems. (Dean Nelson)

  - Fallback to using kallsyms when libdw fails to handle a vmlinux file,
    that can happen, for instance, when perf is statically linked and
    then libdw fails to load libebl_{arch}.so. (Wang Nan)

Infrastructure changes:

  - Initialize reference counts in map__clone(). (Arnaldo Carvalho de Melo)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 82819ffb 1c0bd0e8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1745,6 +1745,9 @@ process_cond(struct event_format *event, struct print_arg *top, char **tok)
	type = process_arg(event, left, &token);

 again:
	if (type == EVENT_ERROR)
		goto out_free;

	/* Handle other operations in the arguments */
	if (type == EVENT_OP && strcmp(token, ":") != 0) {
		type = process_op(event, left, &token);
@@ -2004,6 +2007,12 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
			goto out_warn_free;

		type = process_arg_token(event, right, tok, type);
		if (type == EVENT_ERROR) {
			free_arg(right);
			/* token was freed in process_arg_token() via *tok */
			token = NULL;
			goto out_free;
		}

		if (right->type == PRINT_OP &&
		    get_op_prio(arg->op.op) < get_op_prio(right->op.op)) {
+86 −0
Original line number Diff line number Diff line
Intel Branch Trace Store
========================

Overview
========

Intel BTS could be regarded as a predecessor to Intel PT and has some
similarities because it can also identify every branch a program takes.  A
notable difference is that Intel BTS has no timing information and as a
consequence the present implementation is limited to per-thread recording.

While decoding Intel BTS does not require walking the object code, the object
code is still needed to pair up calls and returns correctly, consequently much
of the Intel PT documentation applies also to Intel BTS.  Refer to the Intel PT
documentation and consider that the PMU 'intel_bts' can usually be used in
place of 'intel_pt' in the examples provided, with the proviso that per-thread
recording must also be stipulated i.e. the --per-thread option for
'perf record'.


perf record
===========

new event
---------

The Intel BTS kernel driver creates a new PMU for Intel BTS.  The perf record
option is:

	-e intel_bts//

Currently Intel BTS is limited to per-thread tracing so the --per-thread option
is also needed.


snapshot option
---------------

The snapshot option is the same as Intel PT (refer Intel PT documentation).


auxtrace mmap size option
-----------------------

The mmap size option is the same as Intel PT (refer Intel PT documentation).


perf script
===========

By default, perf script will decode trace data found in the perf.data file.
This can be further controlled by option --itrace.  The --itrace option is
the same as Intel PT (refer Intel PT documentation) except that neither
"instructions" events nor "transactions" events (and consequently call
chains) are supported.

To disable trace decoding entirely, use the option --no-itrace.


dump option
-----------

perf script has an option (-D) to "dump" the events i.e. display the binary
data.

When -D is used, Intel BTS packets are displayed.

To disable the display of Intel BTS packets, combine the -D option with
--no-itrace.


perf report
===========

By default, perf report will decode trace data found in the perf.data file.
This can be further controlled by new option --itrace exactly the same as
perf script.


perf inject
===========

perf inject also accepts the --itrace option in which case tracing data is
removed and replaced with the synthesized events. e.g.

	perf inject --itrace -i perf.data -o perf.data.new
+22 −0
Original line number Diff line number Diff line
		i	synthesize instructions events
		b	synthesize branches events
		c	synthesize branches events (calls only)
		r	synthesize branches events (returns only)
		x	synthesize transactions events
		e	synthesize error events
		d	create a debug log
		g	synthesize a call chain (use with i or x)

	The default is all events i.e. the same as --itrace=ibxe

	In addition, the period (default 100000) for instructions events
	can be specified in units of:

		i	instructions
		t	ticks
		ms	milliseconds
		us	microseconds
		ns	nanoseconds (default)

	Also the call chain size (default 16, max. 1024) for instructions or
	transactions events can be specified.
+1 −22
Original line number Diff line number Diff line
@@ -48,28 +48,7 @@ OPTIONS
	Decode Instruction Tracing data, replacing it with synthesized events.
	Options are:

		i	synthesize instructions events
		b	synthesize branches events
		c	synthesize branches events (calls only)
		r	synthesize branches events (returns only)
		x	synthesize transactions events
		e	synthesize error events
		d	create a debug log
		g	synthesize a call chain (use with i or x)

	The default is all events i.e. the same as --itrace=ibxe

	In addition, the period (default 100000) for instructions events
	can be specified in units of:

		i	instructions
		t	ticks
		ms	milliseconds
		us	microseconds
		ns	nanoseconds (default)

	Also the call chain size (default 16, max. 1024) for instructions or
	transactions events can be specified.
include::itrace.txt[]

SEE ALSO
--------
+1 −22
Original line number Diff line number Diff line
@@ -331,28 +331,7 @@ OPTIONS
--itrace::
	Options for decoding instruction tracing data. The options are:

		i	synthesize instructions events
		b	synthesize branches events
		c	synthesize branches events (calls only)
		r	synthesize branches events (returns only)
		x	synthesize transactions events
		e	synthesize error events
		d	create a debug log
		g	synthesize a call chain (use with i or x)

	The default is all events i.e. the same as --itrace=ibxe

	In addition, the period (default 100000) for instructions events
	can be specified in units of:

		i	instructions
		t	ticks
		ms	milliseconds
		us	microseconds
		ns	nanoseconds (default)

	Also the call chain size (default 16, max. 1024) for instructions or
	transactions events can be specified.
include::itrace.txt[]

	To disable decoding entirely, use --no-itrace.

Loading