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

Commit 4f16d61f 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:

  * Fix memcpy benchmark for large sizes, from Andi Kleen.

  * Support callchain sorting based on addresses, from Andi Kleen

  * Move weight back to common sort keys, From Andi Kleen.

  * Fix named threads support in 'perf script', from David Ahern.

  * Handle ENODEV on default cycles event, fix from David Ahern.

  * More install tests, from Jiri Olsa.

  * Fix build with perl 5.18, from Kirill A. Shutemov.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents ea8596bb f9ea55d0
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -115,7 +115,7 @@ OPTIONS
--dump-raw-trace::
--dump-raw-trace::
        Dump raw trace in ASCII.
        Dump raw trace in ASCII.


-g [type,min[,limit],order]::
-g [type,min[,limit],order[,key]]::
--call-graph::
--call-graph::
        Display call chains using type, min percent threshold, optional print
        Display call chains using type, min percent threshold, optional print
	limit and order.
	limit and order.
@@ -129,7 +129,11 @@ OPTIONS
	- callee: callee based call graph.
	- callee: callee based call graph.
	- caller: inverted caller based call graph.
	- caller: inverted caller based call graph.


	Default: fractal,0.5,callee.
	key can be:
	- function: compare on functions
	- address: compare on individual code addresses

	Default: fractal,0.5,callee,function.


-G::
-G::
--inverted::
--inverted::
+2 −2
Original line number Original line Diff line number Diff line
@@ -631,10 +631,10 @@ $(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<


$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef -Wno-switch-default $<


$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default $<


$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
	$(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
+2 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,8 @@ static void alloc_mem(void **dst, void **src, size_t length)
	*src = zalloc(length);
	*src = zalloc(length);
	if (!*src)
	if (!*src)
		die("memory allocation failed - maybe length is too large?\n");
		die("memory allocation failed - maybe length is too large?\n");
	/* Make sure to always replace the zero pages even if MMAP_THRESH is crossed */
	memset(*src, 0, length);
}
}


static u64 do_memcpy_cycle(memcpy_t fn, size_t len, bool prefault)
static u64 do_memcpy_cycle(memcpy_t fn, size_t len, bool prefault)
+15 −4
Original line number Original line Diff line number Diff line
@@ -667,12 +667,23 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
	}
	}


	/* get the call chain order */
	/* get the call chain order */
	if (!strcmp(tok2, "caller"))
	if (!strncmp(tok2, "caller", strlen("caller")))
		callchain_param.order = ORDER_CALLER;
		callchain_param.order = ORDER_CALLER;
	else if (!strcmp(tok2, "callee"))
	else if (!strncmp(tok2, "callee", strlen("callee")))
		callchain_param.order = ORDER_CALLEE;
		callchain_param.order = ORDER_CALLEE;
	else
	else
		return -1;
		return -1;

	/* Get the sort key */
	tok2 = strtok(NULL, ",");
	if (!tok2)
		goto setup;
	if (!strncmp(tok2, "function", strlen("function")))
		callchain_param.key = CCKEY_FUNCTION;
	else if (!strncmp(tok2, "address", strlen("address")))
		callchain_param.key = CCKEY_ADDRESS;
	else
		return -1;
setup:
setup:
	if (callchain_register_param(&callchain_param) < 0) {
	if (callchain_register_param(&callchain_param) < 0) {
		fprintf(stderr, "Can't register callchain params\n");
		fprintf(stderr, "Can't register callchain params\n");
@@ -784,8 +795,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
	OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
	OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
		    "Only display entries with parent-match"),
		    "Only display entries with parent-match"),
	OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order",
	OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order",
		     "Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit and callchain order. "
		     "Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit, callchain order, key (function or address). "
		     "Default: fractal,0.5,callee", &parse_callchain_opt, callchain_default_opt),
		     "Default: fractal,0.5,callee,function", &parse_callchain_opt, callchain_default_opt),
	OPT_BOOLEAN('G', "inverted", &report.inverted_callchain,
	OPT_BOOLEAN('G', "inverted", &report.inverted_callchain,
		    "alias for inverted call graph"),
		    "alias for inverted call graph"),
	OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
	OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
+3 −3
Original line number Original line Diff line number Diff line
@@ -397,10 +397,10 @@ static void print_sample_bts(union perf_event *event,


static void process_event(union perf_event *event, struct perf_sample *sample,
static void process_event(union perf_event *event, struct perf_sample *sample,
			  struct perf_evsel *evsel, struct machine *machine,
			  struct perf_evsel *evsel, struct machine *machine,
			  struct addr_location *al)
			  struct thread *thread,
			  struct addr_location *al __maybe_unused)
{
{
	struct perf_event_attr *attr = &evsel->attr;
	struct perf_event_attr *attr = &evsel->attr;
	struct thread *thread = al->thread;


	if (output[attr->type].fields == 0)
	if (output[attr->type].fields == 0)
		return;
		return;
@@ -511,7 +511,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
	if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
	if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
		return 0;
		return 0;


	scripting_ops->process_event(event, sample, evsel, machine, &al);
	scripting_ops->process_event(event, sample, evsel, machine, thread, &al);


	evsel->hists.stats.total_period += sample->period;
	evsel->hists.stats.total_period += sample->period;
	return 0;
	return 0;
Loading