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

Commit 8a06bf14 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/urgent

Pull perf/core fixes and some late updates from Arnaldo Carvalho de Melo:

 * Make clean brace expansion fix for some shells, from Palmer Cox

 * Warn user just once per guest kernel when not finding kernel info,
   from David Ahern

 * perf test fix from Jiri Olsa

 * Fix error handling on event creation in perf top, from David Ahern

 * Fix check on perf_target__strnerror, from Namhyung Kim

 * Save the whole cmdline, from David Ahern

 * Prep work for the DWARF CFI post unwinder, so that it doesn't
   uses perf_session in lots of places, just evlist/evsel is enough.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents e7882d6c 7f309ed6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -319,6 +319,8 @@ LIB_H += $(ARCH_INCLUDE)
LIB_H += util/cgroup.h
LIB_H += $(TRACE_EVENT_DIR)event-parse.h
LIB_H += util/target.h
LIB_H += util/rblist.h
LIB_H += util/intlist.h

LIB_OBJS += $(OUTPUT)util/abspath.o
LIB_OBJS += $(OUTPUT)util/alias.o
@@ -383,6 +385,8 @@ LIB_OBJS += $(OUTPUT)util/xyarray.o
LIB_OBJS += $(OUTPUT)util/cpumap.o
LIB_OBJS += $(OUTPUT)util/cgroup.o
LIB_OBJS += $(OUTPUT)util/target.o
LIB_OBJS += $(OUTPUT)util/rblist.o
LIB_OBJS += $(OUTPUT)util/intlist.o

BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o

