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

Commit 007b811b authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

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

- Allow adding and removing fields to the default 'perf script' columns,
  using + or - as field prefixes to do so (Andi Kleen)

- Display titles in left frame in the annotate browser (Jin Yao)

- Allow resolving the DSO name with 'perf script -F brstack{sym,off},dso'
  (Mark Santaniello)

- Support function filtering in 'perf ftrace' (Namhyung Kim)

- Allow specifying function call depth in 'perf ftrace' (Namhyumg Kim)

Infrastructure changes:

- Adopt __noreturn, __printf, __scanf, noinline, __packed and __aligned
  __alignment__(()) markers, to make the tools/ source code base to be
  more compact and look more like kernel code (Arnaldo Carvalho de Melo)

- Remove unnecessary check in annotate_browser_write() (Jin Yao)

- Return arch from symbol__disassemble() so that callers, such as
  the annotate TUI browser to use arch specific formattings, such
  as the upcoming instruction micro-op fusion on Intel Core (Jin Yao)

- Remove superfluous check before use in the coresight code base (Kim
  Phillips)

- Remove unused SAMPLE_SIZE defines and BTS priv array (Kim Phillips)

- Error handling fix/tidy ups in 'perf config' (Taeung Song)

- Avoid error in the BPF proggie built with clang in 'perf test llvm'
  when PROFILE_ALL_BRANCHES is set (Wang Nan)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 2eb0fc9b dfe1c6d7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -19,3 +19,13 @@

/* &a[0] degrades to a pointer: a different type from an array */
#define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))

#define  noinline	__attribute__((noinline))

#define __packed	__attribute__((packed))

#define __noreturn	__attribute__((noreturn))

#define __aligned(x)	__attribute__((aligned(x)))
#define __printf(a, b)	__attribute__((format(printf, a, b)))
#define __scanf(a, b)	__attribute__((format(scanf, a, b)))
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,10 @@
# define __always_inline	inline __attribute__((always_inline))
#endif

#ifndef noinline
#define noinline
#endif

/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
+33 −0
Original line number Diff line number Diff line
@@ -48,6 +48,39 @@ OPTIONS
	Ranges of CPUs are specified with -: 0-2.
	Default is to trace on all online CPUs.

-T::
--trace-funcs=::
	Only trace functions given by the argument.  Multiple functions
	can be given by using this option more than once.  The function
	argument also can be a glob pattern.  It will be passed to
	'set_ftrace_filter' in tracefs.

-N::
--notrace-funcs=::
	Do not trace functions given by the argument.  Like -T option,
	this can be used more than once to specify multiple functions
	(or glob patterns).  It will be passed to 'set_ftrace_notrace'
	in tracefs.

-G::
--graph-funcs=::
	Set graph filter on the given function (or a glob pattern).
	This is useful for the function_graph tracer only and enables
	tracing for functions executed from the given function.
	This can be used more than once to specify multiple functions.
	It will be passed to 'set_graph_function' in tracefs.

-g::
--nograph-funcs=::
	Set graph notrace filter on the given function (or a glob pattern).
	Like -G option, this is useful for the function_graph tracer only
	and disables tracing for function executed from the given function.
	This can be used more than once to specify multiple functions.
	It will be passed to 'set_graph_notrace' in tracefs.

-D::
--graph-depth=::
	Set max depth for function graph tracer to follow

SEE ALSO
--------
+11 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ OPTIONS
--fields::
        Comma separated list of fields to print. Options are:
        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
        srcline, period, iregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
        srcline, period, iregs, brstack, brstacksym, flags, bpf-output, brstackinsn, brstackoff,
        callindent, insn, insnlen. Field list can be prepended with the type, trace, sw or hw,
        to indicate to which event type the field list applies.
        e.g., -F sw:comm,tid,time,ip,sym  and -F trace:time,cpu,trace
@@ -130,6 +130,14 @@ OPTIONS
	i.e., the specified fields apply to all event types if the type string
	is not given.

	In addition to overriding fields, it is also possible to add or remove
	fields from the defaults. For example

		-F -cpu,+insn

	removes the cpu field and adds the insn field. Adding/removing fields
	cannot be mixed with normal overriding.

	The arguments are processed in the order received. A later usage can
	reset a prior request. e.g.:

@@ -203,6 +211,8 @@ OPTIONS
	is printed. This is the full execution path leading to the sample. This is only supported when the
	sample was recorded with perf record -b or -j any.

	The brstackoff field will print an offset into a specific dso/binary.

-k::
--vmlinux=<file>::
        vmlinux pathname
+14 −15
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

#include <api/fs/fs.h>
#include <linux/bitops.h>
#include <linux/compiler.h>
#include <linux/coresight-pmu.h>
#include <linux/kernel.h>
#include <linux/log2.h>
@@ -202,19 +203,18 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
		pr_debug2("%s snapshot size: %zu\n", CORESIGHT_ETM_PMU_NAME,
			  opts->auxtrace_snapshot_size);

	if (cs_etm_evsel) {
	/*
	 * To obtain the auxtrace buffer file descriptor, the auxtrace
	 * event must come first.
	 */
	perf_evlist__to_front(evlist, cs_etm_evsel);

	/*
	 * In the case of per-cpu mmaps, we need the CPU on the
	 * AUX event.
	 */
	if (!cpu_map__empty(cpus))
		perf_evsel__set_sample_bit(cs_etm_evsel, CPU);
	}

	/* Add dummy event to keep tracking */
	if (opts->full_auxtrace) {
@@ -583,8 +583,7 @@ static FILE *cs_device__open_file(const char *name)

}

static __attribute__((format(printf, 2, 3)))
int cs_device__print_file(const char *name, const char *fmt, ...)
static int __printf(2, 3) cs_device__print_file(const char *name, const char *fmt, ...)
{
	va_list args;
	FILE *file;
Loading