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

Commit ba63f76e authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-4.14-20170821' of...

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

- Support --show-nr-samples in annotate's --stdio and --tui, using
  the existing 't' toggle to circulate 'percent', 'total-period' and
  'nr-samples' as the first column (Taeung Song)

- Support FCMask and PortMask in JSON vendor events (Andi Kleen)

- Fix off by one string allocation problem in 'perf trace' (Arnaldo Carvalho de Melo)

- Use just one parse events state struct in yyparse(), fixing one
  reported segfault when a routine received a different data struct,
  smaller than the one it expected to use (Arnaldo Carvalho de Melo)

- Remove unused cpu_relax() macros, they stopped being used when
  tools/perf lived in Documentation/ (Arnaldo Carvalho de Melo)

- Fix double file test in libbpf's Makefile (Daniel Díaz):

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 9881223c 3a555c77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -154,10 +154,10 @@ all: fixdep $(VERSION_FILES) all_cmd
all_cmd: $(CMD_TARGETS)

$(BPF_IN): force elfdep bpfdep
	@(test -f ../../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
	@(test -f ../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
	(diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \
	echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'" >&2 )) || true
	@(test -f ../../../include/uapi/linux/bpf_common.h -a -f ../../../include/uapi/linux/bpf_common.h && ( \
	@(test -f ../../include/uapi/linux/bpf_common.h -a -f ../../../include/uapi/linux/bpf_common.h && ( \
	(diff -B ../../include/uapi/linux/bpf_common.h ../../../include/uapi/linux/bpf_common.h >/dev/null) || \
	echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf_common.h' differs from latest version at 'include/uapi/linux/bpf_common.h'" >&2 )) || true
	$(Q)$(MAKE) $(build)=libbpf
+6 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ OPTIONS
--quiet::
	Do not show any message.  (Suppress -v)

-n::
--show-nr-samples::
	Show the number of samples for each symbol

-D::
--dump-raw-trace::
        Dump raw trace in ASCII.
@@ -88,6 +92,8 @@ OPTIONS
--asm-raw::
	Show raw instruction encoding of assembly instructions.

--show-total-period:: Show a column with the sum of periods.

--source::
	Interleave source code with assembly code. Enabled by default,
	disable with --no-source.
+14 −2
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ int cmd_annotate(int argc, const char **argv)
	struct perf_data_file file = {
		.mode  = PERF_DATA_MODE_READ,
	};
	const struct option options[] = {
	struct option options[] = {
	OPT_STRING('i', "input", &input_name, "file",
		    "input file name"),
	OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
@@ -445,13 +445,20 @@ int cmd_annotate(int argc, const char **argv)
		    "Show event group information together"),
	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
		    "Show a column with the sum of periods"),
	OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
		    "Show a column with the number of samples"),
	OPT_CALLBACK_DEFAULT(0, "stdio-color", NULL, "mode",
			     "'always' (default), 'never' or 'auto' only applicable to --stdio mode",
			     stdio__config_color, "always"),
	OPT_END()
	};
	int ret = hists__init();
	int ret;

	set_option_flag(options, 0, "show-total-period", PARSE_OPT_EXCLUSIVE);
	set_option_flag(options, 0, "show-nr-samples", PARSE_OPT_EXCLUSIVE);


	ret = hists__init();
	if (ret < 0)
		return ret;

@@ -467,6 +474,11 @@ int cmd_annotate(int argc, const char **argv)
		annotate.sym_hist_filter = argv[0];
	}

	if (symbol_conf.show_nr_samples && annotate.use_gtk) {
		pr_err("--show-nr-samples is not available in --gtk mode at this time\n");
		return ret;
	}

	if (quiet)
		perf_quiet_option();

+1 −1
Original line number Diff line number Diff line
@@ -2806,7 +2806,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
	struct trace *trace = (struct trace *)opt->value;
	const char *s = str;
	char *sep = NULL, *lists[2] = { NULL, NULL, };
	int len = strlen(str), err = -1, list;
	int len = strlen(str) + 1, err = -1, list;
	char *strace_groups_dir = system_path(STRACE_GROUPS_DIR);
	char group_name[PATH_MAX];

+2 −26
Original line number Diff line number Diff line
@@ -9,16 +9,6 @@
#include <linux/perf_event.h>
#include <asm/barrier.h>

#if defined(__i386__)
#define cpu_relax()	asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC	{"model name"}
#endif

#if defined(__x86_64__)
#define cpu_relax()	asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC	{"model name"}
#endif

#ifdef __powerpc__
#define CPUINFO_PROC	{"cpu"}
#endif
@@ -43,19 +33,10 @@
#define CPUINFO_PROC	{"cpu model"}
#endif

#ifdef __ia64__
#define cpu_relax()	asm volatile ("hint @pause" ::: "memory")
#define CPUINFO_PROC	{"model name"}
#endif

#ifdef __arm__
#define CPUINFO_PROC	{"model name", "Processor"}
#endif

#ifdef __aarch64__
#define cpu_relax()	asm volatile("yield" ::: "memory")
#endif

#ifdef __mips__
#define CPUINFO_PROC	{"cpu model"}
#endif
@@ -72,13 +53,8 @@
#define CPUINFO_PROC	{"core ID"}
#endif

#ifdef __tile__
#define cpu_relax()	asm volatile ("mfspr zero, PASS" ::: "memory")
#define CPUINFO_PROC    {"model name"}
#endif

#ifndef cpu_relax
#define cpu_relax() barrier()
#ifndef CPUINFO_PROC
#define CPUINFO_PROC	{ "model name", }
#endif

static inline int
Loading