@@ -983,7 +987,8 @@ clean:
	$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
	$(MAKE) -C Documentation/ clean
	$(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
	$(RM) $(OUTPUT)util/*-{bison,flex}*
	$(RM) $(OUTPUT)util/*-bison*
	$(RM) $(OUTPUT)util/*-flex*
	$(python-clean)

.PHONY: all install clean strip $(LIBTRACEEVENT)
+1 −3
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static void perf_record__open(struct perf_record *rec)
		}
 	}

	perf_session__update_sample_type(session);
	perf_session__set_id_hdr_size(session);
}

static int process_buildids(struct perf_record *rec)
@@ -844,8 +844,6 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
	struct perf_record *rec = &record;
	char errbuf[BUFSIZ];

	perf_header__set_cmdline(argc, argv);

	evsel_list = perf_evlist__new(NULL, NULL);
	if (evsel_list == NULL)
		return -ENOMEM;
+3 −2
Original line number Diff line number Diff line
@@ -249,8 +249,9 @@ static int process_read_event(struct perf_tool *tool,
static int perf_report__setup_sample_type(struct perf_report *rep)
{
	struct perf_session *self = rep->session;
	u64 sample_type = perf_evlist__sample_type(self->evlist);

	if (!self->fd_pipe && !(self->sample_type & PERF_SAMPLE_CALLCHAIN)) {
	if (!self->fd_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
		if (sort__has_parent) {
			ui__error("Selected --sort parent, but no "
				    "callchain data. Did you call "
@@ -274,7 +275,7 @@ static int perf_report__setup_sample_type(struct perf_report *rep)

	if (sort__branch_mode == 1) {
		if (!self->fd_pipe &&
		    !(self->sample_type & PERF_SAMPLE_BRANCH_STACK)) {
		    !(sample_type & PERF_SAMPLE_BRANCH_STACK)) {
			ui__error("Selected -b but no branch data. "
				  "Did you call perf record without -b?\n");
			return -1;
+4 −15
Original line number Diff line number Diff line
@@ -478,7 +478,6 @@ static int test__basic_mmap(void)
	unsigned int nr_events[nsyscalls],
		     expected_nr_events[nsyscalls], i, j;
	struct perf_evsel *evsels[nsyscalls], *evsel;
	int sample_size = __perf_evsel__sample_size(attr.sample_type);

	for (i = 0; i < nsyscalls; ++i) {
		char name[64];
@@ -563,8 +562,7 @@ static int test__basic_mmap(void)
			goto out_munmap;
		}

		err = perf_event__parse_sample(event, attr.sample_type, sample_size,
					       false, &sample, false);
		err = perf_evlist__parse_sample(evlist, event, &sample, false);
		if (err) {
			pr_err("Can't parse sample, err = %d\n", err);
			goto out_munmap;
@@ -661,12 +659,12 @@ static int test__PERF_RECORD(void)
	const char *cmd = "sleep";
	const char *argv[] = { cmd, "1", NULL, };
	char *bname;
	u64 sample_type, prev_time = 0;
	u64 prev_time = 0;
	bool found_cmd_mmap = false,
	     found_libc_mmap = false,
	     found_vdso_mmap = false,
	     found_ld_mmap = false;
	int err = -1, errs = 0, i, wakeups = 0, sample_size;
	int err = -1, errs = 0, i, wakeups = 0;
	u32 cpu;
	int total_events = 0, nr_events[PERF_RECORD_MAX] = { 0, };

@@ -756,13 +754,6 @@ static int test__PERF_RECORD(void)
		goto out_delete_evlist;
	}

	/*
	 * We'll need these two to parse the PERF_SAMPLE_* fields in each
	 * event.
	 */
	sample_type = perf_evlist__sample_type(evlist);
	sample_size = __perf_evsel__sample_size(sample_type);

	/*
	 * Now that all is properly set up, enable the events, they will
	 * count just on workload.pid, which will start...
@@ -788,9 +779,7 @@ static int test__PERF_RECORD(void)
				if (type < PERF_RECORD_MAX)
					nr_events[type]++;

				err = perf_event__parse_sample(event, sample_type,
							       sample_size, true,
							       &sample, false);
				err = perf_evlist__parse_sample(evlist, event, &sample, false);
				if (err < 0) {
					if (verbose)
						perf_event__fprintf(event, stderr);
+17 −6
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include "util/cpumap.h"
#include "util/xyarray.h"
#include "util/sort.h"
#include "util/intlist.h"

#include "util/debug.h"

@@ -706,8 +707,16 @@ static void perf_event__process_sample(struct perf_tool *tool,
	int err;

	if (!machine && perf_guest) {
		static struct intlist *seen;

		if (!seen)
			seen = intlist__new();

		if (!intlist__has_entry(seen, event->ip.pid)) {
			pr_err("Can't find guest [%d]'s kernel information\n",
				event->ip.pid);
			intlist__add(seen, event->ip.pid);
		}
		return;
	}

@@ -811,7 +820,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
	int ret;

	while ((event = perf_evlist__mmap_read(top->evlist, idx)) != NULL) {
		ret = perf_session__parse_sample(session, event, &sample);
		ret = perf_evlist__parse_sample(top->evlist, event, &sample, false);
		if (ret) {
			pr_err("Can't parse sample, err = %d\n", ret);
			continue;
@@ -943,8 +952,10 @@ static void perf_top__start_counters(struct perf_top *top)
			 * based cpu-clock-tick sw counter, which
			 * is always available even if no PMU support:
			 */
			if (attr->type == PERF_TYPE_HARDWARE &&
			    attr->config == PERF_COUNT_HW_CPU_CYCLES) {
			if ((err == ENOENT || err == ENXIO) &&
			    (attr->type == PERF_TYPE_HARDWARE) &&
			    (attr->config == PERF_COUNT_HW_CPU_CYCLES)) {

				if (verbose)
					ui__warning("Cycles event not supported,\n"
						    "trying to fall back to cpu-clock-ticks\n");
@@ -1032,7 +1043,7 @@ static int __cmd_top(struct perf_top *top)
					       &top->session->host_machine);
	perf_top__start_counters(top);
	top->session->evlist = top->evlist;
	perf_session__update_sample_type(top->session);
	perf_session__set_id_hdr_size(top->session);

	/* Wait for a minimal set of events before starting the snapshot */
	poll(top->evlist->pollfd, top->evlist->nr_fds, 100);
Loading