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

Commit adc1ef1e 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:

 - UAPI fixes, from David Howels

 - Separate perf tests into multiple objects, one per test, from Jiri Olsa.

 - Fixes to /proc/pid/maps parsing, preparatory to supporting data maps,
   from Namhyung Kim

 - Fix compile error for non-NEWT builds, from Namhyung Kim

 - Implement ui_progress for GTK, from Namhyung Kim

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 84e53ff7 07ac002f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1321,10 +1321,12 @@ kernelversion:

# Clear a bunch of variables before executing the submake
tools/: FORCE
	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/
	$(Q)mkdir -p $(objtree)/tools
	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/

tools/%: FORCE
	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $*
	$(Q)mkdir -p $(objtree)/tools
	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $*

# Single targets
# ---------------------------------------------------------------------------
+12 −12
Original line number Diff line number Diff line
@@ -31,44 +31,44 @@ help:
	@echo '  clean: a summary clean target to clean _all_ folders'

cpupower: FORCE
	$(QUIET_SUBDIR0)power/$@/ $(QUIET_SUBDIR1)
	$(call descend,power/$@)

firewire lguest perf usb virtio vm: FORCE
	$(QUIET_SUBDIR0)$@/ $(QUIET_SUBDIR1)
	$(call descend,$@)

selftests: FORCE
	$(QUIET_SUBDIR0)testing/$@/ $(QUIET_SUBDIR1)
	$(call descend,testing/$@)

turbostat x86_energy_perf_policy: FORCE
	$(QUIET_SUBDIR0)power/x86/$@/ $(QUIET_SUBDIR1)
	$(call descend,power/x86/$@)

cpupower_install:
	$(QUIET_SUBDIR0)power/$(@:_install=)/ $(QUIET_SUBDIR1) install
	$(call descend,power/$(@:_install=),install)

firewire_install lguest_install perf_install usb_install virtio_install vm_install:
	$(QUIET_SUBDIR0)$(@:_install=)/ $(QUIET_SUBDIR1) install
	$(call descend,$(@:_install=),install)

selftests_install:
	$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) install
	$(call descend,testing/$(@:_clean=),install)

turbostat_install x86_energy_perf_policy_install:
	$(QUIET_SUBDIR0)power/x86/$(@:_install=)/ $(QUIET_SUBDIR1) install
	$(call descend,power/x86/$(@:_install=),install)

install: cpupower_install firewire_install lguest_install perf_install \
		selftests_install turbostat_install usb_install virtio_install \
		vm_install x86_energy_perf_policy_install

cpupower_clean:
	$(QUIET_SUBDIR0)power/cpupower/ $(QUIET_SUBDIR1) clean
	$(call descend,power/cpupower,clean)

firewire_clean lguest_clean perf_clean usb_clean virtio_clean vm_clean:
	$(QUIET_SUBDIR0)$(@:_clean=)/ $(QUIET_SUBDIR1) clean
	$(call descend,$(@:_clean=),clean)

selftests_clean:
	$(QUIET_SUBDIR0)testing/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
	$(call descend,testing/$(@:_clean=),clean)

turbostat_clean x86_energy_perf_policy_clean:
	$(QUIET_SUBDIR0)power/x86/$(@:_clean=)/ $(QUIET_SUBDIR1) clean
	$(call descend,power/x86/$(@:_clean=),clean)

clean: cpupower_clean firewire_clean lguest_clean perf_clean selftests_clean \
		turbostat_clean usb_clean virtio_clean vm_clean \
+15 −3
Original line number Diff line number Diff line
@@ -422,7 +422,9 @@ LIB_OBJS += $(OUTPUT)util/intlist.o
LIB_OBJS += $(OUTPUT)util/vdso.o
LIB_OBJS += $(OUTPUT)util/stat.o

LIB_OBJS += $(OUTPUT)ui/setup.o
LIB_OBJS += $(OUTPUT)ui/helpline.o
LIB_OBJS += $(OUTPUT)ui/progress.o
LIB_OBJS += $(OUTPUT)ui/hist.o
LIB_OBJS += $(OUTPUT)ui/stdio/hist.o

@@ -431,6 +433,17 @@ LIB_OBJS += $(OUTPUT)arch/common.o
LIB_OBJS += $(OUTPUT)tests/parse-events.o
LIB_OBJS += $(OUTPUT)tests/dso-data.o
LIB_OBJS += $(OUTPUT)tests/attr.o
LIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.o
LIB_OBJS += $(OUTPUT)tests/open-syscall.o
LIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.o
LIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.o
LIB_OBJS += $(OUTPUT)tests/mmap-basic.o
LIB_OBJS += $(OUTPUT)tests/perf-record.o
LIB_OBJS += $(OUTPUT)tests/rdpmc.o
LIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.o
LIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.o
LIB_OBJS += $(OUTPUT)tests/pmu.o
LIB_OBJS += $(OUTPUT)tests/util.o

BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
@@ -600,17 +613,16 @@ ifndef NO_NEWT
		BASIC_CFLAGS += -I/usr/include/slang
		BASIC_CFLAGS += -DNEWT_SUPPORT
		EXTLIBS += -lnewt -lslang
		LIB_OBJS += $(OUTPUT)ui/setup.o
		LIB_OBJS += $(OUTPUT)ui/browser.o
		LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
		LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
		LIB_OBJS += $(OUTPUT)ui/browsers/map.o
		LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
		LIB_OBJS += $(OUTPUT)ui/progress.o
		LIB_OBJS += $(OUTPUT)ui/util.o
		LIB_OBJS += $(OUTPUT)ui/tui/setup.o
		LIB_OBJS += $(OUTPUT)ui/tui/util.o
		LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
		LIB_OBJS += $(OUTPUT)ui/tui/progress.o
		LIB_H += ui/browser.h
		LIB_H += ui/browsers/map.h
		LIB_H += ui/keysyms.h
@@ -636,9 +648,9 @@ ifndef NO_GTK2
		LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
		LIB_OBJS += $(OUTPUT)ui/gtk/util.o
		LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
		LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
		# Make sure that it'd be included only once.
		ifeq ($(findstring -DNEWT_SUPPORT,$(BASIC_CFLAGS)),)
			LIB_OBJS += $(OUTPUT)ui/setup.o
			LIB_OBJS += $(OUTPUT)ui/util.o
		endif
	endif
+22 −4
Original line number Diff line number Diff line
@@ -230,11 +230,15 @@ static int perf_record__open(struct perf_record *rec)
	struct perf_record_opts *opts = &rec->opts;
	int rc = 0;

	perf_evlist__config_attrs(evlist, opts);

	/*
	 * Set the evsel leader links before we configure attributes,
	 * since some might depend on this info.
	 */
	if (opts->group)
		perf_evlist__set_leader(evlist);

	perf_evlist__config_attrs(evlist, opts);

	list_for_each_entry(pos, &evlist->entries, node) {
		struct perf_event_attr *attr = &pos->attr;
		/*
@@ -498,6 +502,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
	struct perf_evlist *evsel_list = rec->evlist;
	const char *output_name = rec->output_name;
	struct perf_session *session;
	bool disabled = false;

	rec->progname = argv[0];

@@ -697,6 +702,12 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
		}
	}

	/*
	 * When perf is starting the traced process, all the events
	 * (apart from group members) have enable_on_exec=1 set,
	 * so don't spoil it by prematurely enabling them.
	 */
	if (!perf_target__none(&opts->target))
		perf_evlist__enable(evsel_list);

	/*
@@ -720,8 +731,15 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
			waking++;
		}

		if (done)
		/*
		 * When perf is starting the traced process, at the end events
		 * die with the process and we wait for that. Thus no need to
		 * disable events in this case.
		 */
		if (done && !disabled && !perf_target__none(&opts->target)) {
			perf_evlist__disable(evsel_list);
			disabled = true;
		}
	}

	if (quiet || signr == SIGUSR1)
+5 −7
Original line number Diff line number Diff line
@@ -129,8 +129,7 @@ static struct stats runtime_itlb_cache_stats[MAX_NR_CPUS];
static struct stats runtime_dtlb_cache_stats[MAX_NR_CPUS];
static struct stats walltime_nsecs_stats;

static int create_perf_stat_counter(struct perf_evsel *evsel,
				    struct perf_evsel *first)
static int create_perf_stat_counter(struct perf_evsel *evsel)
{
	struct perf_event_attr *attr = &evsel->attr;
	bool exclude_guest_missing = false;
@@ -153,7 +152,8 @@ static int create_perf_stat_counter(struct perf_evsel *evsel,
		return 0;
	}

	if (!perf_target__has_task(&target) && (!group || evsel == first)) {
	if (!perf_target__has_task(&target) &&
	    !perf_evsel__is_group_member(evsel)) {
		attr->disabled = 1;
		attr->enable_on_exec = 1;
	}
@@ -272,7 +272,7 @@ static int read_counter(struct perf_evsel *counter)
static int __run_perf_stat(int argc __maybe_unused, const char **argv)
{
	unsigned long long t0, t1;
	struct perf_evsel *counter, *first;
	struct perf_evsel *counter;
	int status = 0;
	int child_ready_pipe[2], go_pipe[2];
	const bool forks = (argc > 0);
@@ -332,10 +332,8 @@ static int __run_perf_stat(int argc __maybe_unused, const char **argv)
	if (group)
		perf_evlist__set_leader(evsel_list);

	first = perf_evlist__first(evsel_list);

	list_for_each_entry(counter, &evsel_list->entries, node) {
		if (create_perf_stat_counter(counter, first) < 0) {
		if (create_perf_stat_counter(counter) < 0) {
			/*
			 * PPC returns ENXIO for HW counters until 2.6.37
			 * (behavior changed with commit b0a873e).
Loading