Skip to contentSkip to conversation

perf tools: Initial libperf separation

RFC In review Jiri Olsa 9 participants 192 messages Jul 21, 2019 – Aug 23, 2019 Page 2 of 5

Subsystems (9)
lore
Share & tools
lore
author reviewer
#15 lore raw

PATCH 8/79 perf tools: Rename perf_evlist__new to evlist__new

In reply to Jiri Olsa

Renaming perf_evlist__new to evlist__new, so we don't have a name clash when we add perf_evlist__new in libperf.

---
 tools/perf/arch/powerpc/util/kvm-stat.c      | 2 +-
 tools/perf/arch/x86/tests/intel-cqm.c        | 2 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-ftrace.c                  | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 2 +-
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-top.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 2 +-
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/event-times.c               | 2 +-
 tools/perf/tests/evsel-roundtrip-name.c      | 4 ++--
 tools/perf/tests/hists_cumulate.c            | 2 +-
 tools/perf/tests/hists_filter.c              | 2 +-
 tools/perf/tests/hists_link.c                | 2 +-
 tools/perf/tests/hists_output.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 2 +-
 tools/perf/tests/mmap-basic.c                | 2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/parse-events.c              | 2 +-
 tools/perf/tests/sw-clock.c                  | 4 ++--
 tools/perf/tests/switch-tracking.c           | 4 ++--
 tools/perf/util/evlist.c                     | 8 ++++----
 tools/perf/util/evlist.h                     | 2 +-
 tools/perf/util/header.c                     | 4 ++--
 tools/perf/util/record.c                     | 4 ++--
 28 files changed, 36 insertions(+), 36 deletions(-)
tools/perf/arch/powerpc/util/kvm-stat.c +1 -1
index 28fc0bab370f..f0dbf7b075c8 100644
@@ -146,7 +146,7 @@ static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,
 /* Wrapper to setup kvm tracepoints */
 static int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist == NULL)
 		return -ENOMEM;
tools/perf/arch/x86/tests/intel-cqm.c +1 -1
index 333b2f0d61e4..8089a33c6c16 100644
@@ -51,7 +51,7 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
 
 	flag = perf_event_open_cloexec_flag();
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("perf_evlist__new failed\n");
 		return TEST_FAIL;
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index d7092fc00e3b..da9a3302d8e6 100644
@@ -68,7 +68,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	cpus = cpu_map__new(NULL);
 	CHECK_NOT_NULL__(cpus);
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	CHECK_NOT_NULL__(evlist);
 
 	perf_evlist__set_maps(evlist, cpus, threads);
tools/perf/builtin-ftrace.c +1 -1
index 1263987c291a..b8bdc593e5b8 100644
@@ -495,7 +495,7 @@ int cmd_ftrace(int argc, const char **argv)
 		goto out_delete_filters;
 	}
 
-	ftrace.evlist = perf_evlist__new();
+	ftrace.evlist = evlist__new();
 	if (ftrace.evlist == NULL) {
 		ret = -ENOMEM;
 		goto out_delete_filters;
tools/perf/builtin-kvm.c +1 -1
index 963dddc5853d..ee896b8a9fe8 100644
@@ -1290,7 +1290,7 @@ static struct evlist *kvm_live_event_list(void)
 	int err = -1;
 	const char * const *events_tp;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL)
 		return NULL;
 
tools/perf/builtin-record.c +1 -1
index f08d1e6a1651..e8aa8a078dff 100644
@@ -2265,7 +2265,7 @@ int cmd_record(int argc, const char **argv)
 	CPU_ZERO(&rec->affinity_mask);
 	rec->opts.affinity = PERF_AFFINITY_SYS;
 
-	rec->evlist = perf_evlist__new();
+	rec->evlist = evlist__new();
 	if (rec->evlist == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-stat.c +1 -1
index 4e61f8a1d22b..ee0dc8088ac0 100644
@@ -1702,7 +1702,7 @@ int cmd_stat(int argc, const char **argv)
 
 	setlocale(LC_ALL, "");
 
-	evsel_list = perf_evlist__new();
+	evsel_list = evlist__new();
 	if (evsel_list == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-top.c +1 -1
index c29fa1de854f..e4b7146cd666 100644
@@ -1524,7 +1524,7 @@ int cmd_top(int argc, const char **argv)
 	top.annotation_opts.min_pcnt = 5;
 	top.annotation_opts.context  = 4;
 
-	top.evlist = perf_evlist__new();
+	top.evlist = evlist__new();
 	if (top.evlist == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-trace.c +1 -1
index dffff18f74cd..f96d67ca3182 100644
@@ -4171,7 +4171,7 @@ int cmd_trace(int argc, const char **argv)
 	signal(SIGSEGV, sighandler_dump_stack);
 	signal(SIGFPE, sighandler_dump_stack);
 
-	trace.evlist = perf_evlist__new();
+	trace.evlist = evlist__new();
 	trace.sctbl = syscalltbl__new();
 
 	if (trace.evlist == NULL || trace.sctbl == NULL) {
tools/perf/tests/backward-ring-buffer.c +1 -1
index 3f9c931069b0..3883b315b25b 100644
@@ -99,7 +99,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 	pid[sizeof(pid) - 1] = '\0';
 	opts.target.tid = opts.target.pid = pid;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("Not enough memory to create evlist\n");
 		return TEST_FAIL;
tools/perf/tests/bpf.c +1 -1
index 95a15b51f95c..d15f62dc4261 100644
@@ -140,7 +140,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	opts.target.tid = opts.target.pid = pid;
 
 	/* Instead of perf_evlist__new_default, don't add default events */
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("Not enough memory to create evlist\n");
 		return TEST_FAIL;
tools/perf/tests/code-reading.c +1 -1
index 168deb9c563e..dd0325eabc25 100644
@@ -622,7 +622,7 @@ static int do_test_code_reading(bool try_kcore)
 	while (1) {
 		const char *str;
 
-		evlist = perf_evlist__new();
+		evlist = evlist__new();
 		if (!evlist) {
 			pr_debug("perf_evlist__new failed\n");
 			goto out_put;
tools/perf/tests/event-times.c +1 -1
index c3545a6efcbc..8d3cf9792d9e 100644
@@ -166,7 +166,7 @@ static int test_times(int (attach)(struct evlist *),
 	struct evsel *evsel;
 	int err = -1, i;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("failed to create event list\n");
 		goto out_err;
tools/perf/tests/evsel-roundtrip-name.c +2 -2
index 6cc408b23026..74e79d6b7e96 100644
@@ -12,7 +12,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
 	char name[128];
 	int type, op, err = 0, ret = 0, i, idx;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
@@ -68,7 +68,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
 {
 	int i, err;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
tools/perf/tests/hists_cumulate.c +1 -1
index d7a6b97683d6..897e74b5ed1f 100644
@@ -695,7 +695,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	size_t i;
 	test_fn_t testcases[] = {
 		test1,
tools/perf/tests/hists_filter.c +1 -1
index 9f0d6af839e9..b0468db74ca3 100644
@@ -109,7 +109,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	TEST_ASSERT_VAL("No memory", evlist);
 
tools/perf/tests/hists_link.c +1 -1
index 6ab27dd3bf3f..878cb5bfbe78 100644
@@ -272,7 +272,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
 	struct machines machines;
 	struct machine *machine = NULL;
 	struct evsel *evsel, *first;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist == NULL)
                 return -ENOMEM;
tools/perf/tests/hists_output.c +1 -1
index cd36e51cdf3b..87a05e7afb7e 100644
@@ -581,7 +581,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	size_t i;
 	test_fn_t testcases[] = {
 		test1,
tools/perf/tests/keep-tracking.c +1 -1
index e0779f2a340c..4c73377bfccb 100644
@@ -78,7 +78,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	cpus = cpu_map__new(NULL);
 	CHECK_NOT_NULL__(cpus);
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	CHECK_NOT_NULL__(evlist);
 
 	perf_evlist__set_maps(evlist, cpus, threads);
tools/perf/tests/mmap-basic.c +1 -1
index 749b580e9a92..8d1be34fd951 100644
@@ -61,7 +61,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 		goto out_free_cpus;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL) {
 		pr_debug("perf_evlist__new\n");
 		goto out_free_cpus;
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 69bf0ec2fe5f..141592437520 100644
@@ -32,7 +32,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 	};
 	const char *filename = "/etc/passwd";
 	int flags = O_RDONLY | O_DIRECTORY;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	struct evsel *evsel;
 	int err = -1, i, nr_events = 0, nr_polls = 0;
 	char sbuf[STRERR_BUFSIZE];
tools/perf/tests/parse-events.c +1 -1
index 7409eed11b65..6e81a930b224 100644
@@ -1777,7 +1777,7 @@ static int test_event(struct evlist_test *e)
 		return 0;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL)
 		return -ENOMEM;
 
tools/perf/tests/sw-clock.c +2 -2
index 69b997eeb639..88a75cbae230 100644
@@ -43,9 +43,9 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 
 	attr.sample_freq = 500;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL) {
-		pr_debug("perf_evlist__new\n");
+		pr_debug("evlist__new\n");
 		return -1;
 	}
 
tools/perf/tests/switch-tracking.c +2 -2
index 3e26ea36ec29..89bc20b2178a 100644
@@ -347,9 +347,9 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
-		pr_debug("perf_evlist__new failed!\n");
+		pr_debug("evlist__new failed!\n");
 		goto out_err;
 	}
 
tools/perf/util/evlist.c +4 -4
index 4fcd55c8a8d5..317b2d64ba6d 100644
@@ -55,7 +55,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 	evlist->bkw_mmap_state = BKW_MMAP_NOTREADY;
 }
 
-struct evlist *perf_evlist__new(void)
+struct evlist *evlist__new(void)
 {
 	struct evlist *evlist = zalloc(sizeof(*evlist));
 
@@ -67,7 +67,7 @@ struct evlist *perf_evlist__new(void)
 
 struct evlist *perf_evlist__new_default(void)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_default(evlist)) {
 		perf_evlist__delete(evlist);
@@ -79,7 +79,7 @@ struct evlist *perf_evlist__new_default(void)
 
 struct evlist *perf_evlist__new_dummy(void)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_dummy(evlist)) {
 		perf_evlist__delete(evlist);
@@ -1839,7 +1839,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 	bool new_evlist = (*evlist) == NULL;
 
 	if (*evlist == NULL)
-		*evlist = perf_evlist__new();
+		*evlist = evlist__new();
 	if (*evlist == NULL)
 		return -1;
 
tools/perf/util/evlist.h +1 -1
index d6a3fa461566..60e1c9268e9e 100644
@@ -65,7 +65,7 @@ struct evsel_str_handler {
 	void	   *handler;
 };
 
-struct evlist *perf_evlist__new(void);
+struct evlist *evlist__new(void);
 struct evlist *perf_evlist__new_default(void);
 struct evlist *perf_evlist__new_dummy(void);
 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
tools/perf/util/header.c +2 -2
index 23a24fff4d7e..5234e7186456 100644
@@ -3535,7 +3535,7 @@ int perf_session__read_header(struct perf_session *session)
 	int nr_attrs, nr_ids, i, j;
 	int fd = perf_data__fd(data);
 
-	session->evlist = perf_evlist__new();
+	session->evlist = evlist__new();
 	if (session->evlist == NULL)
 		return -ENOMEM;
 
@@ -4009,7 +4009,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 	struct evlist *evlist = *pevlist;
 
 	if (evlist == NULL) {
-		*pevlist = evlist = perf_evlist__new();
+		*pevlist = evlist = evlist__new();
 		if (evlist == NULL)
 			return -ENOMEM;
 	}
tools/perf/util/record.c +2 -2
index a550d78a0b4d..a23c69137dfc 100644
@@ -19,7 +19,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
 	int err = -EAGAIN, fd;
 	static pid_t pid = -1;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist)
 		return -ENOMEM;
 
@@ -264,7 +264,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 	bool ret = false;
 	pid_t pid = -1;
 
-	temp_evlist = perf_evlist__new();
+	temp_evlist = evlist__new();
 	if (!temp_evlist)
 		return false;
 
Signature · 1 line
2.21.0
#16 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__new() to evlist__new()

perf evlist: Rename perf_evlist__new() to evlist__new()
Commit-ID:  0f98b11c616f240b54ee85629ff4d3650c7ccc7d
Gitweb:     https://git.kernel.org/tip/0f98b11c616f240b54ee85629ff4d3650c7ccc7d
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:23:55 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__new() to evlist__new()

Rename perf_evlist__new() to evlist__new(), so we don't have a name clash when we add perf_evlist__new() in libperf.

---
 tools/perf/arch/powerpc/util/kvm-stat.c      | 2 +-
 tools/perf/arch/x86/tests/intel-cqm.c        | 2 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-ftrace.c                  | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 2 +-
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-top.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 2 +-
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/event-times.c               | 2 +-
 tools/perf/tests/evsel-roundtrip-name.c      | 4 ++--
 tools/perf/tests/hists_cumulate.c            | 2 +-
 tools/perf/tests/hists_filter.c              | 2 +-
 tools/perf/tests/hists_link.c                | 2 +-
 tools/perf/tests/hists_output.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 2 +-
 tools/perf/tests/mmap-basic.c                | 2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/parse-events.c              | 2 +-
 tools/perf/tests/sw-clock.c                  | 4 ++--
 tools/perf/tests/switch-tracking.c           | 4 ++--
 tools/perf/util/evlist.c                     | 8 ++++----
 tools/perf/util/evlist.h                     | 2 +-
 tools/perf/util/header.c                     | 4 ++--
 tools/perf/util/record.c                     | 4 ++--
 28 files changed, 36 insertions(+), 36 deletions(-)
tools/perf/arch/powerpc/util/kvm-stat.c +1 -1
index 28fc0bab370f..f0dbf7b075c8 100644
@@ -146,7 +146,7 @@ static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,
 /* Wrapper to setup kvm tracepoints */
 static int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist == NULL)
 		return -ENOMEM;
tools/perf/arch/x86/tests/intel-cqm.c +1 -1
index 333b2f0d61e4..8089a33c6c16 100644
@@ -51,7 +51,7 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
 
 	flag = perf_event_open_cloexec_flag();
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("perf_evlist__new failed\n");
 		return TEST_FAIL;
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index d7092fc00e3b..da9a3302d8e6 100644
@@ -68,7 +68,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	cpus = cpu_map__new(NULL);
 	CHECK_NOT_NULL__(cpus);
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	CHECK_NOT_NULL__(evlist);
 
 	perf_evlist__set_maps(evlist, cpus, threads);
tools/perf/builtin-ftrace.c +1 -1
index 1263987c291a..b8bdc593e5b8 100644
@@ -495,7 +495,7 @@ int cmd_ftrace(int argc, const char **argv)
 		goto out_delete_filters;
 	}
 
-	ftrace.evlist = perf_evlist__new();
+	ftrace.evlist = evlist__new();
 	if (ftrace.evlist == NULL) {
 		ret = -ENOMEM;
 		goto out_delete_filters;
tools/perf/builtin-kvm.c +1 -1
index 963dddc5853d..ee896b8a9fe8 100644
@@ -1290,7 +1290,7 @@ static struct evlist *kvm_live_event_list(void)
 	int err = -1;
 	const char * const *events_tp;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL)
 		return NULL;
 
tools/perf/builtin-record.c +1 -1
index f08d1e6a1651..e8aa8a078dff 100644
@@ -2265,7 +2265,7 @@ int cmd_record(int argc, const char **argv)
 	CPU_ZERO(&rec->affinity_mask);
 	rec->opts.affinity = PERF_AFFINITY_SYS;
 
-	rec->evlist = perf_evlist__new();
+	rec->evlist = evlist__new();
 	if (rec->evlist == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-stat.c +1 -1
index 4e61f8a1d22b..ee0dc8088ac0 100644
@@ -1702,7 +1702,7 @@ int cmd_stat(int argc, const char **argv)
 
 	setlocale(LC_ALL, "");
 
-	evsel_list = perf_evlist__new();
+	evsel_list = evlist__new();
 	if (evsel_list == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-top.c +1 -1
index c29fa1de854f..e4b7146cd666 100644
@@ -1524,7 +1524,7 @@ int cmd_top(int argc, const char **argv)
 	top.annotation_opts.min_pcnt = 5;
 	top.annotation_opts.context  = 4;
 
-	top.evlist = perf_evlist__new();
+	top.evlist = evlist__new();
 	if (top.evlist == NULL)
 		return -ENOMEM;
 
tools/perf/builtin-trace.c +1 -1
index f7e7daac3cbe..767b04eaaf45 100644
@@ -4169,7 +4169,7 @@ int cmd_trace(int argc, const char **argv)
 	signal(SIGSEGV, sighandler_dump_stack);
 	signal(SIGFPE, sighandler_dump_stack);
 
-	trace.evlist = perf_evlist__new();
+	trace.evlist = evlist__new();
 	trace.sctbl = syscalltbl__new();
 
 	if (trace.evlist == NULL || trace.sctbl == NULL) {
tools/perf/tests/backward-ring-buffer.c +1 -1
index 3f9c931069b0..3883b315b25b 100644
@@ -99,7 +99,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 	pid[sizeof(pid) - 1] = '\0';
 	opts.target.tid = opts.target.pid = pid;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("Not enough memory to create evlist\n");
 		return TEST_FAIL;
tools/perf/tests/bpf.c +1 -1
index 95a15b51f95c..d15f62dc4261 100644
@@ -140,7 +140,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	opts.target.tid = opts.target.pid = pid;
 
 	/* Instead of perf_evlist__new_default, don't add default events */
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("Not enough memory to create evlist\n");
 		return TEST_FAIL;
tools/perf/tests/code-reading.c +1 -1
index 168deb9c563e..dd0325eabc25 100644
@@ -622,7 +622,7 @@ static int do_test_code_reading(bool try_kcore)
 	while (1) {
 		const char *str;
 
-		evlist = perf_evlist__new();
+		evlist = evlist__new();
 		if (!evlist) {
 			pr_debug("perf_evlist__new failed\n");
 			goto out_put;
tools/perf/tests/event-times.c +1 -1
index c3545a6efcbc..8d3cf9792d9e 100644
@@ -166,7 +166,7 @@ static int test_times(int (attach)(struct evlist *),
 	struct evsel *evsel;
 	int err = -1, i;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
 		pr_debug("failed to create event list\n");
 		goto out_err;
tools/perf/tests/evsel-roundtrip-name.c +2 -2
index 6cc408b23026..74e79d6b7e96 100644
@@ -12,7 +12,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
 	char name[128];
 	int type, op, err = 0, ret = 0, i, idx;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
@@ -68,7 +68,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
 {
 	int i, err;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
tools/perf/tests/hists_cumulate.c +1 -1
index d7a6b97683d6..897e74b5ed1f 100644
@@ -695,7 +695,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	size_t i;
 	test_fn_t testcases[] = {
 		test1,
tools/perf/tests/hists_filter.c +1 -1
index 9f0d6af839e9..b0468db74ca3 100644
@@ -109,7 +109,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	TEST_ASSERT_VAL("No memory", evlist);
 
tools/perf/tests/hists_link.c +1 -1
index 6ab27dd3bf3f..878cb5bfbe78 100644
@@ -272,7 +272,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
 	struct machines machines;
 	struct machine *machine = NULL;
 	struct evsel *evsel, *first;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist == NULL)
                 return -ENOMEM;
tools/perf/tests/hists_output.c +1 -1
index cd36e51cdf3b..87a05e7afb7e 100644
@@ -581,7 +581,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
 	struct machines machines;
 	struct machine *machine;
 	struct evsel *evsel;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	size_t i;
 	test_fn_t testcases[] = {
 		test1,
tools/perf/tests/keep-tracking.c +1 -1
index e0779f2a340c..4c73377bfccb 100644
@@ -78,7 +78,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	cpus = cpu_map__new(NULL);
 	CHECK_NOT_NULL__(cpus);
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	CHECK_NOT_NULL__(evlist);
 
 	perf_evlist__set_maps(evlist, cpus, threads);
tools/perf/tests/mmap-basic.c +1 -1
index 749b580e9a92..8d1be34fd951 100644
@@ -61,7 +61,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 		goto out_free_cpus;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL) {
 		pr_debug("perf_evlist__new\n");
 		goto out_free_cpus;
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 69bf0ec2fe5f..141592437520 100644
@@ -32,7 +32,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 	};
 	const char *filename = "/etc/passwd";
 	int flags = O_RDONLY | O_DIRECTORY;
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 	struct evsel *evsel;
 	int err = -1, i, nr_events = 0, nr_polls = 0;
 	char sbuf[STRERR_BUFSIZE];
tools/perf/tests/parse-events.c +1 -1
index 7409eed11b65..6e81a930b224 100644
@@ -1777,7 +1777,7 @@ static int test_event(struct evlist_test *e)
 		return 0;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL)
 		return -ENOMEM;
 
tools/perf/tests/sw-clock.c +2 -2
index 69b997eeb639..88a75cbae230 100644
@@ -43,9 +43,9 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 
 	attr.sample_freq = 500;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (evlist == NULL) {
-		pr_debug("perf_evlist__new\n");
+		pr_debug("evlist__new\n");
 		return -1;
 	}
 
tools/perf/tests/switch-tracking.c +2 -2
index 3e26ea36ec29..89bc20b2178a 100644
@@ -347,9 +347,9 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist) {
-		pr_debug("perf_evlist__new failed!\n");
+		pr_debug("evlist__new failed!\n");
 		goto out_err;
 	}
 
tools/perf/util/evlist.c +4 -4
index 4fcd55c8a8d5..317b2d64ba6d 100644
@@ -55,7 +55,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 	evlist->bkw_mmap_state = BKW_MMAP_NOTREADY;
 }
 
-struct evlist *perf_evlist__new(void)
+struct evlist *evlist__new(void)
 {
 	struct evlist *evlist = zalloc(sizeof(*evlist));
 
@@ -67,7 +67,7 @@ struct evlist *perf_evlist__new(void)
 
 struct evlist *perf_evlist__new_default(void)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_default(evlist)) {
 		perf_evlist__delete(evlist);
@@ -79,7 +79,7 @@ struct evlist *perf_evlist__new_default(void)
 
 struct evlist *perf_evlist__new_dummy(void)
 {
-	struct evlist *evlist = perf_evlist__new();
+	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_dummy(evlist)) {
 		perf_evlist__delete(evlist);
@@ -1839,7 +1839,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 	bool new_evlist = (*evlist) == NULL;
 
 	if (*evlist == NULL)
-		*evlist = perf_evlist__new();
+		*evlist = evlist__new();
 	if (*evlist == NULL)
 		return -1;
 
tools/perf/util/evlist.h +1 -1
index d6a3fa461566..60e1c9268e9e 100644
@@ -65,7 +65,7 @@ struct evsel_str_handler {
 	void	   *handler;
 };
 
-struct evlist *perf_evlist__new(void);
+struct evlist *evlist__new(void);
 struct evlist *perf_evlist__new_default(void);
 struct evlist *perf_evlist__new_dummy(void);
 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
tools/perf/util/header.c +2 -2
index 692fe8ac12ae..5b90786a8436 100644
@@ -3535,7 +3535,7 @@ int perf_session__read_header(struct perf_session *session)
 	int nr_attrs, nr_ids, i, j;
 	int fd = perf_data__fd(data);
 
-	session->evlist = perf_evlist__new();
+	session->evlist = evlist__new();
 	if (session->evlist == NULL)
 		return -ENOMEM;
 
@@ -4016,7 +4016,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 	struct evlist *evlist = *pevlist;
 
 	if (evlist == NULL) {
-		*pevlist = evlist = perf_evlist__new();
+		*pevlist = evlist = evlist__new();
 		if (evlist == NULL)
 			return -ENOMEM;
 	}
tools/perf/util/record.c +2 -2
index a550d78a0b4d..a23c69137dfc 100644
@@ -19,7 +19,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
 	int err = -EAGAIN, fd;
 	static pid_t pid = -1;
 
-	evlist = perf_evlist__new();
+	evlist = evlist__new();
 	if (!evlist)
 		return -ENOMEM;
 
@@ -264,7 +264,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 	bool ret = false;
 	pid_t pid = -1;
 
-	temp_evlist = perf_evlist__new();
+	temp_evlist = evlist__new();
 	if (!temp_evlist)
 		return false;
 
author reviewer
#17 lore raw

PATCH 9/79 perf tools: Rename perf_evlist__delete to evlist__delete

In reply to Jiri Olsa

Renaming perf_evlist__delete to evlist__delete, so we don't have a name clash when we add perf_evlist__delete in libperf.

---
 tools/perf/arch/x86/tests/intel-cqm.c        |  2 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c |  2 +-
 tools/perf/builtin-ftrace.c                  |  2 +-
 tools/perf/builtin-kvm.c                     |  4 ++--
 tools/perf/builtin-record.c                  |  2 +-
 tools/perf/builtin-stat.c                    |  2 +-
 tools/perf/builtin-top.c                     |  2 +-
 tools/perf/builtin-trace.c                   |  2 +-
 tools/perf/tests/backward-ring-buffer.c      |  2 +-
 tools/perf/tests/bpf.c                       |  2 +-
 tools/perf/tests/code-reading.c              |  4 ++--
 tools/perf/tests/event-times.c               |  2 +-
 tools/perf/tests/evsel-roundtrip-name.c      |  4 ++--
 tools/perf/tests/hists_cumulate.c            |  2 +-
 tools/perf/tests/hists_filter.c              |  2 +-
 tools/perf/tests/hists_link.c                |  2 +-
 tools/perf/tests/hists_output.c              |  2 +-
 tools/perf/tests/keep-tracking.c             |  2 +-
 tools/perf/tests/mmap-basic.c                |  2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  |  2 +-
 tools/perf/tests/parse-events.c              |  2 +-
 tools/perf/tests/parse-no-sample-id-all.c    |  2 +-
 tools/perf/tests/perf-record.c               |  2 +-
 tools/perf/tests/sw-clock.c                  |  2 +-
 tools/perf/tests/switch-tracking.c           |  2 +-
 tools/perf/tests/task-exit.c                 |  2 +-
 tools/perf/util/data-convert-bt.c            |  2 +-
 tools/perf/util/evlist.c                     | 12 ++++++------
 tools/perf/util/evlist.h                     |  2 +-
 tools/perf/util/header.c                     |  4 ++--
 tools/perf/util/parse-events.c               |  2 +-
 tools/perf/util/record.c                     |  4 ++--
 32 files changed, 42 insertions(+), 42 deletions(-)
tools/perf/arch/x86/tests/intel-cqm.c +1 -1
index 8089a33c6c16..2a105e3b2ad1 100644
@@ -124,6 +124,6 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
 	kill(pid, SIGKILL);
 	wait(NULL);
 out:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index da9a3302d8e6..09b6cef76f5b 100644
@@ -163,6 +163,6 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	err = 0;
 
 out_err:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/builtin-ftrace.c +1 -1
index b8bdc593e5b8..105ef2a17a9c 100644
@@ -508,7 +508,7 @@ int cmd_ftrace(int argc, const char **argv)
 	ret = __cmd_ftrace(&ftrace, argc, argv);
 
 out_delete_evlist:
-	perf_evlist__delete(ftrace.evlist);
+	evlist__delete(ftrace.evlist);
 
 out_delete_filters:
 	delete_filter_func(&ftrace.filters);
tools/perf/builtin-kvm.c +2 -2
index ee896b8a9fe8..8f54bdfb5743 100644
@@ -1325,7 +1325,7 @@ static struct evlist *kvm_live_event_list(void)
 
 out:
 	if (err) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -1460,7 +1460,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
 out:
 	perf_session__delete(kvm->session);
 	kvm->session = NULL;
-	perf_evlist__delete(kvm->evlist);
+	evlist__delete(kvm->evlist);
 
 	return err;
 }
tools/perf/builtin-record.c +1 -1
index e8aa8a078dff..06966a2c2cdd 100644
@@ -2449,7 +2449,7 @@ int cmd_record(int argc, const char **argv)
 
 	err = __cmd_record(&record, argc, argv);
 out:
-	perf_evlist__delete(rec->evlist);
+	evlist__delete(rec->evlist);
 	symbol__exit();
 	auxtrace_record__free(rec->itr);
 	return err;
tools/perf/builtin-stat.c +1 -1
index ee0dc8088ac0..d28d4d71d9b7 100644
@@ -2015,7 +2015,7 @@ int cmd_stat(int argc, const char **argv)
 	if (smi_cost && smi_reset)
 		sysfs__write_int(FREEZE_ON_SMI_PATH, 0);
 
-	perf_evlist__delete(evsel_list);
+	evlist__delete(evsel_list);
 
 	runtime_stat_delete(&stat_config);
 
tools/perf/builtin-top.c +1 -1
index e4b7146cd666..6c0c2b78093a 100644
@@ -1661,7 +1661,7 @@ int cmd_top(int argc, const char **argv)
 		perf_evlist__stop_sb_thread(sb_evlist);
 
 out_delete_evlist:
-	perf_evlist__delete(top.evlist);
+	evlist__delete(top.evlist);
 	perf_session__delete(top.session);
 
 	return status;
tools/perf/builtin-trace.c +1 -1
index f96d67ca3182..9d7c3e8e7d5c 100644
@@ -3497,7 +3497,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 out_delete_evlist:
 	trace__symbols__exit(trace);
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	cgroup__put(trace->cgroup);
 	trace->evlist = NULL;
 	trace->live = false;
tools/perf/tests/backward-ring-buffer.c +1 -1
index 3883b315b25b..ef3c6db2fae4 100644
@@ -150,6 +150,6 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 
 	ret = TEST_OK;
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
tools/perf/tests/bpf.c +1 -1
index d15f62dc4261..313ff1aadd9c 100644
@@ -200,7 +200,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	ret = TEST_OK;
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
 
tools/perf/tests/code-reading.c +2 -2
index dd0325eabc25..1c7f092a7388 100644
@@ -658,7 +658,7 @@ static int do_test_code_reading(bool try_kcore)
 				cpu_map__get(cpus);
 				thread_map__get(threads);
 				perf_evlist__set_maps(evlist, NULL, NULL);
-				perf_evlist__delete(evlist);
+				evlist__delete(evlist);
 				evlist = NULL;
 				continue;
 			}
@@ -703,7 +703,7 @@ static int do_test_code_reading(bool try_kcore)
 out_err:
 
 	if (evlist) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/event-times.c +1 -1
index 8d3cf9792d9e..0f74ca103c41 100644
@@ -204,7 +204,7 @@ static int test_times(int (attach)(struct evlist *),
 		 count.ena, count.run);
 
 out_err:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return !err ? TEST_OK : TEST_FAIL;
 }
 
tools/perf/tests/evsel-roundtrip-name.c +2 -2
index 74e79d6b7e96..5330f106a6ee 100644
@@ -60,7 +60,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
 		}
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
 
@@ -91,7 +91,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
 	}
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
tools/perf/tests/hists_cumulate.c +1 -1
index 897e74b5ed1f..1f3de85ae18b 100644
@@ -731,7 +731,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	machines__exit(&machines);
 
 	return err;
tools/perf/tests/hists_filter.c +1 -1
index b0468db74ca3..a274716fc438 100644
@@ -321,7 +321,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	reset_output_field();
 	machines__exit(&machines);
 
tools/perf/tests/hists_link.c +1 -1
index 878cb5bfbe78..b25383aa2e6e 100644
@@ -334,7 +334,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	reset_output_field();
 	machines__exit(&machines);
 
tools/perf/tests/hists_output.c +1 -1
index 87a05e7afb7e..009888adf4b3 100644
@@ -618,7 +618,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	machines__exit(&machines);
 
 	return err;
tools/perf/tests/keep-tracking.c +1 -1
index 4c73377bfccb..cdc19bcc7523 100644
@@ -147,7 +147,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 out_err:
 	if (evlist) {
 		perf_evlist__disable(evlist);
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/mmap-basic.c +1 -1
index 8d1be34fd951..7f96bb72f7e5 100644
@@ -151,7 +151,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 	}
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	cpus	= NULL;
 	threads = NULL;
 out_free_cpus:
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 141592437520..0263420f4495 100644
@@ -134,7 +134,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 out_ok:
 	err = 0;
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 out:
 	return err;
 }
tools/perf/tests/parse-events.c +1 -1
index 6e81a930b224..2365dd655c88 100644
@@ -1790,7 +1790,7 @@ static int test_event(struct evlist_test *e)
 		ret = e->check(evlist);
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 
 	return ret;
 }
tools/perf/tests/parse-no-sample-id-all.c +1 -1
index fc0213246aaf..396e40d68922 100644
@@ -46,7 +46,7 @@ static int process_events(union perf_event **events, size_t count)
 	for (i = 0; i < count && !err; i++)
 		err = process_event(&evlist, events[i]);
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 
 	return err;
 }
tools/perf/tests/perf-record.c +1 -1
index 99b2d26881f9..779d5996428b 100644
@@ -325,7 +325,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 		++errs;
 	}
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 out:
 	return (err < 0 || errs > 0) ? -1 : 0;
 }
tools/perf/tests/sw-clock.c +1 -1
index 88a75cbae230..1c7d8adb43d0 100644
@@ -128,7 +128,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
tools/perf/tests/switch-tracking.c +1 -1
index 89bc20b2178a..ac5da4fd222f 100644
@@ -567,7 +567,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 out:
 	if (evlist) {
 		perf_evlist__disable(evlist);
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/task-exit.c +1 -1
index 5c2cdb0ccb96..698ee5369c02 100644
@@ -138,6 +138,6 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/util/data-convert-bt.c +1 -1
index 083101ae7b77..ca30bb25b3c5 100644
@@ -1319,7 +1319,7 @@ static void cleanup_events(struct perf_session *session)
 		zfree(&evsel->priv);
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	session->evlist = NULL;
 }
 
tools/perf/util/evlist.c +6 -6
index 317b2d64ba6d..9fa3663068b4 100644
@@ -70,7 +70,7 @@ struct evlist *perf_evlist__new_default(void)
 	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_default(evlist)) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -82,7 +82,7 @@ struct evlist *perf_evlist__new_dummy(void)
 	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_dummy(evlist)) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -134,7 +134,7 @@ void perf_evlist__exit(struct evlist *evlist)
 	fdarray__exit(&evlist->pollfd);
 }
 
-void perf_evlist__delete(struct evlist *evlist)
+void evlist__delete(struct evlist *evlist)
 {
 	if (evlist == NULL)
 		return;
@@ -1859,7 +1859,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 
 out_err:
 	if (new_evlist) {
-		perf_evlist__delete(*evlist);
+		evlist__delete(*evlist);
 		*evlist = NULL;
 	}
 	return -1;
@@ -1938,7 +1938,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 	return 0;
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	evlist = NULL;
 	return -1;
 }
@@ -1949,5 +1949,5 @@ void perf_evlist__stop_sb_thread(struct evlist *evlist)
 		return;
 	evlist->thread.done = 1;
 	pthread_join(evlist->thread.th, NULL);
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 }
tools/perf/util/evlist.h +1 -1
index 60e1c9268e9e..12a5fd6972df 100644
@@ -71,7 +71,7 @@ struct evlist *perf_evlist__new_dummy(void);
 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 		  struct perf_thread_map *threads);
 void perf_evlist__exit(struct evlist *evlist);
-void perf_evlist__delete(struct evlist *evlist);
+void evlist__delete(struct evlist *evlist);
 
 void perf_evlist__add(struct evlist *evlist, struct evsel *entry);
 void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
tools/perf/util/header.c +2 -2
index 5234e7186456..c91bb1fa0aa6 100644
@@ -3584,7 +3584,7 @@ int perf_session__read_header(struct perf_session *session)
 		evsel->needs_swap = header->needs_swap;
 		/*
 		 * Do it before so that if perf_evsel__alloc_id fails, this
-		 * entry gets purged too at perf_evlist__delete().
+		 * entry gets purged too at evlist__delete().
 		 */
 		perf_evlist__add(session->evlist, evsel);
 
@@ -3621,7 +3621,7 @@ int perf_session__read_header(struct perf_session *session)
 	return -errno;
 
 out_delete_evlist:
-	perf_evlist__delete(session->evlist);
+	evlist__delete(session->evlist);
 	session->evlist = NULL;
 	return -ENOMEM;
 }
tools/perf/util/parse-events.c +1 -1
index d341b11fb141..6a4bfc7ab0c1 100644
@@ -1935,7 +1935,7 @@ int parse_events(struct evlist *evlist, const char *str,
 
 	/*
 	 * There are 2 users - builtin-record and builtin-test objects.
-	 * Both call perf_evlist__delete in case of error, so we dont
+	 * Both call evlist__delete in case of error, so we dont
 	 * need to bother.
 	 */
 	return ret;
tools/perf/util/record.c +2 -2
index a23c69137dfc..9f8841548539 100644
@@ -53,7 +53,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
 	err = 0;
 
 out_delete:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
@@ -299,7 +299,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 	ret = true;
 
 out_delete:
-	perf_evlist__delete(temp_evlist);
+	evlist__delete(temp_evlist);
 	return ret;
 }
 
Signature · 1 line
2.21.0
#18 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__delete() to evlist__delete()

perf evlist: Rename perf_evlist__delete() to evlist__delete()
Commit-ID:  c12995a55474e1cefac52da38c7fc47c024de067
Gitweb:     https://git.kernel.org/tip/c12995a55474e1cefac52da38c7fc47c024de067
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:23:56 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__delete() to evlist__delete()

Rename perf_evlist__delete() to evlist__delete(), so we don't have a name clash when we add perf_evlist__delete() in libperf.

---
 tools/perf/arch/x86/tests/intel-cqm.c        |  2 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c |  2 +-
 tools/perf/builtin-ftrace.c                  |  2 +-
 tools/perf/builtin-kvm.c                     |  4 ++--
 tools/perf/builtin-record.c                  |  2 +-
 tools/perf/builtin-stat.c                    |  2 +-
 tools/perf/builtin-top.c                     |  2 +-
 tools/perf/builtin-trace.c                   |  2 +-
 tools/perf/tests/backward-ring-buffer.c      |  2 +-
 tools/perf/tests/bpf.c                       |  2 +-
 tools/perf/tests/code-reading.c              |  4 ++--
 tools/perf/tests/event-times.c               |  2 +-
 tools/perf/tests/evsel-roundtrip-name.c      |  4 ++--
 tools/perf/tests/hists_cumulate.c            |  2 +-
 tools/perf/tests/hists_filter.c              |  2 +-
 tools/perf/tests/hists_link.c                |  2 +-
 tools/perf/tests/hists_output.c              |  2 +-
 tools/perf/tests/keep-tracking.c             |  2 +-
 tools/perf/tests/mmap-basic.c                |  2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  |  2 +-
 tools/perf/tests/parse-events.c              |  2 +-
 tools/perf/tests/parse-no-sample-id-all.c    |  2 +-
 tools/perf/tests/perf-record.c               |  2 +-
 tools/perf/tests/sw-clock.c                  |  2 +-
 tools/perf/tests/switch-tracking.c           |  2 +-
 tools/perf/tests/task-exit.c                 |  2 +-
 tools/perf/util/data-convert-bt.c            |  2 +-
 tools/perf/util/evlist.c                     | 12 ++++++------
 tools/perf/util/evlist.h                     |  2 +-
 tools/perf/util/header.c                     |  4 ++--
 tools/perf/util/parse-events.c               |  2 +-
 tools/perf/util/record.c                     |  4 ++--
 32 files changed, 42 insertions(+), 42 deletions(-)
tools/perf/arch/x86/tests/intel-cqm.c +1 -1
index 8089a33c6c16..2a105e3b2ad1 100644
@@ -124,6 +124,6 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
 	kill(pid, SIGKILL);
 	wait(NULL);
 out:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index da9a3302d8e6..09b6cef76f5b 100644
@@ -163,6 +163,6 @@ next_event:
 	err = 0;
 
 out_err:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/builtin-ftrace.c +1 -1
index b8bdc593e5b8..105ef2a17a9c 100644
@@ -508,7 +508,7 @@ int cmd_ftrace(int argc, const char **argv)
 	ret = __cmd_ftrace(&ftrace, argc, argv);
 
 out_delete_evlist:
-	perf_evlist__delete(ftrace.evlist);
+	evlist__delete(ftrace.evlist);
 
 out_delete_filters:
 	delete_filter_func(&ftrace.filters);
tools/perf/builtin-kvm.c +2 -2
index ee896b8a9fe8..8f54bdfb5743 100644
@@ -1325,7 +1325,7 @@ static struct evlist *kvm_live_event_list(void)
 
 out:
 	if (err) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -1460,7 +1460,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
 out:
 	perf_session__delete(kvm->session);
 	kvm->session = NULL;
-	perf_evlist__delete(kvm->evlist);
+	evlist__delete(kvm->evlist);
 
 	return err;
 }
tools/perf/builtin-record.c +1 -1
index e8aa8a078dff..06966a2c2cdd 100644
@@ -2449,7 +2449,7 @@ int cmd_record(int argc, const char **argv)
 
 	err = __cmd_record(&record, argc, argv);
 out:
-	perf_evlist__delete(rec->evlist);
+	evlist__delete(rec->evlist);
 	symbol__exit();
 	auxtrace_record__free(rec->itr);
 	return err;
tools/perf/builtin-stat.c +1 -1
index ee0dc8088ac0..d28d4d71d9b7 100644
@@ -2015,7 +2015,7 @@ out:
 	if (smi_cost && smi_reset)
 		sysfs__write_int(FREEZE_ON_SMI_PATH, 0);
 
-	perf_evlist__delete(evsel_list);
+	evlist__delete(evsel_list);
 
 	runtime_stat_delete(&stat_config);
 
tools/perf/builtin-top.c +1 -1
index e4b7146cd666..6c0c2b78093a 100644
@@ -1661,7 +1661,7 @@ int cmd_top(int argc, const char **argv)
 		perf_evlist__stop_sb_thread(sb_evlist);
 
 out_delete_evlist:
-	perf_evlist__delete(top.evlist);
+	evlist__delete(top.evlist);
 	perf_session__delete(top.session);
 
 	return status;
tools/perf/builtin-trace.c +1 -1
index 767b04eaaf45..e133204b3bb9 100644
@@ -3498,7 +3498,7 @@ out_disable:
 out_delete_evlist:
 	trace__symbols__exit(trace);
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	cgroup__put(trace->cgroup);
 	trace->evlist = NULL;
 	trace->live = false;
tools/perf/tests/backward-ring-buffer.c +1 -1
index 3883b315b25b..ef3c6db2fae4 100644
@@ -150,6 +150,6 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 
 	ret = TEST_OK;
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
tools/perf/tests/bpf.c +1 -1
index d15f62dc4261..313ff1aadd9c 100644
@@ -200,7 +200,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 	ret = TEST_OK;
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
 
tools/perf/tests/code-reading.c +2 -2
index dd0325eabc25..1c7f092a7388 100644
@@ -658,7 +658,7 @@ static int do_test_code_reading(bool try_kcore)
 				cpu_map__get(cpus);
 				thread_map__get(threads);
 				perf_evlist__set_maps(evlist, NULL, NULL);
-				perf_evlist__delete(evlist);
+				evlist__delete(evlist);
 				evlist = NULL;
 				continue;
 			}
@@ -703,7 +703,7 @@ out_put:
 out_err:
 
 	if (evlist) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/event-times.c +1 -1
index 8d3cf9792d9e..0f74ca103c41 100644
@@ -204,7 +204,7 @@ static int test_times(int (attach)(struct evlist *),
 		 count.ena, count.run);
 
 out_err:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return !err ? TEST_OK : TEST_FAIL;
 }
 
tools/perf/tests/evsel-roundtrip-name.c +2 -2
index 74e79d6b7e96..5330f106a6ee 100644
@@ -60,7 +60,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
 		}
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return ret;
 }
 
@@ -91,7 +91,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
 	}
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
tools/perf/tests/hists_cumulate.c +1 -1
index 897e74b5ed1f..1f3de85ae18b 100644
@@ -731,7 +731,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	machines__exit(&machines);
 
 	return err;
tools/perf/tests/hists_filter.c +1 -1
index b0468db74ca3..a274716fc438 100644
@@ -321,7 +321,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	reset_output_field();
 	machines__exit(&machines);
 
tools/perf/tests/hists_link.c +1 -1
index 878cb5bfbe78..b25383aa2e6e 100644
@@ -334,7 +334,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	reset_output_field();
 	machines__exit(&machines);
 
tools/perf/tests/hists_output.c +1 -1
index 87a05e7afb7e..009888adf4b3 100644
@@ -618,7 +618,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
 
 out:
 	/* tear down everything */
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	machines__exit(&machines);
 
 	return err;
tools/perf/tests/keep-tracking.c +1 -1
index 4c73377bfccb..cdc19bcc7523 100644
@@ -147,7 +147,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 out_err:
 	if (evlist) {
 		perf_evlist__disable(evlist);
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/mmap-basic.c +1 -1
index 8d1be34fd951..7f96bb72f7e5 100644
@@ -151,7 +151,7 @@ out_init:
 	}
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	cpus	= NULL;
 	threads = NULL;
 out_free_cpus:
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 141592437520..0263420f4495 100644
@@ -134,7 +134,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 out_ok:
 	err = 0;
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 out:
 	return err;
 }
tools/perf/tests/parse-events.c +1 -1
index 6e81a930b224..2365dd655c88 100644
@@ -1790,7 +1790,7 @@ static int test_event(struct evlist_test *e)
 		ret = e->check(evlist);
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 
 	return ret;
 }
tools/perf/tests/parse-no-sample-id-all.c +1 -1
index fc0213246aaf..396e40d68922 100644
@@ -46,7 +46,7 @@ static int process_events(union perf_event **events, size_t count)
 	for (i = 0; i < count && !err; i++)
 		err = process_event(&evlist, events[i]);
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 
 	return err;
 }
tools/perf/tests/perf-record.c +1 -1
index 99b2d26881f9..779d5996428b 100644
@@ -325,7 +325,7 @@ found_exit:
 		++errs;
 	}
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 out:
 	return (err < 0 || errs > 0) ? -1 : 0;
 }
tools/perf/tests/sw-clock.c +1 -1
index 88a75cbae230..1c7d8adb43d0 100644
@@ -128,7 +128,7 @@ out_free_maps:
 	cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
tools/perf/tests/switch-tracking.c +1 -1
index 89bc20b2178a..ac5da4fd222f 100644
@@ -567,7 +567,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 out:
 	if (evlist) {
 		perf_evlist__disable(evlist);
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
 		thread_map__put(threads);
tools/perf/tests/task-exit.c +1 -1
index 5c2cdb0ccb96..698ee5369c02 100644
@@ -138,6 +138,6 @@ out_free_maps:
 	cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
tools/perf/util/data-convert-bt.c +1 -1
index 083101ae7b77..ca30bb25b3c5 100644
@@ -1319,7 +1319,7 @@ static void cleanup_events(struct perf_session *session)
 		zfree(&evsel->priv);
 	}
 
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	session->evlist = NULL;
 }
 
tools/perf/util/evlist.c +6 -6
index 317b2d64ba6d..9fa3663068b4 100644
@@ -70,7 +70,7 @@ struct evlist *perf_evlist__new_default(void)
 	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_default(evlist)) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -82,7 +82,7 @@ struct evlist *perf_evlist__new_dummy(void)
 	struct evlist *evlist = evlist__new();
 
 	if (evlist && perf_evlist__add_dummy(evlist)) {
-		perf_evlist__delete(evlist);
+		evlist__delete(evlist);
 		evlist = NULL;
 	}
 
@@ -134,7 +134,7 @@ void perf_evlist__exit(struct evlist *evlist)
 	fdarray__exit(&evlist->pollfd);
 }
 
-void perf_evlist__delete(struct evlist *evlist)
+void evlist__delete(struct evlist *evlist)
 {
 	if (evlist == NULL)
 		return;
@@ -1859,7 +1859,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 
 out_err:
 	if (new_evlist) {
-		perf_evlist__delete(*evlist);
+		evlist__delete(*evlist);
 		*evlist = NULL;
 	}
 	return -1;
@@ -1938,7 +1938,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 	return 0;
 
 out_delete_evlist:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	evlist = NULL;
 	return -1;
 }
@@ -1949,5 +1949,5 @@ void perf_evlist__stop_sb_thread(struct evlist *evlist)
 		return;
 	evlist->thread.done = 1;
 	pthread_join(evlist->thread.th, NULL);
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 }
tools/perf/util/evlist.h +1 -1
index 60e1c9268e9e..12a5fd6972df 100644
@@ -71,7 +71,7 @@ struct evlist *perf_evlist__new_dummy(void);
 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 		  struct perf_thread_map *threads);
 void perf_evlist__exit(struct evlist *evlist);
-void perf_evlist__delete(struct evlist *evlist);
+void evlist__delete(struct evlist *evlist);
 
 void perf_evlist__add(struct evlist *evlist, struct evsel *entry);
 void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
tools/perf/util/header.c +2 -2
index 5b90786a8436..29bbfd699226 100644
@@ -3591,7 +3591,7 @@ int perf_session__read_header(struct perf_session *session)
 		evsel->needs_swap = header->needs_swap;
 		/*
 		 * Do it before so that if perf_evsel__alloc_id fails, this
-		 * entry gets purged too at perf_evlist__delete().
+		 * entry gets purged too at evlist__delete().
 		 */
 		perf_evlist__add(session->evlist, evsel);
 
@@ -3628,7 +3628,7 @@ out_errno:
 	return -errno;
 
 out_delete_evlist:
-	perf_evlist__delete(session->evlist);
+	evlist__delete(session->evlist);
 	session->evlist = NULL;
 	return -ENOMEM;
 }
tools/perf/util/parse-events.c +1 -1
index d341b11fb141..6a4bfc7ab0c1 100644
@@ -1935,7 +1935,7 @@ int parse_events(struct evlist *evlist, const char *str,
 
 	/*
 	 * There are 2 users - builtin-record and builtin-test objects.
-	 * Both call perf_evlist__delete in case of error, so we dont
+	 * Both call evlist__delete in case of error, so we dont
 	 * need to bother.
 	 */
 	return ret;
tools/perf/util/record.c +2 -2
index a23c69137dfc..9f8841548539 100644
@@ -53,7 +53,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
 	err = 0;
 
 out_delete:
-	perf_evlist__delete(evlist);
+	evlist__delete(evlist);
 	return err;
 }
 
@@ -299,7 +299,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 	ret = true;
 
 out_delete:
-	perf_evlist__delete(temp_evlist);
+	evlist__delete(temp_evlist);
 	return ret;
 }
 
author reviewer
#19 lore raw

PATCH 10/79 perf tools: Rename perf_evsel__delete to evsel__delete

In reply to Jiri Olsa

Renaming perf_evsel__delete to evsel__delete, so we don't have a name clash when we add perf_evsel__delete in libperf.

Also renaming perf_evsel__delete_priv to evsel__delete_priv.

---
 tools/perf/builtin-inject.c                |  4 ++--
 tools/perf/builtin-trace.c                 | 12 ++++++------
 tools/perf/tests/evsel-tp-sched.c          |  4 ++--
 tools/perf/tests/openat-syscall-all-cpus.c |  2 +-
 tools/perf/tests/openat-syscall.c          |  2 +-
 tools/perf/util/evlist.c                   |  4 ++--
 tools/perf/util/evsel.c                    |  4 ++--
 tools/perf/util/evsel.h                    |  2 +-
 tools/perf/util/parse-events.c             |  4 ++--
 9 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/builtin-inject.c +2 -2
index d2131fc863be..917c8fb4baa5 100644
@@ -623,7 +623,7 @@ static void strip_fini(struct perf_inject *inject)
 		    ok_to_remove(evlist, evsel)) {
 			pr_debug("Deleting %s\n", perf_evsel__name(evsel));
 			perf_evlist__remove(evlist, evsel);
-			perf_evsel__delete(evsel);
+			evsel__delete(evsel);
 		}
 	}
 }
@@ -725,7 +725,7 @@ static int __cmd_inject(struct perf_inject *inject)
 				pr_debug("Deleting %s\n",
 					 perf_evsel__name(evsel));
 				perf_evlist__remove(session->evlist, evsel);
-				perf_evsel__delete(evsel);
+				evsel__delete(evsel);
 			}
 			if (inject->strip)
 				strip_fini(inject);
tools/perf/builtin-trace.c +6 -6
index 9d7c3e8e7d5c..465a61e09b3a 100644
@@ -275,10 +275,10 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel,
 	({ struct syscall_tp *sc = evsel->priv;\
 	   perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); })
 
-static void perf_evsel__delete_priv(struct evsel *evsel)
+static void evsel__delete_priv(struct evsel *evsel)
 {
 	zfree(&evsel->priv);
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 }
 
 static int perf_evsel__init_syscall_tp(struct evsel *evsel)
@@ -369,7 +369,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void *
 	return evsel;
 
 out_delete:
-	perf_evsel__delete_priv(evsel);
+	evsel__delete_priv(evsel);
 	return NULL;
 }
 
@@ -2650,7 +2650,7 @@ static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
 
 		list_del_init(&evsel->node);
 		evsel->evlist = NULL;
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	}
 
 	return found;
@@ -2751,9 +2751,9 @@ static int trace__add_syscall_newtp(struct trace *trace)
 	return ret;
 
 out_delete_sys_exit:
-	perf_evsel__delete_priv(sys_exit);
+	evsel__delete_priv(sys_exit);
 out_delete_sys_enter:
-	perf_evsel__delete_priv(sys_enter);
+	evsel__delete_priv(sys_enter);
 	goto out;
 }
 
tools/perf/tests/evsel-tp-sched.c +2 -2
index 0170e9d2e329..261e6eaaee99 100644
@@ -64,7 +64,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
 	if (perf_evsel__test_field(evsel, "next_prio", 4, true))
 		ret = -1;
 
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 
 	evsel = perf_evsel__newtp("sched", "sched_wakeup");
 
@@ -85,6 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
 	if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
 		ret = -1;
 
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 	return ret;
 }
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index 4bf73896695a..001a0e8e6998 100644
@@ -118,7 +118,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
 out_close_fd:
 	perf_evsel__close_fd(evsel);
 out_evsel_delete:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 out_cpu_map_delete:
 	cpu_map__put(cpus);
 out_thread_map_delete:
tools/perf/tests/openat-syscall.c +1 -1
index f3efadd05863..20e353fbfdd0 100644
@@ -59,7 +59,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m
 out_close_fd:
 	perf_evsel__close_fd(evsel);
 out_evsel_delete:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 out_thread_map_delete:
 	thread_map__put(threads);
 	return err;
tools/perf/util/evlist.c +2 -2
index 9fa3663068b4..986d20c15778 100644
@@ -121,7 +121,7 @@ static void perf_evlist__purge(struct evlist *evlist)
 	evlist__for_each_entry_safe(evlist, n, pos) {
 		list_del_init(&pos->node);
 		pos->evlist = NULL;
-		perf_evsel__delete(pos);
+		evsel__delete(pos);
 	}
 
 	evlist->nr_entries = 0;
@@ -277,7 +277,7 @@ static int perf_evlist__add_attrs(struct evlist *evlist,
 
 out_delete_partial_list:
 	__evlist__for_each_entry_safe(&head, n, evsel)
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	return -1;
 }
 
tools/perf/util/evsel.c +2 -2
index 97bee83f0f98..de379b63f1ce 100644
@@ -316,7 +316,7 @@ struct evsel *perf_evsel__new_cycles(bool precise)
 out:
 	return evsel;
 error_free:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 	evsel = NULL;
 	goto out;
 }
@@ -1333,7 +1333,7 @@ void perf_evsel__exit(struct evsel *evsel)
 	perf_evsel__object.fini(evsel);
 }
 
-void perf_evsel__delete(struct evsel *evsel)
+void evsel__delete(struct evsel *evsel)
 {
 	perf_evsel__exit(evsel);
 	free(evsel);
tools/perf/util/evsel.h +1 -1
index af230d92fbef..20b4e31b63a9 100644
@@ -240,7 +240,7 @@ struct tep_event *event_format__new(const char *sys, const char *name);
 
 void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx);
 void perf_evsel__exit(struct evsel *evsel);
-void perf_evsel__delete(struct evsel *evsel);
+void evsel__delete(struct evsel *evsel);
 
 struct callchain_param;
 
tools/perf/util/parse-events.c +2 -2
index 6a4bfc7ab0c1..cc63367f6e45 100644
@@ -662,7 +662,7 @@ static int add_bpf_event(const char *group, const char *event, int fd, struct bp
 			 group, event);
 		list_for_each_entry_safe(evsel, tmp, &new_evsels, node) {
 			list_del_init(&evsel->node);
-			perf_evsel__delete(evsel);
+			evsel__delete(evsel);
 		}
 		return err;
 	}
@@ -2334,7 +2334,7 @@ static bool is_event_supported(u8 type, unsigned config)
 			evsel->attr.exclude_kernel = 1;
 			ret = perf_evsel__open(evsel, NULL, tmap) >= 0;
 		}
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	}
 
 	thread_map__put(tmap);
Signature · 1 line
2.21.0
#20 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__delete() to evsel__delete()

perf evsel: Rename perf_evsel__delete() to evsel__delete()
Commit-ID:  5eb2dd2ade8354dcbe4cef54cd1719622af8f2dc
Gitweb:     https://git.kernel.org/tip/5eb2dd2ade8354dcbe4cef54cd1719622af8f2dc
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:23:57 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__delete() to evsel__delete()

Remame perf_evsel__delete() to evsel__delete(), so we don't have a name clash when we add perf_evsel__delete() in libperf.

Also renaming perf_evsel__delete_priv() to evsel__delete_priv().

---
 tools/perf/builtin-inject.c                |  4 ++--
 tools/perf/builtin-trace.c                 | 12 ++++++------
 tools/perf/tests/evsel-tp-sched.c          |  4 ++--
 tools/perf/tests/openat-syscall-all-cpus.c |  2 +-
 tools/perf/tests/openat-syscall.c          |  2 +-
 tools/perf/util/evlist.c                   |  4 ++--
 tools/perf/util/evsel.c                    |  4 ++--
 tools/perf/util/evsel.h                    |  2 +-
 tools/perf/util/parse-events.c             |  4 ++--
 9 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/builtin-inject.c +2 -2
index d2131fc863be..917c8fb4baa5 100644
@@ -623,7 +623,7 @@ static void strip_fini(struct perf_inject *inject)
 		    ok_to_remove(evlist, evsel)) {
 			pr_debug("Deleting %s\n", perf_evsel__name(evsel));
 			perf_evlist__remove(evlist, evsel);
-			perf_evsel__delete(evsel);
+			evsel__delete(evsel);
 		}
 	}
 }
@@ -725,7 +725,7 @@ static int __cmd_inject(struct perf_inject *inject)
 				pr_debug("Deleting %s\n",
 					 perf_evsel__name(evsel));
 				perf_evlist__remove(session->evlist, evsel);
-				perf_evsel__delete(evsel);
+				evsel__delete(evsel);
 			}
 			if (inject->strip)
 				strip_fini(inject);
tools/perf/builtin-trace.c +6 -6
index e133204b3bb9..0f7d1859a2d1 100644
@@ -274,10 +274,10 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel,
 	({ struct syscall_tp *sc = evsel->priv;\
 	   perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); })
 
-static void perf_evsel__delete_priv(struct evsel *evsel)
+static void evsel__delete_priv(struct evsel *evsel)
 {
 	zfree(&evsel->priv);
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 }
 
 static int perf_evsel__init_syscall_tp(struct evsel *evsel)
@@ -368,7 +368,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void *
 	return evsel;
 
 out_delete:
-	perf_evsel__delete_priv(evsel);
+	evsel__delete_priv(evsel);
 	return NULL;
 }
 
@@ -2638,7 +2638,7 @@ static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
 
 		list_del_init(&evsel->node);
 		evsel->evlist = NULL;
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	}
 
 	return found;
@@ -2739,9 +2739,9 @@ out:
 	return ret;
 
 out_delete_sys_exit:
-	perf_evsel__delete_priv(sys_exit);
+	evsel__delete_priv(sys_exit);
 out_delete_sys_enter:
-	perf_evsel__delete_priv(sys_enter);
+	evsel__delete_priv(sys_enter);
 	goto out;
 }
 
tools/perf/tests/evsel-tp-sched.c +2 -2
index 0170e9d2e329..261e6eaaee99 100644
@@ -64,7 +64,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
 	if (perf_evsel__test_field(evsel, "next_prio", 4, true))
 		ret = -1;
 
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 
 	evsel = perf_evsel__newtp("sched", "sched_wakeup");
 
@@ -85,6 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
 	if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
 		ret = -1;
 
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 	return ret;
 }
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index 4bf73896695a..001a0e8e6998 100644
@@ -118,7 +118,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
 out_close_fd:
 	perf_evsel__close_fd(evsel);
 out_evsel_delete:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 out_cpu_map_delete:
 	cpu_map__put(cpus);
 out_thread_map_delete:
tools/perf/tests/openat-syscall.c +1 -1
index f3efadd05863..20e353fbfdd0 100644
@@ -59,7 +59,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m
 out_close_fd:
 	perf_evsel__close_fd(evsel);
 out_evsel_delete:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 out_thread_map_delete:
 	thread_map__put(threads);
 	return err;
tools/perf/util/evlist.c +2 -2
index 9fa3663068b4..986d20c15778 100644
@@ -121,7 +121,7 @@ static void perf_evlist__purge(struct evlist *evlist)
 	evlist__for_each_entry_safe(evlist, n, pos) {
 		list_del_init(&pos->node);
 		pos->evlist = NULL;
-		perf_evsel__delete(pos);
+		evsel__delete(pos);
 	}
 
 	evlist->nr_entries = 0;
@@ -277,7 +277,7 @@ static int perf_evlist__add_attrs(struct evlist *evlist,
 
 out_delete_partial_list:
 	__evlist__for_each_entry_safe(&head, n, evsel)
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	return -1;
 }
 
tools/perf/util/evsel.c +2 -2
index 97bee83f0f98..de379b63f1ce 100644
@@ -316,7 +316,7 @@ new_event:
 out:
 	return evsel;
 error_free:
-	perf_evsel__delete(evsel);
+	evsel__delete(evsel);
 	evsel = NULL;
 	goto out;
 }
@@ -1333,7 +1333,7 @@ void perf_evsel__exit(struct evsel *evsel)
 	perf_evsel__object.fini(evsel);
 }
 
-void perf_evsel__delete(struct evsel *evsel)
+void evsel__delete(struct evsel *evsel)
 {
 	perf_evsel__exit(evsel);
 	free(evsel);
tools/perf/util/evsel.h +1 -1
index af230d92fbef..20b4e31b63a9 100644
@@ -240,7 +240,7 @@ struct tep_event *event_format__new(const char *sys, const char *name);
 
 void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx);
 void perf_evsel__exit(struct evsel *evsel);
-void perf_evsel__delete(struct evsel *evsel);
+void evsel__delete(struct evsel *evsel);
 
 struct callchain_param;
 
tools/perf/util/parse-events.c +2 -2
index 6a4bfc7ab0c1..cc63367f6e45 100644
@@ -662,7 +662,7 @@ static int add_bpf_event(const char *group, const char *event, int fd, struct bp
 			 group, event);
 		list_for_each_entry_safe(evsel, tmp, &new_evsels, node) {
 			list_del_init(&evsel->node);
-			perf_evsel__delete(evsel);
+			evsel__delete(evsel);
 		}
 		return err;
 	}
@@ -2334,7 +2334,7 @@ static bool is_event_supported(u8 type, unsigned config)
 			evsel->attr.exclude_kernel = 1;
 			ret = perf_evsel__open(evsel, NULL, tmap) >= 0;
 		}
-		perf_evsel__delete(evsel);
+		evsel__delete(evsel);
 	}
 
 	thread_map__put(tmap);
author reviewer
#21 lore raw

PATCH 11/79 perf tools: Rename perf_evsel__new to evsel__new

In reply to Jiri Olsa

Renaming perf_evsel__new to evsel__new, so we don't have a name clash when we add perf_evsel__new in libperf.

---
 tools/perf/builtin-trace.c     | 2 +-
 tools/perf/tests/sw-clock.c    | 2 +-
 tools/perf/util/evsel.c        | 2 +-
 tools/perf/util/evsel.h        | 2 +-
 tools/perf/util/header.c       | 4 ++--
 tools/perf/util/parse-events.c | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-trace.c +1 -1
index 465a61e09b3a..9d27307069a1 100644
@@ -2669,7 +2669,7 @@ static struct evsel *perf_evsel__new_pgfault(u64 config)
 
 	event_attr_init(&attr);
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel)
 		evsel->handler = trace__pgfault;
 
tools/perf/tests/sw-clock.c +1 -1
index 1c7d8adb43d0..247d3734686e 100644
@@ -49,7 +49,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		return -1;
 	}
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel == NULL) {
 		pr_debug("perf_evsel__new\n");
 		goto out_delete_evlist;
tools/perf/util/evsel.c +1 -1
index de379b63f1ce..c9723c2d57c9 100644
@@ -301,7 +301,7 @@ struct evsel *perf_evsel__new_cycles(bool precise)
 	 * to kick in when we return and before perf_evsel__open() is called.
 	 */
 new_event:
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel == NULL)
 		goto out;
 
tools/perf/util/evsel.h +1 -1
index 20b4e31b63a9..ecea51a918e0 100644
@@ -219,7 +219,7 @@ int perf_evsel__object_config(size_t object_size,
 
 struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx);
 
-static inline struct evsel *perf_evsel__new(struct perf_event_attr *attr)
+static inline struct evsel *evsel__new(struct perf_event_attr *attr)
 {
 	return perf_evsel__new_idx(attr, 0);
 }
tools/perf/util/header.c +2 -2
index c91bb1fa0aa6..f3d8fdca53ae 100644
@@ -3576,7 +3576,7 @@ int perf_session__read_header(struct perf_session *session)
 		}
 
 		tmp = lseek(fd, 0, SEEK_CUR);
-		evsel = perf_evsel__new(&f_attr.attr);
+		evsel = evsel__new(&f_attr.attr);
 
 		if (evsel == NULL)
 			goto out_delete_evlist;
@@ -4014,7 +4014,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 			return -ENOMEM;
 	}
 
-	evsel = perf_evsel__new(&event->attr.attr);
+	evsel = evsel__new(&event->attr.attr);
 	if (evsel == NULL)
 		return -ENOMEM;
 
tools/perf/util/parse-events.c +1 -1
index cc63367f6e45..40087cf74dd1 100644
@@ -2318,7 +2318,7 @@ static bool is_event_supported(u8 type, unsigned config)
 	if (tmap == NULL)
 		return false;
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel) {
 		open_return = perf_evsel__open(evsel, NULL, tmap);
 		ret = open_return >= 0;
Signature · 1 line
2.21.0
#22 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__new() to evsel__new()

perf evsel: Rename perf_evsel__new() to evsel__new()
Commit-ID:  365c3ae7452ca95e0a8f1e4716dd806550ade706
Gitweb:     https://git.kernel.org/tip/365c3ae7452ca95e0a8f1e4716dd806550ade706
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:23:58 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__new() to evsel__new()

Rename perf_evsel__new() to evsel__new(), so we don't have a name clash when we add perf_evsel__new() in libperf.

---
 tools/perf/builtin-trace.c     | 2 +-
 tools/perf/tests/sw-clock.c    | 2 +-
 tools/perf/util/evsel.c        | 2 +-
 tools/perf/util/evsel.h        | 2 +-
 tools/perf/util/header.c       | 4 ++--
 tools/perf/util/parse-events.c | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-trace.c +1 -1
index 0f7d1859a2d1..c5eb47f4e42e 100644
@@ -2657,7 +2657,7 @@ static struct evsel *perf_evsel__new_pgfault(u64 config)
 
 	event_attr_init(&attr);
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel)
 		evsel->handler = trace__pgfault;
 
tools/perf/tests/sw-clock.c +1 -1
index 1c7d8adb43d0..247d3734686e 100644
@@ -49,7 +49,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		return -1;
 	}
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel == NULL) {
 		pr_debug("perf_evsel__new\n");
 		goto out_delete_evlist;
tools/perf/util/evsel.c +1 -1
index de379b63f1ce..c9723c2d57c9 100644
@@ -301,7 +301,7 @@ struct evsel *perf_evsel__new_cycles(bool precise)
 	 * to kick in when we return and before perf_evsel__open() is called.
 	 */
 new_event:
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel == NULL)
 		goto out;
 
tools/perf/util/evsel.h +1 -1
index 20b4e31b63a9..ecea51a918e0 100644
@@ -219,7 +219,7 @@ int perf_evsel__object_config(size_t object_size,
 
 struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx);
 
-static inline struct evsel *perf_evsel__new(struct perf_event_attr *attr)
+static inline struct evsel *evsel__new(struct perf_event_attr *attr)
 {
 	return perf_evsel__new_idx(attr, 0);
 }
tools/perf/util/header.c +2 -2
index 29bbfd699226..7760ddc4bc18 100644
@@ -3583,7 +3583,7 @@ int perf_session__read_header(struct perf_session *session)
 		}
 
 		tmp = lseek(fd, 0, SEEK_CUR);
-		evsel = perf_evsel__new(&f_attr.attr);
+		evsel = evsel__new(&f_attr.attr);
 
 		if (evsel == NULL)
 			goto out_delete_evlist;
@@ -4021,7 +4021,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 			return -ENOMEM;
 	}
 
-	evsel = perf_evsel__new(&event->attr.attr);
+	evsel = evsel__new(&event->attr.attr);
 	if (evsel == NULL)
 		return -ENOMEM;
 
tools/perf/util/parse-events.c +1 -1
index cc63367f6e45..40087cf74dd1 100644
@@ -2318,7 +2318,7 @@ static bool is_event_supported(u8 type, unsigned config)
 	if (tmap == NULL)
 		return false;
 
-	evsel = perf_evsel__new(&attr);
+	evsel = evsel__new(&attr);
 	if (evsel) {
 		open_return = perf_evsel__open(evsel, NULL, tmap);
 		ret = open_return >= 0;
author reviewer
#23 lore raw

PATCH 12/79 perf tools: Rename perf_evlist__add to evlist__add

In reply to Jiri Olsa

Renaming perf_evlist__add to evlist__add, so we don't have a name clash when we add perf_evlist__add in libperf.

---
 tools/perf/builtin-trace.c                  | 12 ++++++------
 tools/perf/tests/mmap-basic.c               |  2 +-
 tools/perf/tests/openat-syscall-tp-fields.c |  2 +-
 tools/perf/tests/sw-clock.c                 |  2 +-
 tools/perf/util/evlist.c                    | 16 ++++++++--------
 tools/perf/util/evlist.h                    |  2 +-
 tools/perf/util/header.c                    |  4 ++--
 tools/perf/util/python.c                    |  2 +-
 8 files changed, 21 insertions(+), 21 deletions(-)
tools/perf/builtin-trace.c +6 -6
index 9d27307069a1..8e2a0c08e0a3 100644
@@ -2628,7 +2628,7 @@ static int trace__record(struct trace *trace, int argc, const char **argv)
 
 static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
 
-static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
+static bool evlist__add_vfs_getname(struct evlist *evlist)
 {
 	bool found = false;
 	struct evsel *evsel, *tmp;
@@ -2731,8 +2731,8 @@ static int trace__add_syscall_newtp(struct trace *trace)
 	perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param);
 	perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param);
 
-	perf_evlist__add(evlist, sys_enter);
-	perf_evlist__add(evlist, sys_exit);
+	evlist__add(evlist, sys_enter);
+	evlist__add(evlist, sys_exit);
 
 	if (callchain_param.enabled && !trace->kernel_syscallchains) {
 		/*
@@ -3263,7 +3263,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 			goto out_error_raw_syscalls;
 
 		if (trace->trace_syscalls)
-			trace->vfs_getname = perf_evlist__add_vfs_getname(evlist);
+			trace->vfs_getname = evlist__add_vfs_getname(evlist);
 	}
 
 	if ((trace->trace_pgfaults & TRACE_PFMAJ)) {
@@ -3271,7 +3271,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		if (pgfault_maj == NULL)
 			goto out_error_mem;
 		perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param);
-		perf_evlist__add(evlist, pgfault_maj);
+		evlist__add(evlist, pgfault_maj);
 	}
 
 	if ((trace->trace_pgfaults & TRACE_PFMIN)) {
@@ -3279,7 +3279,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		if (pgfault_min == NULL)
 			goto out_error_mem;
 		perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param);
-		perf_evlist__add(evlist, pgfault_min);
+		evlist__add(evlist, pgfault_min);
 	}
 
 	if (trace->sched &&
tools/perf/tests/mmap-basic.c +1 -1
index 7f96bb72f7e5..16b8a4e5de8f 100644
@@ -82,7 +82,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 		evsels[i]->attr.wakeup_events = 1;
 		perf_evsel__set_sample_id(evsels[i], false);
 
-		perf_evlist__add(evlist, evsels[i]);
+		evlist__add(evlist, evsels[i]);
 
 		if (perf_evsel__open(evsels[i], cpus, threads) < 0) {
 			pr_debug("failed to open counter: %s, "
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 0263420f4495..f822c3c181f3 100644
@@ -48,7 +48,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	err = perf_evlist__create_maps(evlist, &opts.target);
 	if (err < 0) {
tools/perf/tests/sw-clock.c +1 -1
index 247d3734686e..3ab11291174c 100644
@@ -54,7 +54,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		pr_debug("perf_evsel__new\n");
 		goto out_delete_evlist;
 	}
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	cpus = cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(getpid());
tools/perf/util/evlist.c +8 -8
index 986d20c15778..7741e12bdcb0 100644
@@ -177,7 +177,7 @@ static void perf_evlist__propagate_maps(struct evlist *evlist)
 		__perf_evlist__propagate_maps(evlist, evsel);
 }
 
-void perf_evlist__add(struct evlist *evlist, struct evsel *entry)
+void evlist__add(struct evlist *evlist, struct evsel *entry)
 {
 	entry->evlist = evlist;
 	list_add_tail(&entry->node, &evlist->entries);
@@ -204,7 +204,7 @@ void perf_evlist__splice_list_tail(struct evlist *evlist,
 
 	__evlist__for_each_entry_safe(list, temp, evsel) {
 		list_del_init(&evsel->node);
-		perf_evlist__add(evlist, evsel);
+		evlist__add(evlist, evsel);
 	}
 }
 
@@ -237,7 +237,7 @@ int __perf_evlist__add_default(struct evlist *evlist, bool precise)
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
@@ -253,11 +253,11 @@ int perf_evlist__add_dummy(struct evlist *evlist)
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
-static int perf_evlist__add_attrs(struct evlist *evlist,
+static int evlist__add_attrs(struct evlist *evlist,
 				  struct perf_event_attr *attrs, size_t nr_attrs)
 {
 	struct evsel *evsel, *n;
@@ -289,7 +289,7 @@ int __perf_evlist__add_default_attrs(struct evlist *evlist,
 	for (i = 0; i < nr_attrs; i++)
 		event_attr_init(attrs + i);
 
-	return perf_evlist__add_attrs(evlist, attrs, nr_attrs);
+	return evlist__add_attrs(evlist, attrs, nr_attrs);
 }
 
 struct evsel *
@@ -330,7 +330,7 @@ int perf_evlist__add_newtp(struct evlist *evlist,
 		return -1;
 
 	evsel->handler = handler;
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
@@ -1854,7 +1854,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 
 	evsel->side_band.cb = cb;
 	evsel->side_band.data = data;
-	perf_evlist__add(*evlist, evsel);
+	evlist__add(*evlist, evsel);
 	return 0;
 
 out_err:
tools/perf/util/evlist.h +1 -1
index 12a5fd6972df..d52b29a1d852 100644
@@ -73,7 +73,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 void perf_evlist__exit(struct evlist *evlist);
 void evlist__delete(struct evlist *evlist);
 
-void perf_evlist__add(struct evlist *evlist, struct evsel *entry);
+void evlist__add(struct evlist *evlist, struct evsel *entry);
 void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
 
 int __perf_evlist__add_default(struct evlist *evlist, bool precise);
tools/perf/util/header.c +2 -2
index f3d8fdca53ae..9c43a372d8ad 100644
@@ -3586,7 +3586,7 @@ int perf_session__read_header(struct perf_session *session)
 		 * Do it before so that if perf_evsel__alloc_id fails, this
 		 * entry gets purged too at evlist__delete().
 		 */
-		perf_evlist__add(session->evlist, evsel);
+		evlist__add(session->evlist, evsel);
 
 		nr_ids = f_attr.ids.size / sizeof(u64);
 		/*
@@ -4018,7 +4018,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	ids = event->header.size;
 	ids -= (void *)&event->attr.id - (void *)event;
tools/perf/util/python.c +1 -1
index ade4e85c6d81..48c951a4a76b 100644
@@ -974,7 +974,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
 	Py_INCREF(pevsel);
 	evsel = &((struct pyrf_evsel *)pevsel)->evsel;
 	evsel->idx = evlist->nr_entries;
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	return Py_BuildValue("i", evlist->nr_entries);
 }
Signature · 1 line
2.21.0
#24 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__add() to evlist__add()

perf evlist: Rename perf_evlist__add() to evlist__add()
Commit-ID:  a1cf3a75d3317ed893d453c222d220ca4d5f4c4e
Gitweb:     https://git.kernel.org/tip/a1cf3a75d3317ed893d453c222d220ca4d5f4c4e
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:23:59 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__add() to evlist__add()

Rename perf_evlist__add() to evlist__add(), so we don't have a name clash when we add perf_evlist__add() in libperf.

---
 tools/perf/builtin-trace.c                  | 12 ++++++------
 tools/perf/tests/mmap-basic.c               |  2 +-
 tools/perf/tests/openat-syscall-tp-fields.c |  2 +-
 tools/perf/tests/sw-clock.c                 |  2 +-
 tools/perf/util/evlist.c                    | 16 ++++++++--------
 tools/perf/util/evlist.h                    |  2 +-
 tools/perf/util/header.c                    |  4 ++--
 tools/perf/util/python.c                    |  2 +-
 8 files changed, 21 insertions(+), 21 deletions(-)
tools/perf/builtin-trace.c +6 -6
index c5eb47f4e42e..89ae4737ef74 100644
@@ -2616,7 +2616,7 @@ static int trace__record(struct trace *trace, int argc, const char **argv)
 
 static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
 
-static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
+static bool evlist__add_vfs_getname(struct evlist *evlist)
 {
 	bool found = false;
 	struct evsel *evsel, *tmp;
@@ -2719,8 +2719,8 @@ static int trace__add_syscall_newtp(struct trace *trace)
 	perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param);
 	perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param);
 
-	perf_evlist__add(evlist, sys_enter);
-	perf_evlist__add(evlist, sys_exit);
+	evlist__add(evlist, sys_enter);
+	evlist__add(evlist, sys_exit);
 
 	if (callchain_param.enabled && !trace->kernel_syscallchains) {
 		/*
@@ -3264,7 +3264,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 			goto out_error_raw_syscalls;
 
 		if (trace->trace_syscalls)
-			trace->vfs_getname = perf_evlist__add_vfs_getname(evlist);
+			trace->vfs_getname = evlist__add_vfs_getname(evlist);
 	}
 
 	if ((trace->trace_pgfaults & TRACE_PFMAJ)) {
@@ -3272,7 +3272,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		if (pgfault_maj == NULL)
 			goto out_error_mem;
 		perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param);
-		perf_evlist__add(evlist, pgfault_maj);
+		evlist__add(evlist, pgfault_maj);
 	}
 
 	if ((trace->trace_pgfaults & TRACE_PFMIN)) {
@@ -3280,7 +3280,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		if (pgfault_min == NULL)
 			goto out_error_mem;
 		perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param);
-		perf_evlist__add(evlist, pgfault_min);
+		evlist__add(evlist, pgfault_min);
 	}
 
 	if (trace->sched &&
tools/perf/tests/mmap-basic.c +1 -1
index 7f96bb72f7e5..16b8a4e5de8f 100644
@@ -82,7 +82,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 		evsels[i]->attr.wakeup_events = 1;
 		perf_evsel__set_sample_id(evsels[i], false);
 
-		perf_evlist__add(evlist, evsels[i]);
+		evlist__add(evlist, evsels[i]);
 
 		if (perf_evsel__open(evsels[i], cpus, threads) < 0) {
 			pr_debug("failed to open counter: %s, "
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 0263420f4495..f822c3c181f3 100644
@@ -48,7 +48,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	err = perf_evlist__create_maps(evlist, &opts.target);
 	if (err < 0) {
tools/perf/tests/sw-clock.c +1 -1
index 247d3734686e..3ab11291174c 100644
@@ -54,7 +54,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		pr_debug("perf_evsel__new\n");
 		goto out_delete_evlist;
 	}
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	cpus = cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(getpid());
tools/perf/util/evlist.c +8 -8
index 986d20c15778..7741e12bdcb0 100644
@@ -177,7 +177,7 @@ static void perf_evlist__propagate_maps(struct evlist *evlist)
 		__perf_evlist__propagate_maps(evlist, evsel);
 }
 
-void perf_evlist__add(struct evlist *evlist, struct evsel *entry)
+void evlist__add(struct evlist *evlist, struct evsel *entry)
 {
 	entry->evlist = evlist;
 	list_add_tail(&entry->node, &evlist->entries);
@@ -204,7 +204,7 @@ void perf_evlist__splice_list_tail(struct evlist *evlist,
 
 	__evlist__for_each_entry_safe(list, temp, evsel) {
 		list_del_init(&evsel->node);
-		perf_evlist__add(evlist, evsel);
+		evlist__add(evlist, evsel);
 	}
 }
 
@@ -237,7 +237,7 @@ int __perf_evlist__add_default(struct evlist *evlist, bool precise)
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
@@ -253,11 +253,11 @@ int perf_evlist__add_dummy(struct evlist *evlist)
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
-static int perf_evlist__add_attrs(struct evlist *evlist,
+static int evlist__add_attrs(struct evlist *evlist,
 				  struct perf_event_attr *attrs, size_t nr_attrs)
 {
 	struct evsel *evsel, *n;
@@ -289,7 +289,7 @@ int __perf_evlist__add_default_attrs(struct evlist *evlist,
 	for (i = 0; i < nr_attrs; i++)
 		event_attr_init(attrs + i);
 
-	return perf_evlist__add_attrs(evlist, attrs, nr_attrs);
+	return evlist__add_attrs(evlist, attrs, nr_attrs);
 }
 
 struct evsel *
@@ -330,7 +330,7 @@ int perf_evlist__add_newtp(struct evlist *evlist,
 		return -1;
 
 	evsel->handler = handler;
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 	return 0;
 }
 
@@ -1854,7 +1854,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
 
 	evsel->side_band.cb = cb;
 	evsel->side_band.data = data;
-	perf_evlist__add(*evlist, evsel);
+	evlist__add(*evlist, evsel);
 	return 0;
 
 out_err:
tools/perf/util/evlist.h +1 -1
index 12a5fd6972df..d52b29a1d852 100644
@@ -73,7 +73,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
 void perf_evlist__exit(struct evlist *evlist);
 void evlist__delete(struct evlist *evlist);
 
-void perf_evlist__add(struct evlist *evlist, struct evsel *entry);
+void evlist__add(struct evlist *evlist, struct evsel *entry);
 void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
 
 int __perf_evlist__add_default(struct evlist *evlist, bool precise);
tools/perf/util/header.c +2 -2
index 7760ddc4bc18..5e0093251f26 100644
@@ -3593,7 +3593,7 @@ int perf_session__read_header(struct perf_session *session)
 		 * Do it before so that if perf_evsel__alloc_id fails, this
 		 * entry gets purged too at evlist__delete().
 		 */
-		perf_evlist__add(session->evlist, evsel);
+		evlist__add(session->evlist, evsel);
 
 		nr_ids = f_attr.ids.size / sizeof(u64);
 		/*
@@ -4025,7 +4025,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
 	if (evsel == NULL)
 		return -ENOMEM;
 
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	ids = event->header.size;
 	ids -= (void *)&event->attr.id - (void *)event;
tools/perf/util/python.c +1 -1
index ade4e85c6d81..48c951a4a76b 100644
@@ -974,7 +974,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
 	Py_INCREF(pevsel);
 	evsel = &((struct pyrf_evsel *)pevsel)->evsel;
 	evsel->idx = evlist->nr_entries;
-	perf_evlist__add(evlist, evsel);
+	evlist__add(evlist, evsel);
 
 	return Py_BuildValue("i", evlist->nr_entries);
 }
author reviewer
#25 lore raw

PATCH 13/79 perf tools: Rename perf_evlist__remove to evlist__remove

In reply to Jiri Olsa

Renaming perf_evlist__remove to evlist__remove, so we don't have a name clash when we add perf_evlist__remove in libperf.

---
 tools/perf/builtin-inject.c | 4 ++--
 tools/perf/util/evlist.c    | 2 +-
 tools/perf/util/evlist.h    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
tools/perf/builtin-inject.c +2 -2
index 917c8fb4baa5..4e56e399bbc8 100644
@@ -622,7 +622,7 @@ static void strip_fini(struct perf_inject *inject)
 		if (evsel->handler == drop_sample &&
 		    ok_to_remove(evlist, evsel)) {
 			pr_debug("Deleting %s\n", perf_evsel__name(evsel));
-			perf_evlist__remove(evlist, evsel);
+			evlist__remove(evlist, evsel);
 			evsel__delete(evsel);
 		}
 	}
@@ -724,7 +724,7 @@ static int __cmd_inject(struct perf_inject *inject)
 			if (evsel) {
 				pr_debug("Deleting %s\n",
 					 perf_evsel__name(evsel));
-				perf_evlist__remove(session->evlist, evsel);
+				evlist__remove(session->evlist, evsel);
 				evsel__delete(evsel);
 			}
 			if (inject->strip)
tools/perf/util/evlist.c +1 -1
index 7741e12bdcb0..47516db62424 100644
@@ -190,7 +190,7 @@ void evlist__add(struct evlist *evlist, struct evsel *entry)
 	__perf_evlist__propagate_maps(evlist, entry);
 }
 
-void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel)
+void evlist__remove(struct evlist *evlist, struct evsel *evsel)
 {
 	evsel->evlist = NULL;
 	list_del_init(&evsel->node);
tools/perf/util/evlist.h +1 -1
index d52b29a1d852..b3a44e2eed08 100644
@@ -74,7 +74,7 @@ void perf_evlist__exit(struct evlist *evlist);
 void evlist__delete(struct evlist *evlist);
 
 void evlist__add(struct evlist *evlist, struct evsel *entry);
-void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
+void evlist__remove(struct evlist *evlist, struct evsel *evsel);
 
 int __perf_evlist__add_default(struct evlist *evlist, bool precise);
 
Signature · 1 line
2.21.0
#26 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__remove() to evlist__remove()

perf evlist: Rename perf_evlist__remove() to evlist__remove()
Commit-ID:  1625102764a578b11fb407b8194cb0521129d919
Gitweb:     https://git.kernel.org/tip/1625102764a578b11fb407b8194cb0521129d919
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:00 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__remove() to evlist__remove()

Rename perf_evlist__remove() to evlist__remove(), so we don't have a name clash when we add perf_evlist__remove() in libperf.

---
 tools/perf/builtin-inject.c | 4 ++--
 tools/perf/util/evlist.c    | 2 +-
 tools/perf/util/evlist.h    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
tools/perf/builtin-inject.c +2 -2
index 917c8fb4baa5..4e56e399bbc8 100644
@@ -622,7 +622,7 @@ static void strip_fini(struct perf_inject *inject)
 		if (evsel->handler == drop_sample &&
 		    ok_to_remove(evlist, evsel)) {
 			pr_debug("Deleting %s\n", perf_evsel__name(evsel));
-			perf_evlist__remove(evlist, evsel);
+			evlist__remove(evlist, evsel);
 			evsel__delete(evsel);
 		}
 	}
@@ -724,7 +724,7 @@ static int __cmd_inject(struct perf_inject *inject)
 			if (evsel) {
 				pr_debug("Deleting %s\n",
 					 perf_evsel__name(evsel));
-				perf_evlist__remove(session->evlist, evsel);
+				evlist__remove(session->evlist, evsel);
 				evsel__delete(evsel);
 			}
 			if (inject->strip)
tools/perf/util/evlist.c +1 -1
index 7741e12bdcb0..47516db62424 100644
@@ -190,7 +190,7 @@ void evlist__add(struct evlist *evlist, struct evsel *entry)
 	__perf_evlist__propagate_maps(evlist, entry);
 }
 
-void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel)
+void evlist__remove(struct evlist *evlist, struct evsel *evsel)
 {
 	evsel->evlist = NULL;
 	list_del_init(&evsel->node);
tools/perf/util/evlist.h +1 -1
index d52b29a1d852..b3a44e2eed08 100644
@@ -74,7 +74,7 @@ void perf_evlist__exit(struct evlist *evlist);
 void evlist__delete(struct evlist *evlist);
 
 void evlist__add(struct evlist *evlist, struct evsel *entry);
-void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
+void evlist__remove(struct evlist *evlist, struct evsel *evsel);
 
 int __perf_evlist__add_default(struct evlist *evlist, bool precise);
 
author reviewer
#27 lore raw

PATCH 14/79 perf tools: Rename perf_evsel__open to evsel__open

In reply to Jiri Olsa

Renaming perf_evsel__open to evsel__open, so we don't have a name clash when we add perf_evsel__open in libperf.

---
 tools/perf/builtin-record.c                | 2 +-
 tools/perf/builtin-top.c                   | 2 +-
 tools/perf/tests/mmap-basic.c              | 2 +-
 tools/perf/tests/openat-syscall-all-cpus.c | 2 +-
 tools/perf/util/evlist.c                   | 4 ++--
 tools/perf/util/evsel.c                    | 8 ++++----
 tools/perf/util/evsel.h                    | 4 ++--
 tools/perf/util/parse-events.c             | 4 ++--
 tools/perf/util/python.c                   | 2 +-
 9 files changed, 15 insertions(+), 15 deletions(-)
tools/perf/builtin-record.c +1 -1
index 06966a2c2cdd..7f933997b6d0 100644
@@ -739,7 +739,7 @@ static int record__open(struct record *rec)
 
 	evlist__for_each_entry(evlist, pos) {
 try_again:
-		if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) {
+		if (evsel__open(pos, pos->cpus, pos->threads) < 0) {
 			if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
 				if (verbose > 0)
 					ui__warning("%s\n", msg);
tools/perf/builtin-top.c +1 -1
index 6c0c2b78093a..5886389f6a40 100644
@@ -989,7 +989,7 @@ static int perf_top__start_counters(struct perf_top *top)
 
 	evlist__for_each_entry(evlist, counter) {
 try_again:
-		if (perf_evsel__open(counter, top->evlist->cpus,
+		if (evsel__open(counter, top->evlist->cpus,
 				     top->evlist->threads) < 0) {
 
 			/*
tools/perf/tests/mmap-basic.c +1 -1
index 16b8a4e5de8f..40511025208f 100644
@@ -84,7 +84,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 
 		evlist__add(evlist, evsels[i]);
 
-		if (perf_evsel__open(evsels[i], cpus, threads) < 0) {
+		if (evsel__open(evsels[i], cpus, threads) < 0) {
 			pr_debug("failed to open counter: %s, "
 				 "tweak /proc/sys/kernel/perf_event_paranoid?\n",
 				 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index 001a0e8e6998..f96cbd304024 100644
@@ -48,7 +48,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
 		goto out_cpu_map_delete;
 	}
 
-	if (perf_evsel__open(evsel, cpus, threads) < 0) {
+	if (evsel__open(evsel, cpus, threads) < 0) {
 		pr_debug("failed to open counter: %s, "
 			 "tweak /proc/sys/kernel/perf_event_paranoid?\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/util/evlist.c +2 -2
index 47516db62424..4627cc47de3e 100644
@@ -1405,7 +1405,7 @@ int perf_evlist__open(struct evlist *evlist)
 	perf_evlist__update_id_pos(evlist);
 
 	evlist__for_each_entry(evlist, evsel) {
-		err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
+		err = evsel__open(evsel, evsel->cpus, evsel->threads);
 		if (err < 0)
 			goto out_err;
 	}
@@ -1918,7 +1918,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 		goto out_delete_evlist;
 
 	evlist__for_each_entry(evlist, counter) {
-		if (perf_evsel__open(counter, evlist->cpus,
+		if (evsel__open(counter, evlist->cpus,
 				     evlist->threads) < 0)
 			goto out_delete_evlist;
 	}
tools/perf/util/evsel.c +4 -4
index c9723c2d57c9..f365d0685268 100644
@@ -1825,8 +1825,8 @@ static int perf_event_open(struct evsel *evsel,
 	return fd;
 }
 
-int perf_evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
-		     struct perf_thread_map *threads)
+int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
+		struct perf_thread_map *threads)
 {
 	int cpu, thread, nthreads;
 	unsigned long flags = PERF_FLAG_FD_CLOEXEC;
@@ -2086,13 +2086,13 @@ void perf_evsel__close(struct evsel *evsel)
 int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus)
 {
-	return perf_evsel__open(evsel, cpus, NULL);
+	return evsel__open(evsel, cpus, NULL);
 }
 
 int perf_evsel__open_per_thread(struct evsel *evsel,
 				struct perf_thread_map *threads)
 {
-	return perf_evsel__open(evsel, NULL, threads);
+	return evsel__open(evsel, NULL, threads);
 }
 
 static int perf_evsel__parse_id_sample(const struct evsel *evsel,
tools/perf/util/evsel.h +2 -2
index ecea51a918e0..d43409bb07c5 100644
@@ -302,8 +302,8 @@ int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus);
 int perf_evsel__open_per_thread(struct evsel *evsel,
 				struct perf_thread_map *threads);
-int perf_evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
-		     struct perf_thread_map *threads);
+int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
+		struct perf_thread_map *threads);
 void perf_evsel__close(struct evsel *evsel);
 
 struct perf_sample;
tools/perf/util/parse-events.c +2 -2
index 40087cf74dd1..decb66d243ca 100644
@@ -2320,7 +2320,7 @@ static bool is_event_supported(u8 type, unsigned config)
 
 	evsel = evsel__new(&attr);
 	if (evsel) {
-		open_return = perf_evsel__open(evsel, NULL, tmap);
+		open_return = evsel__open(evsel, NULL, tmap);
 		ret = open_return >= 0;
 
 		if (open_return == -EACCES) {
@@ -2332,7 +2332,7 @@ static bool is_event_supported(u8 type, unsigned config)
 			 *
 			 */
 			evsel->attr.exclude_kernel = 1;
-			ret = perf_evsel__open(evsel, NULL, tmap) >= 0;
+			ret = evsel__open(evsel, NULL, tmap) >= 0;
 		}
 		evsel__delete(evsel);
 	}
tools/perf/util/python.c +1 -1
index 48c951a4a76b..3eb7348d29f8 100644
@@ -817,7 +817,7 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel,
 	 * This will group just the fds for this single evsel, to group
 	 * multiple events, use evlist.open().
 	 */
-	if (perf_evsel__open(evsel, cpus, threads) < 0) {
+	if (evsel__open(evsel, cpus, threads) < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
 		return NULL;
 	}
Signature · 1 line
2.21.0
#28 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__open() to evsel__open()

perf evsel: Rename perf_evsel__open() to evsel__open()
Commit-ID:  5972d1e07bd95c7458e2d7f484391d69008affc7
Gitweb:     https://git.kernel.org/tip/5972d1e07bd95c7458e2d7f484391d69008affc7
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:01 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__open() to evsel__open()

Rename perf_evsel__open() to evsel__open(), so we don't have a name clash when we add perf_evsel__open() in libperf.

---
 tools/perf/builtin-record.c                | 2 +-
 tools/perf/builtin-top.c                   | 2 +-
 tools/perf/tests/mmap-basic.c              | 2 +-
 tools/perf/tests/openat-syscall-all-cpus.c | 2 +-
 tools/perf/util/evlist.c                   | 4 ++--
 tools/perf/util/evsel.c                    | 8 ++++----
 tools/perf/util/evsel.h                    | 4 ++--
 tools/perf/util/parse-events.c             | 4 ++--
 tools/perf/util/python.c                   | 2 +-
 9 files changed, 15 insertions(+), 15 deletions(-)
tools/perf/builtin-record.c +1 -1
index 06966a2c2cdd..7f933997b6d0 100644
@@ -739,7 +739,7 @@ static int record__open(struct record *rec)
 
 	evlist__for_each_entry(evlist, pos) {
 try_again:
-		if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) {
+		if (evsel__open(pos, pos->cpus, pos->threads) < 0) {
 			if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
 				if (verbose > 0)
 					ui__warning("%s\n", msg);
tools/perf/builtin-top.c +1 -1
index 6c0c2b78093a..5886389f6a40 100644
@@ -989,7 +989,7 @@ static int perf_top__start_counters(struct perf_top *top)
 
 	evlist__for_each_entry(evlist, counter) {
 try_again:
-		if (perf_evsel__open(counter, top->evlist->cpus,
+		if (evsel__open(counter, top->evlist->cpus,
 				     top->evlist->threads) < 0) {
 
 			/*
tools/perf/tests/mmap-basic.c +1 -1
index 16b8a4e5de8f..40511025208f 100644
@@ -84,7 +84,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 
 		evlist__add(evlist, evsels[i]);
 
-		if (perf_evsel__open(evsels[i], cpus, threads) < 0) {
+		if (evsel__open(evsels[i], cpus, threads) < 0) {
 			pr_debug("failed to open counter: %s, "
 				 "tweak /proc/sys/kernel/perf_event_paranoid?\n",
 				 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index 001a0e8e6998..f96cbd304024 100644
@@ -48,7 +48,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
 		goto out_cpu_map_delete;
 	}
 
-	if (perf_evsel__open(evsel, cpus, threads) < 0) {
+	if (evsel__open(evsel, cpus, threads) < 0) {
 		pr_debug("failed to open counter: %s, "
 			 "tweak /proc/sys/kernel/perf_event_paranoid?\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/util/evlist.c +2 -2
index 47516db62424..4627cc47de3e 100644
@@ -1405,7 +1405,7 @@ int perf_evlist__open(struct evlist *evlist)
 	perf_evlist__update_id_pos(evlist);
 
 	evlist__for_each_entry(evlist, evsel) {
-		err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
+		err = evsel__open(evsel, evsel->cpus, evsel->threads);
 		if (err < 0)
 			goto out_err;
 	}
@@ -1918,7 +1918,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 		goto out_delete_evlist;
 
 	evlist__for_each_entry(evlist, counter) {
-		if (perf_evsel__open(counter, evlist->cpus,
+		if (evsel__open(counter, evlist->cpus,
 				     evlist->threads) < 0)
 			goto out_delete_evlist;
 	}
tools/perf/util/evsel.c +4 -4
index c9723c2d57c9..f365d0685268 100644
@@ -1825,8 +1825,8 @@ static int perf_event_open(struct evsel *evsel,
 	return fd;
 }
 
-int perf_evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
-		     struct perf_thread_map *threads)
+int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
+		struct perf_thread_map *threads)
 {
 	int cpu, thread, nthreads;
 	unsigned long flags = PERF_FLAG_FD_CLOEXEC;
@@ -2086,13 +2086,13 @@ void perf_evsel__close(struct evsel *evsel)
 int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus)
 {
-	return perf_evsel__open(evsel, cpus, NULL);
+	return evsel__open(evsel, cpus, NULL);
 }
 
 int perf_evsel__open_per_thread(struct evsel *evsel,
 				struct perf_thread_map *threads)
 {
-	return perf_evsel__open(evsel, NULL, threads);
+	return evsel__open(evsel, NULL, threads);
 }
 
 static int perf_evsel__parse_id_sample(const struct evsel *evsel,
tools/perf/util/evsel.h +2 -2
index ecea51a918e0..d43409bb07c5 100644
@@ -302,8 +302,8 @@ int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus);
 int perf_evsel__open_per_thread(struct evsel *evsel,
 				struct perf_thread_map *threads);
-int perf_evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
-		     struct perf_thread_map *threads);
+int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
+		struct perf_thread_map *threads);
 void perf_evsel__close(struct evsel *evsel);
 
 struct perf_sample;
tools/perf/util/parse-events.c +2 -2
index 40087cf74dd1..decb66d243ca 100644
@@ -2320,7 +2320,7 @@ static bool is_event_supported(u8 type, unsigned config)
 
 	evsel = evsel__new(&attr);
 	if (evsel) {
-		open_return = perf_evsel__open(evsel, NULL, tmap);
+		open_return = evsel__open(evsel, NULL, tmap);
 		ret = open_return >= 0;
 
 		if (open_return == -EACCES) {
@@ -2332,7 +2332,7 @@ static bool is_event_supported(u8 type, unsigned config)
 			 *
 			 */
 			evsel->attr.exclude_kernel = 1;
-			ret = perf_evsel__open(evsel, NULL, tmap) >= 0;
+			ret = evsel__open(evsel, NULL, tmap) >= 0;
 		}
 		evsel__delete(evsel);
 	}
tools/perf/util/python.c +1 -1
index 48c951a4a76b..3eb7348d29f8 100644
@@ -817,7 +817,7 @@ static PyObject *pyrf_evsel__open(struct pyrf_evsel *pevsel,
 	 * This will group just the fds for this single evsel, to group
 	 * multiple events, use evlist.open().
 	 */
-	if (perf_evsel__open(evsel, cpus, threads) < 0) {
+	if (evsel__open(evsel, cpus, threads) < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
 		return NULL;
 	}
author reviewer
#29 lore raw

PATCH 15/79 perf tools: Rename perf_evsel__enable to evsel__enable

In reply to Jiri Olsa

Renaming perf_evsel__enable to evsel__enable, so we don't have a name clash when we add perf_evsel__enable in libperf.

---
 tools/perf/arch/arm/util/cs-etm.c    | 2 +-
 tools/perf/arch/x86/util/intel-bts.c | 2 +-
 tools/perf/arch/x86/util/intel-pt.c  | 2 +-
 tools/perf/tests/event-times.c       | 6 +++---
 tools/perf/tests/switch-tracking.c   | 2 +-
 tools/perf/util/evlist.c             | 4 ++--
 tools/perf/util/evsel.c              | 2 +-
 tools/perf/util/evsel.h              | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +1 -1
index 48159b62f651..1ff1d9dd432e 100644
@@ -834,7 +834,7 @@ static int cs_etm_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->cs_etm_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-bts.c +1 -1
index c845531d383a..d27832fcb34c 100644
@@ -330,7 +330,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-pt.c +1 -1
index e4dfe8c3d5c3..e3dacb2bf01b 100644
@@ -801,7 +801,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/tests/event-times.c +3 -3
index 0f74ca103c41..6f9995df2c27 100644
@@ -77,7 +77,7 @@ static int attach__current_disabled(struct evlist *evlist)
 	}
 
 	thread_map__put(threads);
-	return perf_evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
+	return evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
 }
 
 static int attach__current_enabled(struct evlist *evlist)
@@ -104,7 +104,7 @@ static int detach__disable(struct evlist *evlist)
 {
 	struct evsel *evsel = perf_evlist__last(evlist);
 
-	return perf_evsel__enable(evsel);
+	return evsel__enable(evsel);
 }
 
 static int attach__cpu_disabled(struct evlist *evlist)
@@ -133,7 +133,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
 	}
 
 	cpu_map__put(cpus);
-	return perf_evsel__enable(evsel);
+	return evsel__enable(evsel);
 }
 
 static int attach__cpu_enabled(struct evlist *evlist)
tools/perf/tests/switch-tracking.c +1 -1
index ac5da4fd222f..acc4b5ff0cea 100644
@@ -509,7 +509,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	err = perf_evsel__enable(cycles_evsel);
+	err = evsel__enable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
tools/perf/util/evlist.c +2 -2
index 4627cc47de3e..e87c43e339d0 100644
@@ -363,7 +363,7 @@ void perf_evlist__enable(struct evlist *evlist)
 	evlist__for_each_entry(evlist, pos) {
 		if (!perf_evsel__is_group_leader(pos) || !pos->fd)
 			continue;
-		perf_evsel__enable(pos);
+		evsel__enable(pos);
 	}
 
 	evlist->enabled = true;
@@ -1927,7 +1927,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 		goto out_delete_evlist;
 
 	evlist__for_each_entry(evlist, counter) {
-		if (perf_evsel__enable(counter))
+		if (evsel__enable(counter))
 			goto out_delete_evlist;
 	}
 
tools/perf/util/evsel.c +1 -1
index f365d0685268..7adae1736191 100644
@@ -1234,7 +1234,7 @@ int perf_evsel__append_addr_filter(struct evsel *evsel, const char *filter)
 	return perf_evsel__append_filter(evsel, "%s,%s", filter);
 }
 
-int perf_evsel__enable(struct evsel *evsel)
+int evsel__enable(struct evsel *evsel)
 {
 	int err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_ENABLE, 0);
 
tools/perf/util/evsel.h +1 -1
index d43409bb07c5..fa26c583a606 100644
@@ -295,7 +295,7 @@ int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
-int perf_evsel__enable(struct evsel *evsel);
+int evsel__enable(struct evsel *evsel);
 int perf_evsel__disable(struct evsel *evsel);
 
 int perf_evsel__open_per_cpu(struct evsel *evsel,
Signature · 1 line
2.21.0
#30 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__enable() to evsel__enable()

perf evsel: Rename perf_evsel__enable() to evsel__enable()
Commit-ID:  ec7f24ef44fc5a4eb5cb71658c33db538ed66003
Gitweb:     https://git.kernel.org/tip/ec7f24ef44fc5a4eb5cb71658c33db538ed66003
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:02 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__enable() to evsel__enable()

Rename perf_evsel__enable() to evsel__enable(), so we don't have a name clash when we add perf_evsel__enable() in libperf.

---
 tools/perf/arch/arm/util/cs-etm.c    | 2 +-
 tools/perf/arch/x86/util/intel-bts.c | 2 +-
 tools/perf/arch/x86/util/intel-pt.c  | 2 +-
 tools/perf/tests/event-times.c       | 6 +++---
 tools/perf/tests/switch-tracking.c   | 2 +-
 tools/perf/util/evlist.c             | 4 ++--
 tools/perf/util/evsel.c              | 2 +-
 tools/perf/util/evsel.h              | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +1 -1
index 91c64daa4487..4b70b9504603 100644
@@ -834,7 +834,7 @@ static int cs_etm_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->cs_etm_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-bts.c +1 -1
index c845531d383a..d27832fcb34c 100644
@@ -330,7 +330,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-pt.c +1 -1
index e4dfe8c3d5c3..e3dacb2bf01b 100644
@@ -801,7 +801,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evsel__enable(evsel);
+			return evsel__enable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/tests/event-times.c +3 -3
index 0f74ca103c41..6f9995df2c27 100644
@@ -77,7 +77,7 @@ static int attach__current_disabled(struct evlist *evlist)
 	}
 
 	thread_map__put(threads);
-	return perf_evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
+	return evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
 }
 
 static int attach__current_enabled(struct evlist *evlist)
@@ -104,7 +104,7 @@ static int detach__disable(struct evlist *evlist)
 {
 	struct evsel *evsel = perf_evlist__last(evlist);
 
-	return perf_evsel__enable(evsel);
+	return evsel__enable(evsel);
 }
 
 static int attach__cpu_disabled(struct evlist *evlist)
@@ -133,7 +133,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
 	}
 
 	cpu_map__put(cpus);
-	return perf_evsel__enable(evsel);
+	return evsel__enable(evsel);
 }
 
 static int attach__cpu_enabled(struct evlist *evlist)
tools/perf/tests/switch-tracking.c +1 -1
index ac5da4fd222f..acc4b5ff0cea 100644
@@ -509,7 +509,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	err = perf_evsel__enable(cycles_evsel);
+	err = evsel__enable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
tools/perf/util/evlist.c +2 -2
index 4627cc47de3e..e87c43e339d0 100644
@@ -363,7 +363,7 @@ void perf_evlist__enable(struct evlist *evlist)
 	evlist__for_each_entry(evlist, pos) {
 		if (!perf_evsel__is_group_leader(pos) || !pos->fd)
 			continue;
-		perf_evsel__enable(pos);
+		evsel__enable(pos);
 	}
 
 	evlist->enabled = true;
@@ -1927,7 +1927,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
 		goto out_delete_evlist;
 
 	evlist__for_each_entry(evlist, counter) {
-		if (perf_evsel__enable(counter))
+		if (evsel__enable(counter))
 			goto out_delete_evlist;
 	}
 
tools/perf/util/evsel.c +1 -1
index f365d0685268..7adae1736191 100644
@@ -1234,7 +1234,7 @@ int perf_evsel__append_addr_filter(struct evsel *evsel, const char *filter)
 	return perf_evsel__append_filter(evsel, "%s,%s", filter);
 }
 
-int perf_evsel__enable(struct evsel *evsel)
+int evsel__enable(struct evsel *evsel)
 {
 	int err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_ENABLE, 0);
 
tools/perf/util/evsel.h +1 -1
index d43409bb07c5..fa26c583a606 100644
@@ -295,7 +295,7 @@ int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
-int perf_evsel__enable(struct evsel *evsel);
+int evsel__enable(struct evsel *evsel);
 int perf_evsel__disable(struct evsel *evsel);
 
 int perf_evsel__open_per_cpu(struct evsel *evsel,
author reviewer
#31 lore raw

PATCH 16/79 perf tools: Rename perf_evsel__disable to evsel__disable

In reply to Jiri Olsa

Renaming perf_evsel__disable to evsel__disable, so we don't have a name clash when we add perf_evsel__disable in libperf.

---
 tools/perf/arch/arm/util/cs-etm.c    | 2 +-
 tools/perf/arch/x86/util/intel-bts.c | 2 +-
 tools/perf/arch/x86/util/intel-pt.c  | 2 +-
 tools/perf/builtin-trace.c           | 2 +-
 tools/perf/tests/keep-tracking.c     | 2 +-
 tools/perf/tests/switch-tracking.c   | 4 ++--
 tools/perf/util/evlist.c             | 2 +-
 tools/perf/util/evsel.c              | 2 +-
 tools/perf/util/evsel.h              | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +1 -1
index 1ff1d9dd432e..84d8e8caadf6 100644
@@ -821,7 +821,7 @@ static int cs_etm_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->cs_etm_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-bts.c +1 -1
index d27832fcb34c..8b0a53d748c9 100644
@@ -317,7 +317,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-pt.c +1 -1
index e3dacb2bf01b..4ce157a4e5e2 100644
@@ -788,7 +788,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/builtin-trace.c +1 -1
index 8e2a0c08e0a3..2ea87cb1c7d0 100644
@@ -2412,7 +2412,7 @@ static int trace__event_handler(struct trace *trace, struct evsel *evsel,
 			++trace->nr_events_printed;
 
 			if (evsel->max_events != ULONG_MAX && ++evsel->nr_events_printed == evsel->max_events) {
-				perf_evsel__disable(evsel);
+				evsel__disable(evsel);
 				perf_evsel__close(evsel);
 			}
 		}
tools/perf/tests/keep-tracking.c +1 -1
index cdc19bcc7523..1976ccb3c812 100644
@@ -129,7 +129,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 
 	evsel = perf_evlist__last(evlist);
 
-	CHECK__(perf_evsel__disable(evsel));
+	CHECK__(evsel__disable(evsel));
 
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
tools/perf/tests/switch-tracking.c +2 -2
index acc4b5ff0cea..5662dc1c6bd3 100644
@@ -464,7 +464,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 
 	perf_evlist__enable(evlist);
 
-	err = perf_evsel__disable(cpu_clocks_evsel);
+	err = evsel__disable(cpu_clocks_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -483,7 +483,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	err = perf_evsel__disable(cycles_evsel);
+	err = evsel__disable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
tools/perf/util/evlist.c +1 -1
index e87c43e339d0..9461583c53d9 100644
@@ -350,7 +350,7 @@ void perf_evlist__disable(struct evlist *evlist)
 	evlist__for_each_entry(evlist, pos) {
 		if (pos->disabled || !perf_evsel__is_group_leader(pos) || !pos->fd)
 			continue;
-		perf_evsel__disable(pos);
+		evsel__disable(pos);
 	}
 
 	evlist->enabled = false;
tools/perf/util/evsel.c +1 -1
index 7adae1736191..855d286298eb 100644
@@ -1244,7 +1244,7 @@ int evsel__enable(struct evsel *evsel)
 	return err;
 }
 
-int perf_evsel__disable(struct evsel *evsel)
+int evsel__disable(struct evsel *evsel)
 {
 	int err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_DISABLE, 0);
 	/*
tools/perf/util/evsel.h +1 -1
index fa26c583a606..c338ce14e8aa 100644
@@ -296,7 +296,7 @@ int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
 int evsel__enable(struct evsel *evsel);
-int perf_evsel__disable(struct evsel *evsel);
+int evsel__disable(struct evsel *evsel);
 
 int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus);
Signature · 1 line
2.21.0
#32 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__disable() to evsel__disable()

perf evsel: Rename perf_evsel__disable() to evsel__disable()
Commit-ID:  9a10bb22897ae9c2aa0ac9c2071f539f406ef942
Gitweb:     https://git.kernel.org/tip/9a10bb22897ae9c2aa0ac9c2071f539f406ef942
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:03 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__disable() to evsel__disable()

Renaming perf_evsel__disable() to evsel__disable(), so we don't have a name clash when we add perf_evsel__disable() in libperf.

---
 tools/perf/arch/arm/util/cs-etm.c    | 2 +-
 tools/perf/arch/x86/util/intel-bts.c | 2 +-
 tools/perf/arch/x86/util/intel-pt.c  | 2 +-
 tools/perf/builtin-trace.c           | 2 +-
 tools/perf/tests/keep-tracking.c     | 2 +-
 tools/perf/tests/switch-tracking.c   | 4 ++--
 tools/perf/util/evlist.c             | 2 +-
 tools/perf/util/evsel.c              | 2 +-
 tools/perf/util/evsel.h              | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +1 -1
index 4b70b9504603..268fcb31cd53 100644
@@ -821,7 +821,7 @@ static int cs_etm_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->cs_etm_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-bts.c +1 -1
index d27832fcb34c..8b0a53d748c9 100644
@@ -317,7 +317,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(btsr->evlist, evsel) {
 		if (evsel->attr.type == btsr->intel_bts_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/arch/x86/util/intel-pt.c +1 -1
index e3dacb2bf01b..4ce157a4e5e2 100644
@@ -788,7 +788,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr)
 
 	evlist__for_each_entry(ptr->evlist, evsel) {
 		if (evsel->attr.type == ptr->intel_pt_pmu->type)
-			return perf_evsel__disable(evsel);
+			return evsel__disable(evsel);
 	}
 	return -EINVAL;
 }
tools/perf/builtin-trace.c +1 -1
index 89ae4737ef74..95ecefa9ff7e 100644
@@ -2400,7 +2400,7 @@ static int trace__event_handler(struct trace *trace, struct evsel *evsel,
 			++trace->nr_events_printed;
 
 			if (evsel->max_events != ULONG_MAX && ++evsel->nr_events_printed == evsel->max_events) {
-				perf_evsel__disable(evsel);
+				evsel__disable(evsel);
 				perf_evsel__close(evsel);
 			}
 		}
tools/perf/tests/keep-tracking.c +1 -1
index cdc19bcc7523..1976ccb3c812 100644
@@ -129,7 +129,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 
 	evsel = perf_evlist__last(evlist);
 
-	CHECK__(perf_evsel__disable(evsel));
+	CHECK__(evsel__disable(evsel));
 
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
tools/perf/tests/switch-tracking.c +2 -2
index acc4b5ff0cea..5662dc1c6bd3 100644
@@ -464,7 +464,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 
 	perf_evlist__enable(evlist);
 
-	err = perf_evsel__disable(cpu_clocks_evsel);
+	err = evsel__disable(cpu_clocks_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
@@ -483,7 +483,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	err = perf_evsel__disable(cycles_evsel);
+	err = evsel__disable(cycles_evsel);
 	if (err) {
 		pr_debug("perf_evlist__disable_event failed!\n");
 		goto out_err;
tools/perf/util/evlist.c +1 -1
index e87c43e339d0..9461583c53d9 100644
@@ -350,7 +350,7 @@ void perf_evlist__disable(struct evlist *evlist)
 	evlist__for_each_entry(evlist, pos) {
 		if (pos->disabled || !perf_evsel__is_group_leader(pos) || !pos->fd)
 			continue;
-		perf_evsel__disable(pos);
+		evsel__disable(pos);
 	}
 
 	evlist->enabled = false;
tools/perf/util/evsel.c +1 -1
index 7adae1736191..855d286298eb 100644
@@ -1244,7 +1244,7 @@ int evsel__enable(struct evsel *evsel)
 	return err;
 }
 
-int perf_evsel__disable(struct evsel *evsel)
+int evsel__disable(struct evsel *evsel)
 {
 	int err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_DISABLE, 0);
 	/*
tools/perf/util/evsel.h +1 -1
index fa26c583a606..c338ce14e8aa 100644
@@ -296,7 +296,7 @@ int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
 int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
 int evsel__enable(struct evsel *evsel);
-int perf_evsel__disable(struct evsel *evsel);
+int evsel__disable(struct evsel *evsel);
 
 int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus);
author reviewer
#33 lore raw

PATCH 17/79 perf tools: Rename perf_evsel__apply_filter to evsel__apply_filter

In reply to Jiri Olsa

Renaming perf_evsel__apply_filter to evsel__apply_filter, so we don't have a name clash when we add perf_evsel__apply_filter in libperf.

---
 tools/perf/util/evlist.c | 2 +-
 tools/perf/util/evsel.c  | 2 +-
 tools/perf/util/evsel.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/evlist.c +1 -1
index 9461583c53d9..e71c3cc93924 100644
@@ -1158,7 +1158,7 @@ int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel)
 		 * filters only work for tracepoint event, which doesn't have cpu limit.
 		 * So evlist and evsel should always be same.
 		 */
-		err = perf_evsel__apply_filter(evsel, evsel->filter);
+		err = evsel__apply_filter(evsel, evsel->filter);
 		if (err) {
 			*err_evsel = evsel;
 			break;
tools/perf/util/evsel.c +1 -1
index 855d286298eb..5aeb7260c8e1 100644
@@ -1187,7 +1187,7 @@ static int perf_evsel__run_ioctl(struct evsel *evsel,
 	return 0;
 }
 
-int perf_evsel__apply_filter(struct evsel *evsel, const char *filter)
+int evsel__apply_filter(struct evsel *evsel, const char *filter)
 {
 	return perf_evsel__run_ioctl(evsel,
 				     PERF_EVENT_IOC_SET_FILTER,
tools/perf/util/evsel.h +1 -1
index c338ce14e8aa..35f7e7ff3c5e 100644
@@ -294,7 +294,7 @@ int perf_evsel__set_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
-int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
+int evsel__apply_filter(struct evsel *evsel, const char *filter);
 int evsel__enable(struct evsel *evsel);
 int evsel__disable(struct evsel *evsel);
 
Signature · 1 line
2.21.0
#34 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__apply_filter() to evsel__apply_filter()

perf evsel: Rename perf_evsel__apply_filter() to evsel__apply_filter()
Commit-ID:  24e376b24582648d363df4e0a6bcc2ffcecd211e
Gitweb:     https://git.kernel.org/tip/24e376b24582648d363df4e0a6bcc2ffcecd211e
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:04 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__apply_filter() to evsel__apply_filter()

Rename perf_evsel__apply_filter() to evsel__apply_filter(), so we don't have a name clash when we add perf_evsel__apply_filter() in libperf.

---
 tools/perf/util/evlist.c | 2 +-
 tools/perf/util/evsel.c  | 2 +-
 tools/perf/util/evsel.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/evlist.c +1 -1
index 9461583c53d9..e71c3cc93924 100644
@@ -1158,7 +1158,7 @@ int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel)
 		 * filters only work for tracepoint event, which doesn't have cpu limit.
 		 * So evlist and evsel should always be same.
 		 */
-		err = perf_evsel__apply_filter(evsel, evsel->filter);
+		err = evsel__apply_filter(evsel, evsel->filter);
 		if (err) {
 			*err_evsel = evsel;
 			break;
tools/perf/util/evsel.c +1 -1
index 855d286298eb..5aeb7260c8e1 100644
@@ -1187,7 +1187,7 @@ static int perf_evsel__run_ioctl(struct evsel *evsel,
 	return 0;
 }
 
-int perf_evsel__apply_filter(struct evsel *evsel, const char *filter)
+int evsel__apply_filter(struct evsel *evsel, const char *filter)
 {
 	return perf_evsel__run_ioctl(evsel,
 				     PERF_EVENT_IOC_SET_FILTER,
tools/perf/util/evsel.h +1 -1
index c338ce14e8aa..35f7e7ff3c5e 100644
@@ -294,7 +294,7 @@ int perf_evsel__set_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_tp_filter(struct evsel *evsel, const char *filter);
 int perf_evsel__append_addr_filter(struct evsel *evsel,
 				   const char *filter);
-int perf_evsel__apply_filter(struct evsel *evsel, const char *filter);
+int evsel__apply_filter(struct evsel *evsel, const char *filter);
 int evsel__enable(struct evsel *evsel);
 int evsel__disable(struct evsel *evsel);
 
author reviewer
#35 lore raw

PATCH 18/79 perf tools: Rename perf_evsel__cpus to evsel__cpus

In reply to Jiri Olsa

Renaming perf_evsel__cpus to evsel__cpus, so we don't have a name clash when we add perf_evsel__cpus in libperf.

---
 tools/perf/util/evsel.h        | 4 ++--
 tools/perf/util/stat-display.c | 6 +++---
 tools/perf/util/stat.c         | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/util/evsel.h +2 -2
index 35f7e7ff3c5e..5fec1ca64f58 100644
@@ -197,14 +197,14 @@ struct target;
 struct thread_map;
 struct record_opts;
 
-static inline struct perf_cpu_map *perf_evsel__cpus(struct evsel *evsel)
+static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel)
 {
 	return evsel->cpus;
 }
 
 static inline int perf_evsel__nr_cpus(struct evsel *evsel)
 {
-	return perf_evsel__cpus(evsel)->nr;
+	return evsel__cpus(evsel)->nr;
 }
 
 void perf_counts_values__scale(struct perf_counts_values *count,
tools/perf/util/stat-display.c +3 -3
index cdfceb5b4d72..f7666d2e6e0c 100644
@@ -109,7 +109,7 @@ static void aggr_printout(struct perf_stat_config *config,
 		} else {
 			fprintf(config->output, "CPU%*d%s ",
 				config->csv_output ? 0 : -5,
-				perf_evsel__cpus(evsel)->map[id],
+				evsel__cpus(evsel)->map[id],
 				config->csv_sep);
 		}
 		break;
@@ -325,7 +325,7 @@ static int first_shadow_cpu(struct perf_stat_config *config,
 		return 0;
 
 	for (i = 0; i < perf_evsel__nr_cpus(evsel); i++) {
-		int cpu2 = perf_evsel__cpus(evsel)->map[i];
+		int cpu2 = evsel__cpus(evsel)->map[i];
 
 		if (config->aggr_get_id(config, evlist->cpus, cpu2) == id)
 			return cpu2;
@@ -593,7 +593,7 @@ static void aggr_cb(struct perf_stat_config *config,
 	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
 		struct perf_counts_values *counts;
 
-		s2 = config->aggr_get_id(config, perf_evsel__cpus(counter), cpu);
+		s2 = config->aggr_get_id(config, evsel__cpus(counter), cpu);
 		if (s2 != ad->id)
 			continue;
 		if (first)
tools/perf/util/stat.c +2 -2
index efd934ec02c3..63f7815ceb4f 100644
@@ -215,7 +215,7 @@ static int check_per_pkg(struct evsel *counter,
 			 struct perf_counts_values *vals, int cpu, bool *skip)
 {
 	unsigned long *mask = counter->per_pkg_mask;
-	struct perf_cpu_map *cpus = perf_evsel__cpus(counter);
+	struct perf_cpu_map *cpus = evsel__cpus(counter);
 	int s;
 
 	*skip = false;
@@ -483,7 +483,7 @@ int create_perf_stat_counter(struct evsel *evsel,
 	}
 
 	if (target__has_cpu(target) && !target__has_per_thread(target))
-		return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel));
+		return perf_evsel__open_per_cpu(evsel, evsel__cpus(evsel));
 
 	return perf_evsel__open_per_thread(evsel, evsel->threads);
 }
Signature · 1 line
2.21.0
#36 lore raw

[tip:perf/core] perf evsel: Rename perf_evsel__cpus() to evsel__cpus()

perf evsel: Rename perf_evsel__cpus() to evsel__cpus()
Commit-ID:  b49aca3e9ce60d00e5bf0694b2ff4c2cd40809e5
Gitweb:     https://git.kernel.org/tip/b49aca3e9ce60d00e5bf0694b2ff4c2cd40809e5
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:05 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evsel: Rename perf_evsel__cpus() to evsel__cpus()

Rename perf_evsel__cpus() to evsel__cpus(), so we don't have a name clash when we add perf_evsel__cpus() in libperf.

---
 tools/perf/util/evsel.h        | 4 ++--
 tools/perf/util/stat-display.c | 6 +++---
 tools/perf/util/stat.c         | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/util/evsel.h +2 -2
index 35f7e7ff3c5e..5fec1ca64f58 100644
@@ -197,14 +197,14 @@ struct target;
 struct thread_map;
 struct record_opts;
 
-static inline struct perf_cpu_map *perf_evsel__cpus(struct evsel *evsel)
+static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel)
 {
 	return evsel->cpus;
 }
 
 static inline int perf_evsel__nr_cpus(struct evsel *evsel)
 {
-	return perf_evsel__cpus(evsel)->nr;
+	return evsel__cpus(evsel)->nr;
 }
 
 void perf_counts_values__scale(struct perf_counts_values *count,
tools/perf/util/stat-display.c +3 -3
index cdfceb5b4d72..f7666d2e6e0c 100644
@@ -109,7 +109,7 @@ static void aggr_printout(struct perf_stat_config *config,
 		} else {
 			fprintf(config->output, "CPU%*d%s ",
 				config->csv_output ? 0 : -5,
-				perf_evsel__cpus(evsel)->map[id],
+				evsel__cpus(evsel)->map[id],
 				config->csv_sep);
 		}
 		break;
@@ -325,7 +325,7 @@ static int first_shadow_cpu(struct perf_stat_config *config,
 		return 0;
 
 	for (i = 0; i < perf_evsel__nr_cpus(evsel); i++) {
-		int cpu2 = perf_evsel__cpus(evsel)->map[i];
+		int cpu2 = evsel__cpus(evsel)->map[i];
 
 		if (config->aggr_get_id(config, evlist->cpus, cpu2) == id)
 			return cpu2;
@@ -593,7 +593,7 @@ static void aggr_cb(struct perf_stat_config *config,
 	for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
 		struct perf_counts_values *counts;
 
-		s2 = config->aggr_get_id(config, perf_evsel__cpus(counter), cpu);
+		s2 = config->aggr_get_id(config, evsel__cpus(counter), cpu);
 		if (s2 != ad->id)
 			continue;
 		if (first)
tools/perf/util/stat.c +2 -2
index efd934ec02c3..63f7815ceb4f 100644
@@ -215,7 +215,7 @@ static int check_per_pkg(struct evsel *counter,
 			 struct perf_counts_values *vals, int cpu, bool *skip)
 {
 	unsigned long *mask = counter->per_pkg_mask;
-	struct perf_cpu_map *cpus = perf_evsel__cpus(counter);
+	struct perf_cpu_map *cpus = evsel__cpus(counter);
 	int s;
 
 	*skip = false;
@@ -483,7 +483,7 @@ int create_perf_stat_counter(struct evsel *evsel,
 	}
 
 	if (target__has_cpu(target) && !target__has_per_thread(target))
-		return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel));
+		return perf_evsel__open_per_cpu(evsel, evsel__cpus(evsel));
 
 	return perf_evsel__open_per_thread(evsel, evsel->threads);
 }
author reviewer
#37 lore raw

PATCH 19/79 perf tools: Rename perf_evlist__open to evlist__open

In reply to Jiri Olsa

Renaming perf_evlist__open to evlist__open, so we don't have a name clash when we add perf_evlist__open in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 2 +-
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/event-times.c               | 2 +-
 tools/perf/tests/keep-tracking.c             | 2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/perf-record.c               | 2 +-
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 2 +-
 tools/perf/tests/task-exit.c                 | 2 +-
 tools/perf/util/evlist.c                     | 2 +-
 tools/perf/util/evlist.h                     | 2 +-
 tools/perf/util/python.c                     | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index 09b6cef76f5b..ea4cf1d367a6 100644
@@ -83,7 +83,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	evsel->attr.disabled = 1;
 	evsel->attr.enable_on_exec = 0;
 
-	CHECK__(perf_evlist__open(evlist));
+	CHECK__(evlist__open(evlist));
 
 	CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
 
tools/perf/builtin-kvm.c +1 -1
index 8f54bdfb5743..85604d117558 100644
@@ -1048,7 +1048,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
 		attr->disabled = 1;
 	}
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		printf("Couldn't create the events: %s\n",
 		       str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/builtin-trace.c +1 -1
index 2ea87cb1c7d0..26ece6b446f0 100644
@@ -3341,7 +3341,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		}
 	}
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0)
 		goto out_error_open;
 
tools/perf/tests/backward-ring-buffer.c +1 -1
index ef3c6db2fae4..8de2d6ad93ce 100644
@@ -125,7 +125,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 
 	perf_evlist__config(evlist, &opts, NULL);
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/bpf.c +1 -1
index 313ff1aadd9c..b41c41482283 100644
@@ -157,7 +157,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 
 	perf_evlist__config(evlist, &opts, NULL);
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/code-reading.c +1 -1
index 1c7f092a7388..23abc775a69c 100644
@@ -646,7 +646,7 @@ static int do_test_code_reading(bool try_kcore)
 		evsel->attr.disabled = 1;
 		evsel->attr.enable_on_exec = 0;
 
-		ret = perf_evlist__open(evlist);
+		ret = evlist__open(evlist);
 		if (ret < 0) {
 			if (!excl_kernel) {
 				excl_kernel = true;
tools/perf/tests/event-times.c +1 -1
index 6f9995df2c27..bf00d3d792fb 100644
@@ -38,7 +38,7 @@ static int attach__enable_on_exec(struct evlist *evlist)
 
 	evsel->attr.enable_on_exec = 1;
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/keep-tracking.c +1 -1
index 1976ccb3c812..c55bc062e200 100644
@@ -94,7 +94,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	evsel->attr.disabled = 1;
 	evsel->attr.enable_on_exec = 0;
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		pr_debug("Unable to open dummy and cycles event\n");
 		err = TEST_SKIP;
 		goto out_err;
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index f822c3c181f3..233447af9d03 100644
@@ -60,7 +60,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 
 	thread_map__set_pid(evlist->threads, 0, getpid());
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/perf-record.c +1 -1
index 779d5996428b..f5d1e7f1b58b 100644
@@ -130,7 +130,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 	 * Call sys_perf_event_open on all the fds on all the evsels,
 	 * grouping them if asked to.
 	 */
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/sw-clock.c +1 -1
index 3ab11291174c..528a2dff06e0 100644
@@ -69,7 +69,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	cpus	= NULL;
 	threads = NULL;
 
-	if (perf_evlist__open(evlist)) {
+	if (evlist__open(evlist)) {
 		const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate";
 
 		err = -errno;
tools/perf/tests/switch-tracking.c +1 -1
index 5662dc1c6bd3..47f9895ba807 100644
@@ -450,7 +450,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		}
 	}
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		pr_debug("Not supported\n");
 		err = 0;
 		goto out;
tools/perf/tests/task-exit.c +1 -1
index 698ee5369c02..d17effdd55c8 100644
@@ -95,7 +95,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	evsel->attr.wakeup_events = 1;
 	evsel->attr.exclude_kernel = 1;
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("Couldn't open the evlist: %s\n",
 			 str_error_r(-err, sbuf, sizeof(sbuf)));
tools/perf/util/evlist.c +1 -1
index e71c3cc93924..7d44e05dfaa4 100644
@@ -1387,7 +1387,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 	goto out;
 }
 
-int perf_evlist__open(struct evlist *evlist)
+int evlist__open(struct evlist *evlist)
 {
 	struct evsel *evsel;
 	int err;
tools/perf/util/evlist.h +1 -1
index b3a44e2eed08..f4b3152c879e 100644
@@ -146,7 +146,7 @@ void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state sta
 
 void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
 
-int perf_evlist__open(struct evlist *evlist);
+int evlist__open(struct evlist *evlist);
 void perf_evlist__close(struct evlist *evlist);
 
 struct callchain_param;
tools/perf/util/python.c +1 -1
index 3eb7348d29f8..cc4af99ab190 100644
@@ -1059,7 +1059,7 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist,
 	if (group)
 		perf_evlist__set_leader(evlist);
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
 		return NULL;
 	}
Signature · 1 line
2.21.0
#38 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__open() to evlist__open()

perf evlist: Rename perf_evlist__open() to evlist__open()
Commit-ID:  474ddc4c46025a615d0ea791d37ce9038fa20229
Gitweb:     https://git.kernel.org/tip/474ddc4c46025a615d0ea791d37ce9038fa20229
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:06 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__open() to evlist__open()

Rename perf_evlist__open() to evlist__open(), so we don't have a name clash when we add perf_evlist__open() in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 2 +-
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/event-times.c               | 2 +-
 tools/perf/tests/keep-tracking.c             | 2 +-
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/perf-record.c               | 2 +-
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 2 +-
 tools/perf/tests/task-exit.c                 | 2 +-
 tools/perf/util/evlist.c                     | 2 +-
 tools/perf/util/evlist.h                     | 2 +-
 tools/perf/util/python.c                     | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index 09b6cef76f5b..ea4cf1d367a6 100644
@@ -83,7 +83,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	evsel->attr.disabled = 1;
 	evsel->attr.enable_on_exec = 0;
 
-	CHECK__(perf_evlist__open(evlist));
+	CHECK__(evlist__open(evlist));
 
 	CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
 
tools/perf/builtin-kvm.c +1 -1
index 8f54bdfb5743..85604d117558 100644
@@ -1048,7 +1048,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
 		attr->disabled = 1;
 	}
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		printf("Couldn't create the events: %s\n",
 		       str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/builtin-trace.c +1 -1
index 95ecefa9ff7e..e508fdb77099 100644
@@ -3342,7 +3342,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		}
 	}
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0)
 		goto out_error_open;
 
tools/perf/tests/backward-ring-buffer.c +1 -1
index ef3c6db2fae4..8de2d6ad93ce 100644
@@ -125,7 +125,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
 
 	perf_evlist__config(evlist, &opts, NULL);
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/bpf.c +1 -1
index 313ff1aadd9c..b41c41482283 100644
@@ -157,7 +157,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 
 	perf_evlist__config(evlist, &opts, NULL);
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/code-reading.c +1 -1
index 1c7f092a7388..23abc775a69c 100644
@@ -646,7 +646,7 @@ static int do_test_code_reading(bool try_kcore)
 		evsel->attr.disabled = 1;
 		evsel->attr.enable_on_exec = 0;
 
-		ret = perf_evlist__open(evlist);
+		ret = evlist__open(evlist);
 		if (ret < 0) {
 			if (!excl_kernel) {
 				excl_kernel = true;
tools/perf/tests/event-times.c +1 -1
index 6f9995df2c27..bf00d3d792fb 100644
@@ -38,7 +38,7 @@ static int attach__enable_on_exec(struct evlist *evlist)
 
 	evsel->attr.enable_on_exec = 1;
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/keep-tracking.c +1 -1
index 1976ccb3c812..c55bc062e200 100644
@@ -94,7 +94,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	evsel->attr.disabled = 1;
 	evsel->attr.enable_on_exec = 0;
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		pr_debug("Unable to open dummy and cycles event\n");
 		err = TEST_SKIP;
 		goto out_err;
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index f822c3c181f3..233447af9d03 100644
@@ -60,7 +60,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 
 	thread_map__set_pid(evlist->threads, 0, getpid());
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/perf-record.c +1 -1
index 779d5996428b..f5d1e7f1b58b 100644
@@ -130,7 +130,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 	 * Call sys_perf_event_open on all the fds on all the evsels,
 	 * grouping them if asked to.
 	 */
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("perf_evlist__open: %s\n",
 			 str_error_r(errno, sbuf, sizeof(sbuf)));
tools/perf/tests/sw-clock.c +1 -1
index 3ab11291174c..528a2dff06e0 100644
@@ -69,7 +69,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	cpus	= NULL;
 	threads = NULL;
 
-	if (perf_evlist__open(evlist)) {
+	if (evlist__open(evlist)) {
 		const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate";
 
 		err = -errno;
tools/perf/tests/switch-tracking.c +1 -1
index 5662dc1c6bd3..47f9895ba807 100644
@@ -450,7 +450,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		}
 	}
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		pr_debug("Not supported\n");
 		err = 0;
 		goto out;
tools/perf/tests/task-exit.c +1 -1
index 698ee5369c02..d17effdd55c8 100644
@@ -95,7 +95,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	evsel->attr.wakeup_events = 1;
 	evsel->attr.exclude_kernel = 1;
 
-	err = perf_evlist__open(evlist);
+	err = evlist__open(evlist);
 	if (err < 0) {
 		pr_debug("Couldn't open the evlist: %s\n",
 			 str_error_r(-err, sbuf, sizeof(sbuf)));
tools/perf/util/evlist.c +1 -1
index e71c3cc93924..7d44e05dfaa4 100644
@@ -1387,7 +1387,7 @@ out_put:
 	goto out;
 }
 
-int perf_evlist__open(struct evlist *evlist)
+int evlist__open(struct evlist *evlist)
 {
 	struct evsel *evsel;
 	int err;
tools/perf/util/evlist.h +1 -1
index b3a44e2eed08..f4b3152c879e 100644
@@ -146,7 +146,7 @@ void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state sta
 
 void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
 
-int perf_evlist__open(struct evlist *evlist);
+int evlist__open(struct evlist *evlist);
 void perf_evlist__close(struct evlist *evlist);
 
 struct callchain_param;
tools/perf/util/python.c +1 -1
index 3eb7348d29f8..cc4af99ab190 100644
@@ -1059,7 +1059,7 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist,
 	if (group)
 		perf_evlist__set_leader(evlist);
 
-	if (perf_evlist__open(evlist) < 0) {
+	if (evlist__open(evlist) < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
 		return NULL;
 	}
author reviewer
#39 lore raw

PATCH 20/79 perf tools: Rename perf_evlist__close to evlist__close

In reply to Jiri Olsa

Renaming perf_evlist__close to evlist__close, so we don't have a name clash when we add perf_evlist__close in libperf.

---
 tools/perf/builtin-kvm.c  | 2 +-
 tools/perf/builtin-stat.c | 4 ++--
 tools/perf/util/evlist.c  | 6 +++---
 tools/perf/util/evlist.h  | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-kvm.c +1 -1
index 85604d117558..6a0573a9c16b 100644
@@ -1058,7 +1058,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
 	if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
 		ui__error("Failed to mmap the events: %s\n",
 			  str_error_r(errno, sbuf, sizeof(sbuf)));
-		perf_evlist__close(evlist);
+		evlist__close(evlist);
 		goto out;
 	}
 
tools/perf/builtin-stat.c +2 -2
index d28d4d71d9b7..bdfe138f7aed 100644
@@ -613,7 +613,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
 	 * later the evsel_list will be closed after.
 	 */
 	if (!STAT_RECORD)
-		perf_evlist__close(evsel_list);
+		evlist__close(evsel_list);
 
 	return WEXITSTATUS(status);
 }
@@ -2003,7 +2003,7 @@ int cmd_stat(int argc, const char **argv)
 			perf_session__write_header(perf_stat.session, evsel_list, fd, true);
 		}
 
-		perf_evlist__close(evsel_list);
+		evlist__close(evsel_list);
 		perf_session__delete(perf_stat.session);
 	}
 
tools/perf/util/evlist.c +3 -3
index 7d44e05dfaa4..67c288f467f6 100644
@@ -140,7 +140,7 @@ void evlist__delete(struct evlist *evlist)
 		return;
 
 	perf_evlist__munmap(evlist);
-	perf_evlist__close(evlist);
+	evlist__close(evlist);
 	cpu_map__put(evlist->cpus);
 	thread_map__put(evlist->threads);
 	evlist->cpus = NULL;
@@ -1348,7 +1348,7 @@ void perf_evlist__set_selected(struct evlist *evlist,
 	evlist->selected = evsel;
 }
 
-void perf_evlist__close(struct evlist *evlist)
+void evlist__close(struct evlist *evlist)
 {
 	struct evsel *evsel;
 
@@ -1412,7 +1412,7 @@ int evlist__open(struct evlist *evlist)
 
 	return 0;
 out_err:
-	perf_evlist__close(evlist);
+	evlist__close(evlist);
 	errno = -err;
 	return err;
 }
tools/perf/util/evlist.h +1 -1
index f4b3152c879e..47e9d26b6774 100644
@@ -147,7 +147,7 @@ void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state sta
 void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
 
 int evlist__open(struct evlist *evlist);
-void perf_evlist__close(struct evlist *evlist);
+void evlist__close(struct evlist *evlist);
 
 struct callchain_param;
 
Signature · 1 line
2.21.0
#40 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__close() to evlist__close()

perf evlist: Rename perf_evlist__close() to evlist__close()
Commit-ID:  750b4edeb0527414fb17b0ee2a76d2dbbd9a199d
Gitweb:     https://git.kernel.org/tip/750b4edeb0527414fb17b0ee2a76d2dbbd9a199d
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:07 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__close() to evlist__close()

Rename perf_evlist__close() to evlist__close(), so we don't have a name clash when we add perf_evlist__close() in libperf.

---
 tools/perf/builtin-kvm.c  | 2 +-
 tools/perf/builtin-stat.c | 4 ++--
 tools/perf/util/evlist.c  | 6 +++---
 tools/perf/util/evlist.h  | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-kvm.c +1 -1
index 85604d117558..6a0573a9c16b 100644
@@ -1058,7 +1058,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
 	if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
 		ui__error("Failed to mmap the events: %s\n",
 			  str_error_r(errno, sbuf, sizeof(sbuf)));
-		perf_evlist__close(evlist);
+		evlist__close(evlist);
 		goto out;
 	}
 
tools/perf/builtin-stat.c +2 -2
index d28d4d71d9b7..bdfe138f7aed 100644
@@ -613,7 +613,7 @@ try_again:
 	 * later the evsel_list will be closed after.
 	 */
 	if (!STAT_RECORD)
-		perf_evlist__close(evsel_list);
+		evlist__close(evsel_list);
 
 	return WEXITSTATUS(status);
 }
@@ -2003,7 +2003,7 @@ int cmd_stat(int argc, const char **argv)
 			perf_session__write_header(perf_stat.session, evsel_list, fd, true);
 		}
 
-		perf_evlist__close(evsel_list);
+		evlist__close(evsel_list);
 		perf_session__delete(perf_stat.session);
 	}
 
tools/perf/util/evlist.c +3 -3
index 7d44e05dfaa4..67c288f467f6 100644
@@ -140,7 +140,7 @@ void evlist__delete(struct evlist *evlist)
 		return;
 
 	perf_evlist__munmap(evlist);
-	perf_evlist__close(evlist);
+	evlist__close(evlist);
 	cpu_map__put(evlist->cpus);
 	thread_map__put(evlist->threads);
 	evlist->cpus = NULL;
@@ -1348,7 +1348,7 @@ void perf_evlist__set_selected(struct evlist *evlist,
 	evlist->selected = evsel;
 }
 
-void perf_evlist__close(struct evlist *evlist)
+void evlist__close(struct evlist *evlist)
 {
 	struct evsel *evsel;
 
@@ -1412,7 +1412,7 @@ int evlist__open(struct evlist *evlist)
 
 	return 0;
 out_err:
-	perf_evlist__close(evlist);
+	evlist__close(evlist);
 	errno = -err;
 	return err;
 }
tools/perf/util/evlist.h +1 -1
index f4b3152c879e..47e9d26b6774 100644
@@ -147,7 +147,7 @@ void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state sta
 void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
 
 int evlist__open(struct evlist *evlist);
-void perf_evlist__close(struct evlist *evlist);
+void evlist__close(struct evlist *evlist);
 
 struct callchain_param;
 
author reviewer
#41 lore raw

PATCH 21/79 perf tools: Rename perf_evlist__enable to evlist__enable

In reply to Jiri Olsa

Renaming perf_evlist__enable to evlist__enable, so we don't have a name clash when we add perf_evlist__enable in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 4 ++--
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-top.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 4 ++--
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 4 ++--
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/perf-record.c               | 2 +-
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 2 +-
 tools/perf/util/evlist.c                     | 4 ++--
 tools/perf/util/evlist.h                     | 2 +-
 16 files changed, 20 insertions(+), 20 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index ea4cf1d367a6..aa5a5c972ce5 100644
@@ -97,7 +97,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 		goto out_err;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	comm1 = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm1, 0, 0, 0));
tools/perf/builtin-kvm.c +1 -1
index 6a0573a9c16b..9207bd49583e 100644
@@ -972,7 +972,7 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		goto out;
 
 	/* everything is good - enable the events and process */
-	perf_evlist__enable(kvm->evlist);
+	evlist__enable(kvm->evlist);
 
 	while (!done) {
 		struct fdarray *fda = &kvm->evlist->pollfd;
tools/perf/builtin-record.c +2 -2
index 7f933997b6d0..8e20ead0ddbe 100644
@@ -1453,7 +1453,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	 * so don't spoil it by prematurely enabling them.
 	 */
 	if (!target__none(&opts->target) && !opts->initial_delay)
-		perf_evlist__enable(rec->evlist);
+		evlist__enable(rec->evlist);
 
 	/*
 	 * Let the child rip
@@ -1506,7 +1506,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 
 	if (opts->initial_delay) {
 		usleep(opts->initial_delay * USEC_PER_MSEC);
-		perf_evlist__enable(rec->evlist);
+		evlist__enable(rec->evlist);
 	}
 
 	trigger_ready(&auxtrace_snapshot_trigger);
tools/perf/builtin-stat.c +1 -1
index bdfe138f7aed..c0e9d94b6dd5 100644
@@ -362,7 +362,7 @@ static void enable_counters(void)
 	 * - we have initial delay configured
 	 */
 	if (!target__none(&target) || stat_config.initial_delay)
-		perf_evlist__enable(evsel_list);
+		evlist__enable(evsel_list);
 }
 
 static void disable_counters(void)
tools/perf/builtin-top.c +1 -1
index 5886389f6a40..b103f1ba01cb 100644
@@ -1255,7 +1255,7 @@ static int __cmd_top(struct perf_top *top)
 	 * so leave the check here.
 	 */
         if (!target__none(&opts->target))
-                perf_evlist__enable(top->evlist);
+		evlist__enable(top->evlist);
 
 	ret = -1;
 	if (pthread_create(&thread_process, NULL, process_thread, top)) {
tools/perf/builtin-trace.c +2 -2
index 26ece6b446f0..b0e840a6906b 100644
@@ -3401,14 +3401,14 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		goto out_error_mmap;
 
 	if (!target__none(&trace->opts.target) && !trace->opts.initial_delay)
-		perf_evlist__enable(evlist);
+		evlist__enable(evlist);
 
 	if (forks)
 		perf_evlist__start_workload(evlist);
 
 	if (trace->opts.initial_delay) {
 		usleep(trace->opts.initial_delay * 1000);
-		perf_evlist__enable(evlist);
+		evlist__enable(evlist);
 	}
 
 	trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 ||
tools/perf/tests/backward-ring-buffer.c +1 -1
index 8de2d6ad93ce..f4b45702821d 100644
@@ -68,7 +68,7 @@ static int do_test(struct evlist *evlist, int mmap_pages,
 		return TEST_FAIL;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 	testcase();
 	perf_evlist__disable(evlist);
 
tools/perf/tests/bpf.c +1 -1
index b41c41482283..92fed94f4b6c 100644
@@ -171,7 +171,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 	(*func)();
 	perf_evlist__disable(evlist);
 
tools/perf/tests/code-reading.c +1 -1
index 23abc775a69c..8d38e001160d 100644
@@ -680,7 +680,7 @@ static int do_test_code_reading(bool try_kcore)
 		goto out_put;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	do_something();
 
tools/perf/tests/keep-tracking.c +2 -2
index c55bc062e200..c333b9c765e8 100644
@@ -107,7 +107,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	 * enabled.
 	 */
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	comm = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
@@ -125,7 +125,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	 * disabled with the dummy event still enabled.
 	 */
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	evsel = perf_evlist__last(evlist);
 
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 233447af9d03..c7182b7840e5 100644
@@ -74,7 +74,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/*
 	 * Generate the event:
tools/perf/tests/perf-record.c +1 -1
index f5d1e7f1b58b..67b388e92cba 100644
@@ -153,7 +153,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 	 * Now that all is properly set up, enable the events, they will
 	 * count just on workload.pid, which will start...
 	 */
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/*
 	 * Now!
tools/perf/tests/sw-clock.c +1 -1
index 528a2dff06e0..4ab316c04ce7 100644
@@ -86,7 +86,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/* collect samples */
 	for (i = 0; i < NR_LOOPS; i++)
tools/perf/tests/switch-tracking.c +1 -1
index 47f9895ba807..ea214313f22b 100644
@@ -462,7 +462,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	err = evsel__disable(cpu_clocks_evsel);
 	if (err) {
tools/perf/util/evlist.c +2 -2
index 67c288f467f6..94825c37a35f 100644
@@ -356,7 +356,7 @@ void perf_evlist__disable(struct evlist *evlist)
 	evlist->enabled = false;
 }
 
-void perf_evlist__enable(struct evlist *evlist)
+void evlist__enable(struct evlist *evlist)
 {
 	struct evsel *pos;
 
@@ -371,7 +371,7 @@ void perf_evlist__enable(struct evlist *evlist)
 
 void perf_evlist__toggle_enable(struct evlist *evlist)
 {
-	(evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
+	(evlist->enabled ? perf_evlist__disable : evlist__enable)(evlist);
 }
 
 static int perf_evlist__enable_event_cpu(struct evlist *evlist,
tools/perf/util/evlist.h +1 -1
index 47e9d26b6774..ab48bbfbca41 100644
@@ -185,7 +185,7 @@ void perf_evlist__munmap(struct evlist *evlist);
 size_t perf_evlist__mmap_size(unsigned long pages);
 
 void perf_evlist__disable(struct evlist *evlist);
-void perf_evlist__enable(struct evlist *evlist);
+void evlist__enable(struct evlist *evlist);
 void perf_evlist__toggle_enable(struct evlist *evlist);
 
 int perf_evlist__enable_event_idx(struct evlist *evlist,
Signature · 1 line
2.21.0
#42 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__enable() to evlist__enable()

perf evlist: Rename perf_evlist__enable() to evlist__enable()
Commit-ID:  1c87f1654cc315fbeae0238a8dbf5bf3c498f3af
Gitweb:     https://git.kernel.org/tip/1c87f1654cc315fbeae0238a8dbf5bf3c498f3af
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:08 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__enable() to evlist__enable()

Rename perf_evlist__enable() to evlist__enable(), so we don't have a name clash when we add perf_evlist__enable() in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 4 ++--
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-top.c                     | 2 +-
 tools/perf/builtin-trace.c                   | 4 ++--
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 4 ++--
 tools/perf/tests/openat-syscall-tp-fields.c  | 2 +-
 tools/perf/tests/perf-record.c               | 2 +-
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 2 +-
 tools/perf/util/evlist.c                     | 4 ++--
 tools/perf/util/evlist.h                     | 2 +-
 16 files changed, 20 insertions(+), 20 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index ea4cf1d367a6..aa5a5c972ce5 100644
@@ -97,7 +97,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 		goto out_err;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	comm1 = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm1, 0, 0, 0));
tools/perf/builtin-kvm.c +1 -1
index 6a0573a9c16b..9207bd49583e 100644
@@ -972,7 +972,7 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 		goto out;
 
 	/* everything is good - enable the events and process */
-	perf_evlist__enable(kvm->evlist);
+	evlist__enable(kvm->evlist);
 
 	while (!done) {
 		struct fdarray *fda = &kvm->evlist->pollfd;
tools/perf/builtin-record.c +2 -2
index 7f933997b6d0..8e20ead0ddbe 100644
@@ -1453,7 +1453,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 	 * so don't spoil it by prematurely enabling them.
 	 */
 	if (!target__none(&opts->target) && !opts->initial_delay)
-		perf_evlist__enable(rec->evlist);
+		evlist__enable(rec->evlist);
 
 	/*
 	 * Let the child rip
@@ -1506,7 +1506,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 
 	if (opts->initial_delay) {
 		usleep(opts->initial_delay * USEC_PER_MSEC);
-		perf_evlist__enable(rec->evlist);
+		evlist__enable(rec->evlist);
 	}
 
 	trigger_ready(&auxtrace_snapshot_trigger);
tools/perf/builtin-stat.c +1 -1
index bdfe138f7aed..c0e9d94b6dd5 100644
@@ -362,7 +362,7 @@ static void enable_counters(void)
 	 * - we have initial delay configured
 	 */
 	if (!target__none(&target) || stat_config.initial_delay)
-		perf_evlist__enable(evsel_list);
+		evlist__enable(evsel_list);
 }
 
 static void disable_counters(void)
tools/perf/builtin-top.c +1 -1
index 5886389f6a40..b103f1ba01cb 100644
@@ -1255,7 +1255,7 @@ static int __cmd_top(struct perf_top *top)
 	 * so leave the check here.
 	 */
         if (!target__none(&opts->target))
-                perf_evlist__enable(top->evlist);
+		evlist__enable(top->evlist);
 
 	ret = -1;
 	if (pthread_create(&thread_process, NULL, process_thread, top)) {
tools/perf/builtin-trace.c +2 -2
index e508fdb77099..46fab1ff92dc 100644
@@ -3402,14 +3402,14 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 		goto out_error_mmap;
 
 	if (!target__none(&trace->opts.target) && !trace->opts.initial_delay)
-		perf_evlist__enable(evlist);
+		evlist__enable(evlist);
 
 	if (forks)
 		perf_evlist__start_workload(evlist);
 
 	if (trace->opts.initial_delay) {
 		usleep(trace->opts.initial_delay * 1000);
-		perf_evlist__enable(evlist);
+		evlist__enable(evlist);
 	}
 
 	trace->multiple_threads = thread_map__pid(evlist->threads, 0) == -1 ||
tools/perf/tests/backward-ring-buffer.c +1 -1
index 8de2d6ad93ce..f4b45702821d 100644
@@ -68,7 +68,7 @@ static int do_test(struct evlist *evlist, int mmap_pages,
 		return TEST_FAIL;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 	testcase();
 	perf_evlist__disable(evlist);
 
tools/perf/tests/bpf.c +1 -1
index b41c41482283..92fed94f4b6c 100644
@@ -171,7 +171,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 	(*func)();
 	perf_evlist__disable(evlist);
 
tools/perf/tests/code-reading.c +1 -1
index 23abc775a69c..8d38e001160d 100644
@@ -680,7 +680,7 @@ static int do_test_code_reading(bool try_kcore)
 		goto out_put;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	do_something();
 
tools/perf/tests/keep-tracking.c +2 -2
index c55bc062e200..c333b9c765e8 100644
@@ -107,7 +107,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	 * enabled.
 	 */
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	comm = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
@@ -125,7 +125,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	 * disabled with the dummy event still enabled.
 	 */
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	evsel = perf_evlist__last(evlist);
 
tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index 233447af9d03..c7182b7840e5 100644
@@ -74,7 +74,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/*
 	 * Generate the event:
tools/perf/tests/perf-record.c +1 -1
index f5d1e7f1b58b..67b388e92cba 100644
@@ -153,7 +153,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 	 * Now that all is properly set up, enable the events, they will
 	 * count just on workload.pid, which will start...
 	 */
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/*
 	 * Now!
tools/perf/tests/sw-clock.c +1 -1
index 528a2dff06e0..4ab316c04ce7 100644
@@ -86,7 +86,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		goto out_delete_evlist;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	/* collect samples */
 	for (i = 0; i < NR_LOOPS; i++)
tools/perf/tests/switch-tracking.c +1 -1
index 47f9895ba807..ea214313f22b 100644
@@ -462,7 +462,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	perf_evlist__enable(evlist);
+	evlist__enable(evlist);
 
 	err = evsel__disable(cpu_clocks_evsel);
 	if (err) {
tools/perf/util/evlist.c +2 -2
index 67c288f467f6..94825c37a35f 100644
@@ -356,7 +356,7 @@ void perf_evlist__disable(struct evlist *evlist)
 	evlist->enabled = false;
 }
 
-void perf_evlist__enable(struct evlist *evlist)
+void evlist__enable(struct evlist *evlist)
 {
 	struct evsel *pos;
 
@@ -371,7 +371,7 @@ void perf_evlist__enable(struct evlist *evlist)
 
 void perf_evlist__toggle_enable(struct evlist *evlist)
 {
-	(evlist->enabled ? perf_evlist__disable : perf_evlist__enable)(evlist);
+	(evlist->enabled ? perf_evlist__disable : evlist__enable)(evlist);
 }
 
 static int perf_evlist__enable_event_cpu(struct evlist *evlist,
tools/perf/util/evlist.h +1 -1
index 47e9d26b6774..ab48bbfbca41 100644
@@ -185,7 +185,7 @@ void perf_evlist__munmap(struct evlist *evlist);
 size_t perf_evlist__mmap_size(unsigned long pages);
 
 void perf_evlist__disable(struct evlist *evlist);
-void perf_evlist__enable(struct evlist *evlist);
+void evlist__enable(struct evlist *evlist);
 void perf_evlist__toggle_enable(struct evlist *evlist);
 
 int perf_evlist__enable_event_idx(struct evlist *evlist,
author reviewer
#43 lore raw

PATCH 22/79 perf tools: Rename perf_evlist__disable to evlist__disable

In reply to Jiri Olsa

Renaming perf_evlist__disable to evlist__disable, so we don't have a name clash when we add perf_evlist__disable in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 2 +-
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-trace.c                   | 4 ++--
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 6 +++---
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 4 ++--
 tools/perf/util/evlist.c                     | 4 ++--
 tools/perf/util/evlist.h                     | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index aa5a5c972ce5..8b70e9ee341a 100644
@@ -107,7 +107,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	comm2 = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm2, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	for (i = 0; i < evlist->nr_mmaps; i++) {
 		md = &evlist->mmap[i];
tools/perf/builtin-kvm.c +1 -1
index 9207bd49583e..3370eba0d3f3 100644
@@ -993,7 +993,7 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 			err = fdarray__poll(fda, 100);
 	}
 
-	perf_evlist__disable(kvm->evlist);
+	evlist__disable(kvm->evlist);
 
 	if (err == 0) {
 		sort_result(kvm);
tools/perf/builtin-record.c +1 -1
index 8e20ead0ddbe..c0962ddfad04 100644
@@ -1605,7 +1605,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		 */
 		if (done && !disabled && !target__none(&opts->target)) {
 			trigger_off(&auxtrace_snapshot_trigger);
-			perf_evlist__disable(rec->evlist);
+			evlist__disable(rec->evlist);
 			disabled = true;
 		}
 	}
tools/perf/builtin-stat.c +1 -1
index c0e9d94b6dd5..36e66a4f3c57 100644
@@ -373,7 +373,7 @@ static void disable_counters(void)
 	 * from counting before reading their constituent counters.
 	 */
 	if (!target__none(&target))
-		perf_evlist__disable(evsel_list);
+		evlist__disable(evsel_list);
 }
 
 static volatile int workload_exec_errno;
tools/perf/builtin-trace.c +2 -2
index b0e840a6906b..0fa6f0530d0f 100644
@@ -3450,7 +3450,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 				goto out_disable;
 
 			if (done && !draining) {
-				perf_evlist__disable(evlist);
+				evlist__disable(evlist);
 				draining = true;
 			}
 		}
@@ -3476,7 +3476,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 out_disable:
 	thread__zput(trace->current);
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	if (trace->sort_events)
 		ordered_events__flush(&trace->oe.data, OE_FLUSH__FINAL);
tools/perf/tests/backward-ring-buffer.c +1 -1
index f4b45702821d..9bdf66139099 100644
@@ -70,7 +70,7 @@ static int do_test(struct evlist *evlist, int mmap_pages,
 
 	evlist__enable(evlist);
 	testcase();
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	err = count_samples(evlist, sample_count, comm_count);
 	perf_evlist__munmap(evlist);
tools/perf/tests/bpf.c +1 -1
index 92fed94f4b6c..e16f927f38b6 100644
@@ -173,7 +173,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 
 	evlist__enable(evlist);
 	(*func)();
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	for (i = 0; i < evlist->nr_mmaps; i++) {
 		union perf_event *event;
tools/perf/tests/code-reading.c +1 -1
index 8d38e001160d..ec4b0bf28270 100644
@@ -684,7 +684,7 @@ static int do_test_code_reading(bool try_kcore)
 
 	do_something();
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	ret = process_events(machine, evlist, &state);
 	if (ret < 0)
tools/perf/tests/keep-tracking.c +3 -3
index c333b9c765e8..7bfc859971e5 100644
@@ -112,7 +112,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	comm = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	found = find_comm(evlist, comm);
 	if (found != 1) {
@@ -134,7 +134,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	found = find_comm(evlist, comm);
 	if (found != 1) {
@@ -146,7 +146,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 
 out_err:
 	if (evlist) {
-		perf_evlist__disable(evlist);
+		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
tools/perf/tests/sw-clock.c +1 -1
index 4ab316c04ce7..ba033a6e6c0f 100644
@@ -92,7 +92,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	for (i = 0; i < NR_LOOPS; i++)
 		tmp++;
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	md = &evlist->mmap[0];
 	if (perf_mmap__read_init(md) < 0)
tools/perf/tests/switch-tracking.c +2 -2
index ea214313f22b..d5537edb47db 100644
@@ -528,7 +528,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	switch_tracking.switch_evsel = switch_evsel;
 	switch_tracking.cycles_evsel = cycles_evsel;
@@ -566,7 +566,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 	}
 out:
 	if (evlist) {
-		perf_evlist__disable(evlist);
+		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
tools/perf/util/evlist.c +2 -2
index 94825c37a35f..1bedec28e58f 100644
@@ -343,7 +343,7 @@ static int perf_evlist__nr_threads(struct evlist *evlist,
 		return thread_map__nr(evlist->threads);
 }
 
-void perf_evlist__disable(struct evlist *evlist)
+void evlist__disable(struct evlist *evlist)
 {
 	struct evsel *pos;
 
@@ -371,7 +371,7 @@ void evlist__enable(struct evlist *evlist)
 
 void perf_evlist__toggle_enable(struct evlist *evlist)
 {
-	(evlist->enabled ? perf_evlist__disable : evlist__enable)(evlist);
+	(evlist->enabled ? evlist__disable : evlist__enable)(evlist);
 }
 
 static int perf_evlist__enable_event_cpu(struct evlist *evlist,
tools/perf/util/evlist.h +1 -1
index ab48bbfbca41..99621c056d09 100644
@@ -184,7 +184,7 @@ void perf_evlist__munmap(struct evlist *evlist);
 
 size_t perf_evlist__mmap_size(unsigned long pages);
 
-void perf_evlist__disable(struct evlist *evlist);
+void evlist__disable(struct evlist *evlist);
 void evlist__enable(struct evlist *evlist);
 void perf_evlist__toggle_enable(struct evlist *evlist);
 
Signature · 1 line
2.21.0
#44 lore raw

[tip:perf/core] perf evlist: Rename perf_evlist__disable() to evlist__disable()

perf evlist: Rename perf_evlist__disable() to evlist__disable()
Commit-ID:  e74676debaae7dcce20a34817ef145478887ba95
Gitweb:     https://git.kernel.org/tip/e74676debaae7dcce20a34817ef145478887ba95
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:09 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

perf evlist: Rename perf_evlist__disable() to evlist__disable()

Rename perf_evlist__disable() to evlist__disable(), so we don't have a name clash when we add perf_evlist__disable() in libperf.

---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
 tools/perf/builtin-kvm.c                     | 2 +-
 tools/perf/builtin-record.c                  | 2 +-
 tools/perf/builtin-stat.c                    | 2 +-
 tools/perf/builtin-trace.c                   | 4 ++--
 tools/perf/tests/backward-ring-buffer.c      | 2 +-
 tools/perf/tests/bpf.c                       | 2 +-
 tools/perf/tests/code-reading.c              | 2 +-
 tools/perf/tests/keep-tracking.c             | 6 +++---
 tools/perf/tests/sw-clock.c                  | 2 +-
 tools/perf/tests/switch-tracking.c           | 4 ++--
 tools/perf/util/evlist.c                     | 4 ++--
 tools/perf/util/evlist.h                     | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)
tools/perf/arch/x86/tests/perf-time-to-tsc.c +1 -1
index aa5a5c972ce5..8b70e9ee341a 100644
@@ -107,7 +107,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 	comm2 = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm2, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	for (i = 0; i < evlist->nr_mmaps; i++) {
 		md = &evlist->mmap[i];
tools/perf/builtin-kvm.c +1 -1
index 9207bd49583e..3370eba0d3f3 100644
@@ -993,7 +993,7 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm)
 			err = fdarray__poll(fda, 100);
 	}
 
-	perf_evlist__disable(kvm->evlist);
+	evlist__disable(kvm->evlist);
 
 	if (err == 0) {
 		sort_result(kvm);
tools/perf/builtin-record.c +1 -1
index 8e20ead0ddbe..c0962ddfad04 100644
@@ -1605,7 +1605,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		 */
 		if (done && !disabled && !target__none(&opts->target)) {
 			trigger_off(&auxtrace_snapshot_trigger);
-			perf_evlist__disable(rec->evlist);
+			evlist__disable(rec->evlist);
 			disabled = true;
 		}
 	}
tools/perf/builtin-stat.c +1 -1
index c0e9d94b6dd5..36e66a4f3c57 100644
@@ -373,7 +373,7 @@ static void disable_counters(void)
 	 * from counting before reading their constituent counters.
 	 */
 	if (!target__none(&target))
-		perf_evlist__disable(evsel_list);
+		evlist__disable(evsel_list);
 }
 
 static volatile int workload_exec_errno;
tools/perf/builtin-trace.c +2 -2
index 46fab1ff92dc..51d142594a12 100644
@@ -3451,7 +3451,7 @@ again:
 				goto out_disable;
 
 			if (done && !draining) {
-				perf_evlist__disable(evlist);
+				evlist__disable(evlist);
 				draining = true;
 			}
 		}
@@ -3477,7 +3477,7 @@ again:
 out_disable:
 	thread__zput(trace->current);
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	if (trace->sort_events)
 		ordered_events__flush(&trace->oe.data, OE_FLUSH__FINAL);
tools/perf/tests/backward-ring-buffer.c +1 -1
index f4b45702821d..9bdf66139099 100644
@@ -70,7 +70,7 @@ static int do_test(struct evlist *evlist, int mmap_pages,
 
 	evlist__enable(evlist);
 	testcase();
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	err = count_samples(evlist, sample_count, comm_count);
 	perf_evlist__munmap(evlist);
tools/perf/tests/bpf.c +1 -1
index 92fed94f4b6c..e16f927f38b6 100644
@@ -173,7 +173,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
 
 	evlist__enable(evlist);
 	(*func)();
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	for (i = 0; i < evlist->nr_mmaps; i++) {
 		union perf_event *event;
tools/perf/tests/code-reading.c +1 -1
index 8d38e001160d..ec4b0bf28270 100644
@@ -684,7 +684,7 @@ static int do_test_code_reading(bool try_kcore)
 
 	do_something();
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	ret = process_events(machine, evlist, &state);
 	if (ret < 0)
tools/perf/tests/keep-tracking.c +3 -3
index c333b9c765e8..7bfc859971e5 100644
@@ -112,7 +112,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	comm = "Test COMM 1";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	found = find_comm(evlist, comm);
 	if (found != 1) {
@@ -134,7 +134,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 	comm = "Test COMM 2";
 	CHECK__(prctl(PR_SET_NAME, (unsigned long)comm, 0, 0, 0));
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	found = find_comm(evlist, comm);
 	if (found != 1) {
@@ -146,7 +146,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 
 out_err:
 	if (evlist) {
-		perf_evlist__disable(evlist);
+		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
tools/perf/tests/sw-clock.c +1 -1
index 4ab316c04ce7..ba033a6e6c0f 100644
@@ -92,7 +92,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	for (i = 0; i < NR_LOOPS; i++)
 		tmp++;
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	md = &evlist->mmap[0];
 	if (perf_mmap__read_init(md) < 0)
tools/perf/tests/switch-tracking.c +2 -2
index ea214313f22b..d5537edb47db 100644
@@ -528,7 +528,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		goto out_err;
 	}
 
-	perf_evlist__disable(evlist);
+	evlist__disable(evlist);
 
 	switch_tracking.switch_evsel = switch_evsel;
 	switch_tracking.cycles_evsel = cycles_evsel;
@@ -566,7 +566,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 	}
 out:
 	if (evlist) {
-		perf_evlist__disable(evlist);
+		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
 		cpu_map__put(cpus);
tools/perf/util/evlist.c +2 -2
index 94825c37a35f..1bedec28e58f 100644
@@ -343,7 +343,7 @@ static int perf_evlist__nr_threads(struct evlist *evlist,
 		return thread_map__nr(evlist->threads);
 }
 
-void perf_evlist__disable(struct evlist *evlist)
+void evlist__disable(struct evlist *evlist)
 {
 	struct evsel *pos;
 
@@ -371,7 +371,7 @@ void evlist__enable(struct evlist *evlist)
 
 void perf_evlist__toggle_enable(struct evlist *evlist)
 {
-	(evlist->enabled ? perf_evlist__disable : evlist__enable)(evlist);
+	(evlist->enabled ? evlist__disable : evlist__enable)(evlist);
 }
 
 static int perf_evlist__enable_event_cpu(struct evlist *evlist,
tools/perf/util/evlist.h +1 -1
index ab48bbfbca41..99621c056d09 100644
@@ -184,7 +184,7 @@ void perf_evlist__munmap(struct evlist *evlist);
 
 size_t perf_evlist__mmap_size(unsigned long pages);
 
-void perf_evlist__disable(struct evlist *evlist);
+void evlist__disable(struct evlist *evlist);
 void evlist__enable(struct evlist *evlist);
 void perf_evlist__toggle_enable(struct evlist *evlist);
 
author reviewer
#45 lore raw

PATCH 23/79 libperf: Make libperf.a part of the build

In reply to Jiri Olsa

Adding empty libperf.a under toos/perf/lib and
linking it with perf.

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so
---
 tools/perf/Makefile.config |  1 +
 tools/perf/Makefile.perf   | 30 ++++++++--------
 tools/perf/lib/Build       |  1 +
 tools/perf/lib/Makefile    | 74 ++++++++++++++++++++++++++++++++++++++
 tools/perf/lib/core.c      |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 tools/perf/lib/Build
 create mode 100644 tools/perf/lib/Makefile
 create mode 100644 tools/perf/lib/core.c
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0

74 lines not on this page · raw message

tools/perf/lib/core.c new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
Signature · 1 line
2.21.0
#46 lore raw

Re: [PATCH 23/79] libperf: Make libperf.a part of the build

Em Sun, Jul 21, 2019 at 01:24:10PM +0200, Jiri Olsa escreveu:

Quoted 2 lines

Adding empty libperf.a under toos/perf/lib and
linking it with perf.

So, I noticed you created a subdirectory under tools/perf/, while I first thought you would have it in tools/lib/perf/, why not move it there?

- Arnaldo

Quoted 230 lines

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so
---
 tools/perf/Makefile.config |  1 +
 tools/perf/Makefile.perf   | 30 ++++++++--------
 tools/perf/lib/Build       |  1 +
 tools/perf/lib/Makefile    | 74 ++++++++++++++++++++++++++++++++++++++
 tools/perf/lib/core.c      |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 tools/perf/lib/Build
 create mode 100644 tools/perf/lib/Makefile
 create mode 100644 tools/perf/lib/core.c
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0
new file mode 100644
index 000000000000..e6f2eb702aaa
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
+# Most of this file is copied from tools/lib/bpf/Makefile
+
+MAKEFLAGS += --no-print-directory
+
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(CURDIR)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
+include $(srctree)/tools/scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.arch
+
+ifeq ("$(origin V)", "command line")
+  VERBOSE = $(V)
+endif
+ifndef VERBOSE
+  VERBOSE = 0
+endif
+
+ifeq ($(VERBOSE),1)
+  Q =
+else
+  Q = @
+endif
+
+# Set compile option CFLAGS
+ifdef EXTRA_CFLAGS
+  CFLAGS := $(EXTRA_CFLAGS)
+else
+  CFLAGS := -g -Wall
+endif
+
+INCLUDES = -I. -Iinclude -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/
+
+# Append required CFLAGS
+override CFLAGS += $(EXTRA_WARNINGS)
+override CFLAGS += -Werror -Wall
+override CFLAGS += -fPIC
+override CFLAGS += $(INCLUDES)
+override CFLAGS += -fvisibility=hidden
+
+all:
+
+export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
+
+LIBPERF_SO := $(OUTPUT)libperf.so
+LIBPERF_A  := $(OUTPUT)libperf.a
+LIBPERF_IN := $(OUTPUT)libperf-in.o
+
+$(LIBPERF_IN): FORCE
+	$(Q)$(MAKE) $(build)=libperf
+
+$(LIBPERF_A): $(LIBPERF_IN)
+	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
+
+$(LIBPERF_SO): $(LIBPERF_IN)
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+
+libs: $(LIBPERF_A) $(LIBPERF_SO)
+
+all: fixdep
+	$(Q)$(MAKE) libs
+
+clean:
+	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
+                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+
+FORCE:
+
+.PHONY: all install clean FORCE
tools/perf/lib/core.c new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
Signature · 1 line
2.21.0
Signature · 1 line
- Arnaldo
#47 lore raw

Re: [PATCH 23/79] libperf: Make libperf.a part of the build

Quoted 7 lines · Arnaldo Carvalho de Melo

Em Sun, Jul 21, 2019 at 01:24:10PM +0200, Jiri Olsa escreveu:

Quoted 2 lines

Adding empty libperf.a under toos/perf/lib and
linking it with perf.

So, I noticed you created a subdirectory under tools/perf/, while I first thought you would have it in tools/lib/perf/, why not move it there?

yea I started like this, and then there was only one reason I could think of ;-) I mentioned it in the cover letter:
- move under tools/lib after the interface is more stable-ish

if you insist to move it there now, would it be ok to make it under separate patch afterwards? it would safe me zillions of small changes ;-)

thanks,
jirka

Quoted 237 lines

- Arnaldo

Quoted 230 lines

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so
---
 tools/perf/Makefile.config |  1 +
 tools/perf/Makefile.perf   | 30 ++++++++--------
 tools/perf/lib/Build       |  1 +
 tools/perf/lib/Makefile    | 74 ++++++++++++++++++++++++++++++++++++++
 tools/perf/lib/core.c      |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 tools/perf/lib/Build
 create mode 100644 tools/perf/lib/Makefile
 create mode 100644 tools/perf/lib/core.c
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0
new file mode 100644
index 000000000000..e6f2eb702aaa
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
+# Most of this file is copied from tools/lib/bpf/Makefile
+
+MAKEFLAGS += --no-print-directory
+
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(CURDIR)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
+include $(srctree)/tools/scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.arch
+
+ifeq ("$(origin V)", "command line")
+  VERBOSE = $(V)
+endif
+ifndef VERBOSE
+  VERBOSE = 0
+endif
+
+ifeq ($(VERBOSE),1)
+  Q =
+else
+  Q = @
+endif
+
+# Set compile option CFLAGS
+ifdef EXTRA_CFLAGS
+  CFLAGS := $(EXTRA_CFLAGS)
+else
+  CFLAGS := -g -Wall
+endif
+
+INCLUDES = -I. -Iinclude -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/
+
+# Append required CFLAGS
+override CFLAGS += $(EXTRA_WARNINGS)
+override CFLAGS += -Werror -Wall
+override CFLAGS += -fPIC
+override CFLAGS += $(INCLUDES)
+override CFLAGS += -fvisibility=hidden
+
+all:
+
+export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
+
+LIBPERF_SO := $(OUTPUT)libperf.so
+LIBPERF_A  := $(OUTPUT)libperf.a
+LIBPERF_IN := $(OUTPUT)libperf-in.o
+
+$(LIBPERF_IN): FORCE
+	$(Q)$(MAKE) $(build)=libperf
+
+$(LIBPERF_A): $(LIBPERF_IN)
+	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
+
+$(LIBPERF_SO): $(LIBPERF_IN)
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+
+libs: $(LIBPERF_A) $(LIBPERF_SO)
+
+all: fixdep
+	$(Q)$(MAKE) libs
+
+clean:
+	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
+                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+
+FORCE:
+
+.PHONY: all install clean FORCE
tools/perf/lib/core.c new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
Signature · 1 line
2.21.0
Signature · 1 line
- Arnaldo
#48 lore raw

Re: [PATCH 23/79] libperf: Make libperf.a part of the build

Em Mon, Jul 22, 2019 at 05:54:17PM +0200, Jiri Olsa escreveu:

Quoted 9 lines · Arnaldo Carvalho de Melo
Quoted 7 lines

Em Sun, Jul 21, 2019 at 01:24:10PM +0200, Jiri Olsa escreveu:

Quoted 2 lines

Adding empty libperf.a under toos/perf/lib and
linking it with perf.

So, I noticed you created a subdirectory under tools/perf/, while I first thought you would have it in tools/lib/perf/, why not move it there?

Quoted 7 lines

yea I started like this, and then there was only one reason I could think of ;-) I mentioned it in the cover letter:
- move under tools/lib after the interface is more stable-ish

if you insist to move it there now, would it be ok to make it under separate patch afterwards? it would safe me zillions of small changes ;-)

Humm, moving it after will be just a git rename, its ok.

- Arnaldo

Quoted 240 lines

thanks,
jirka

Quoted 237 lines

- Arnaldo

Quoted 230 lines

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so
---
 tools/perf/Makefile.config |  1 +
 tools/perf/Makefile.perf   | 30 ++++++++--------
 tools/perf/lib/Build       |  1 +
 tools/perf/lib/Makefile    | 74 ++++++++++++++++++++++++++++++++++++++
 tools/perf/lib/core.c      |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 tools/perf/lib/Build
 create mode 100644 tools/perf/lib/Makefile
 create mode 100644 tools/perf/lib/core.c
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0
new file mode 100644
index 000000000000..e6f2eb702aaa
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
+# Most of this file is copied from tools/lib/bpf/Makefile
+
+MAKEFLAGS += --no-print-directory
+
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(CURDIR)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
+include $(srctree)/tools/scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.arch
+
+ifeq ("$(origin V)", "command line")
+  VERBOSE = $(V)
+endif
+ifndef VERBOSE
+  VERBOSE = 0
+endif
+
+ifeq ($(VERBOSE),1)
+  Q =
+else
+  Q = @
+endif
+
+# Set compile option CFLAGS
+ifdef EXTRA_CFLAGS
+  CFLAGS := $(EXTRA_CFLAGS)
+else
+  CFLAGS := -g -Wall
+endif
+
+INCLUDES = -I. -Iinclude -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/
+
+# Append required CFLAGS
+override CFLAGS += $(EXTRA_WARNINGS)
+override CFLAGS += -Werror -Wall
+override CFLAGS += -fPIC
+override CFLAGS += $(INCLUDES)
+override CFLAGS += -fvisibility=hidden
+
+all:
+
+export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
+
+LIBPERF_SO := $(OUTPUT)libperf.so
+LIBPERF_A  := $(OUTPUT)libperf.a
+LIBPERF_IN := $(OUTPUT)libperf-in.o
+
+$(LIBPERF_IN): FORCE
+	$(Q)$(MAKE) $(build)=libperf
+
+$(LIBPERF_A): $(LIBPERF_IN)
+	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
+
+$(LIBPERF_SO): $(LIBPERF_IN)
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+
+libs: $(LIBPERF_A) $(LIBPERF_SO)
+
+all: fixdep
+	$(Q)$(MAKE) libs
+
+clean:
+	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
+                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+
+FORCE:
+
+.PHONY: all install clean FORCE
tools/perf/lib/core.c new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
Signature · 1 line
2.21.0
Signature · 1 line
- Arnaldo
Signature · 1 line
- Arnaldo
#49 lore raw

Re: [PATCH 23/79] libperf: Make libperf.a part of the build

In reply to Jiri Olsa

Em Sun, Jul 21, 2019 at 01:24:10PM +0200, Jiri Olsa escreveu:

Quoted 10 lines

Adding empty libperf.a under toos/perf/lib and
linking it with perf.

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so

Committer notes:

Need to add -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi to tools/perf/lib/Makefile's INCLUDE variable to pick up the latest versions of kernel headers, even in older systems, this is in line with what is in tools/lib/bpf/Makefile.

I.e. this patch:

[acme@quaco perf]$ git diff

tools/perf/lib/Makefile +1 -1
index e6f2eb702aaa..33046e7c6a2a 100644
@@ -33,7 +33,7 @@ else
   CFLAGS := -g -Wall
 endif
 
-INCLUDES = -I. -Iinclude -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/ -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)

[acme@quaco perf]$

- Arnaldo

Quoted 222 lines
---
 tools/perf/Makefile.config |  1 +
 tools/perf/Makefile.perf   | 30 ++++++++--------
 tools/perf/lib/Build       |  1 +
 tools/perf/lib/Makefile    | 74 ++++++++++++++++++++++++++++++++++++++
 tools/perf/lib/core.c      |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 tools/perf/lib/Build
 create mode 100644 tools/perf/lib/Makefile
 create mode 100644 tools/perf/lib/core.c
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0
new file mode 100644
index 000000000000..e6f2eb702aaa
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
+# Most of this file is copied from tools/lib/bpf/Makefile
+
+MAKEFLAGS += --no-print-directory
+
+ifeq ($(srctree),)
+srctree := $(patsubst %/,%,$(dir $(CURDIR)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+srctree := $(patsubst %/,%,$(dir $(srctree)))
+#$(info Determined 'srctree' to be $(srctree))
+endif
+
+include $(srctree)/tools/scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.arch
+
+ifeq ("$(origin V)", "command line")
+  VERBOSE = $(V)
+endif
+ifndef VERBOSE
+  VERBOSE = 0
+endif
+
+ifeq ($(VERBOSE),1)
+  Q =
+else
+  Q = @
+endif
+
+# Set compile option CFLAGS
+ifdef EXTRA_CFLAGS
+  CFLAGS := $(EXTRA_CFLAGS)
+else
+  CFLAGS := -g -Wall
+endif
+
+INCLUDES = -I. -Iinclude -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/
+
+# Append required CFLAGS
+override CFLAGS += $(EXTRA_WARNINGS)
+override CFLAGS += -Werror -Wall
+override CFLAGS += -fPIC
+override CFLAGS += $(INCLUDES)
+override CFLAGS += -fvisibility=hidden
+
+all:
+
+export srctree OUTPUT CC LD CFLAGS V
+include $(srctree)/tools/build/Makefile.include
+
+LIBPERF_SO := $(OUTPUT)libperf.so
+LIBPERF_A  := $(OUTPUT)libperf.a
+LIBPERF_IN := $(OUTPUT)libperf-in.o
+
+$(LIBPERF_IN): FORCE
+	$(Q)$(MAKE) $(build)=libperf
+
+$(LIBPERF_A): $(LIBPERF_IN)
+	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
+
+$(LIBPERF_SO): $(LIBPERF_IN)
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+
+libs: $(LIBPERF_A) $(LIBPERF_SO)
+
+all: fixdep
+	$(Q)$(MAKE) libs
+
+clean:
+	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
+                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+
+FORCE:
+
+.PHONY: all install clean FORCE
tools/perf/lib/core.c new file +0 -0
new file mode 100644
index 000000000000..e69de29bb2d1
Signature · 1 line
2.21.0
Signature · 1 line
- Arnaldo
#50 lore raw

[tip:perf/core] libperf: Make libperf.a part of the perf build

In reply to Jiri Olsa
libperf: Make libperf.a part of the perf build
Commit-ID:  3143504918105156d03e8f927e127f7b9ea260d2
Gitweb:     https://git.kernel.org/tip/3143504918105156d03e8f927e127f7b9ea260d2
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:10 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

libperf: Make libperf.a part of the perf build

Add an empty libperf.a under tools/perf/lib and link it with perf.

It can also be built separately with:

  $ cd tools/perf/lib && make
    CC       core.o
    LD       libperf-in.o
    AR       libperf.a
    LINK     libperf.so

Committer testing:

  $ make O=/tmp/build/perf -C tools/perf/lib/
  make: Entering directory '/home/acme/git/perf/tools/perf/lib'
    LINK     /tmp/build/perf/libperf.so
  make: Leaving directory '/home/acme/git/perf/tools/perf/lib'
  $ ls -la /tmp/build/perf/libperf.so
  -rwxrwxr-x. 1 acme acme 16232 Jul 22 15:30 /tmp/build/perf/libperf.so
  $ file /tmp/build/perf/libperf.so
  /tmp/build/perf/libperf.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=7a51d227d871b381ddb686dcf94145c4dd908221, not stripped
  $ git status tools/perf
  On branch perf/core
  nothing to commit, working tree clean
  $
  $ ls -lart tools/perf/lib/
  total 16
  drwxrwxr-x. 16 acme acme 4096 Jul 22 15:29 ..
  -rw-rw-r--.  1 acme acme 1633 Jul 22 15:29 Makefile
  -rw-rw-r--.  1 acme acme    0 Jul 22 15:29 core.c
  -rw-rw-r--.  1 acme acme   20 Jul 22 15:29 Build
  drwxrwxr-x.  2 acme acme 4096 Jul 22 15:29 .
  $

Committer notes:

Need to add -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi to tools/perf/lib/Makefile's INCLUDE variable to pick up the latest versions of kernel headers, even in older systems, this is in line with what is in tools/lib/bpf/Makefile.

---
 tools/perf/Makefile.config                         |  1 +
 tools/perf/Makefile.perf                           | 30 +++++----
 tools/perf/lib/Build                               |  1 +
 tools/perf/lib/Makefile                            | 74 ++++++++++++++++++++++
 .../Makefile.boot => tools/perf/lib/core.c         |  0
 5 files changed, 92 insertions(+), 14 deletions(-)
tools/perf/Makefile.config +1 -0
index 89ac5a1f1550..e4988f49ea79 100644
@@ -277,6 +277,7 @@ ifeq ($(DEBUG),0)
   endif
 endif
 
+INC_FLAGS += -I$(src-perf)/lib/include
 INC_FLAGS += -I$(src-perf)/util/include
 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
 INC_FLAGS += -I$(srctree)/tools/include/uapi
tools/perf/Makefile.perf +16 -14
index 0fffd2bb6cd9..6e7e7d44ffac 100644
@@ -224,6 +224,7 @@ LIB_DIR         = $(srctree)/tools/lib/api/
 TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
 BPF_DIR         = $(srctree)/tools/lib/bpf/
 SUBCMD_DIR      = $(srctree)/tools/lib/subcmd/
+LIBPERF_DIR     = $(srctree)/tools/perf/lib/
 
 # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed.
 # Without this setting the output feature dump file misses some features, for
@@ -272,6 +273,7 @@ ifneq ($(OUTPUT),)
   TE_PATH=$(OUTPUT)
   BPF_PATH=$(OUTPUT)
   SUBCMD_PATH=$(OUTPUT)
+  LIBPERF_PATH=$(OUTPUT)
 ifneq ($(subdir),)
   API_PATH=$(OUTPUT)/../lib/api/
 else
@@ -282,6 +284,7 @@ else
   API_PATH=$(LIB_DIR)
   BPF_PATH=$(BPF_DIR)
   SUBCMD_PATH=$(SUBCMD_DIR)
+  LIBPERF_PATH=$(LIBPERF_DIR)
 endif
 
 LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -303,6 +306,8 @@ LIBBPF = $(BPF_PATH)libbpf.a
 
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
+LIBPERF = $(LIBPERF_PATH)libperf.a
+
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
 PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -348,9 +353,7 @@ endif
 
 export PERL_PATH
 
-LIBPERF_A=$(OUTPUT)libperf.a
-
-PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
+PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF)
 ifndef NO_LIBBPF
   PERFLIBS += $(LIBBPF)
 endif
@@ -583,8 +586,6 @@ JEVENTS_IN    := $(OUTPUT)pmu-events/jevents-in.o
 
 PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
 
-LIBPERF_IN := $(OUTPUT)libperf-in.o
-
 export JEVENTS
 
 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -601,12 +602,9 @@ $(JEVENTS): $(JEVENTS_IN)
 $(PMU_EVENTS_IN): $(JEVENTS) FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(LIBPERF_IN): prepare FORCE
-	$(Q)$(MAKE) $(build)=libperf
-
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
-		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@
+		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
@@ -727,9 +725,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-$(LIBPERF_A): $(LIBPERF_IN)
-	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
-
 LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
 
 $(LIBTRACEEVENT): FORCE
@@ -762,6 +757,13 @@ $(LIBBPF)-clean:
 	$(call QUIET_CLEAN, libbpf)
 	$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
 
+$(LIBPERF): FORCE
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a
+
+$(LIBPERF)-clean:
+	$(call QUIET_CLEAN, libperf)
+	$(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null
+
 $(LIBSUBCMD): FORCE
 	$(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a
 
@@ -948,7 +950,7 @@ config-clean:
 python-clean:
 	$(python-clean)
 
-clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean
+clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
 	$(call QUIET_CLEAN, core-objs)  $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
 	$(Q)$(RM) $(OUTPUT).config-detected
tools/perf/lib/Build new file +1 -0
new file mode 100644
index 000000000000..5196958cec01
@@ -0,0 +1 @@
+libperf-y += core.o
tools/perf/lib/Makefile new file +74 -0

74 lines not on this page · raw message

tools/perf/lib/core.c renamed from arch/arm/mach-imx/Makefile.boot +0 -0
similarity index 100%
copy from arch/arm/mach-imx/Makefile.boot
copy to tools/perf/lib/core.c
author reviewer
#51 lore raw

PATCH 24/79 libperf: Add build version support

In reply to Jiri Olsa

Adding shared library version, generating following files:

  $ ll toos/perf/lib/libperf.so*
  libperf.so -> libperf.so.0.0.1
  libperf.so.0 -> libperf.so.0.0.1
  libperf.so.0.0.1
---
 tools/perf/lib/Makefile    | 20 +++++++++++++++++---
 tools/perf/lib/libperf.map |  4 ++++
 2 files changed, 21 insertions(+), 3 deletions(-)
 create mode 100644 tools/perf/lib/libperf.map
tools/perf/lib/Makefile +17 -3
index e6f2eb702aaa..25a6476f8b12 100644
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
 # Most of this file is copied from tools/lib/bpf/Makefile
 
+LIBPERF_VERSION = 0
+LIBPERF_PATCHLEVEL = 0
+LIBPERF_EXTRAVERSION = 1
+
 MAKEFLAGS += --no-print-directory
 
 ifeq ($(srctree),)
@@ -47,7 +51,13 @@ all:
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
-LIBPERF_SO := $(OUTPUT)libperf.so
+VERSION_SCRIPT := libperf.map
+
+PATCHLEVEL    = $(LIBPERF_PATCHLEVEL)
+EXTRAVERSION  = $(LIBPERF_EXTRAVERSION)
+VERSION       = $(LIBPERF_VERSION).$(LIBPERF_PATCHLEVEL).$(LIBPERF_EXTRAVERSION)
+
+LIBPERF_SO := $(OUTPUT)libperf.so.$(VERSION)
 LIBPERF_A  := $(OUTPUT)libperf.a
 LIBPERF_IN := $(OUTPUT)libperf-in.o
 
@@ -58,7 +68,11 @@ $(LIBPERF_A): $(LIBPERF_IN)
 	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
 
 $(LIBPERF_SO): $(LIBPERF_IN)
-	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \
+                                    -Wl,--version-script=$(VERSION_SCRIPT) $^ -o $@
+	@ln -sf $(@F) $(OUTPUT)libperf.so
+	@ln -sf $(@F) $(OUTPUT)libperf.so.$(LIBPERF_VERSION)
+
 
 libs: $(LIBPERF_A) $(LIBPERF_SO)
 
@@ -67,7 +81,7 @@ all: fixdep
 
 clean:
 	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
-                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+                *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd LIBPERF-CFLAGS
 
 FORCE:
 
tools/perf/lib/libperf.map new file +4 -0
new file mode 100644
index 000000000000..a8e913988edf
@@ -0,0 +1,4 @@
+LIBPERF_0.0.1 {
+	local:
+		*;
+};
Signature · 1 line
2.21.0
#52 lore raw

[tip:perf/core] libperf: Add build version support

libperf: Add build version support
Commit-ID:  47f9bccc79cb067103ad5e9790e0d01c94839429
Gitweb:     https://git.kernel.org/tip/47f9bccc79cb067103ad5e9790e0d01c94839429
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:11 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:43 -0300

libperf: Add build version support

Add a shared library version, generating the following files:

  $ ll tools/perf/lib/libperf.so*
  libperf.so -> libperf.so.0.0.1
  libperf.so.0 -> libperf.so.0.0.1
  libperf.so.0.0.1

Committer testing:

One has to build just libbperf to get this, building perf so far doesn't trigger this, i.e. I tried:

  $ make O=/tmp/build/perf -C tools/perf

And the files above were not created, so one has to do:

  $ make O=/tmp/build/perf -C tools/perf/lib/
  make: Entering directory '/home/acme/git/perf/tools/perf/lib'
    LINK     /tmp/build/perf/libperf.so.0.0.1
  make: Leaving directory '/home/acme/git/perf/tools/perf/lib'
  $ ls -la /tmp/build/perf/*.so.*
  lrwxrwxrwx. 1 acme acme    16 Jul 22 15:37 /tmp/build/perf/libperf.so.0 -> libperf.so.0.0.1
  -rwxrwxr-x. 1 acme acme 16368 Jul 22 15:37 /tmp/build/perf/libperf.so.0.0.1
  $
---
 tools/perf/lib/Makefile    | 20 +++++++++++++++++---
 tools/perf/lib/libperf.map |  4 ++++
 2 files changed, 21 insertions(+), 3 deletions(-)
tools/perf/lib/Makefile +17 -3
index 33046e7c6a2a..cd571ec648ad 100644
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
 # Most of this file is copied from tools/lib/bpf/Makefile
 
+LIBPERF_VERSION = 0
+LIBPERF_PATCHLEVEL = 0
+LIBPERF_EXTRAVERSION = 1
+
 MAKEFLAGS += --no-print-directory
 
 ifeq ($(srctree),)
@@ -47,7 +51,13 @@ all:
 export srctree OUTPUT CC LD CFLAGS V
 include $(srctree)/tools/build/Makefile.include
 
-LIBPERF_SO := $(OUTPUT)libperf.so
+VERSION_SCRIPT := libperf.map
+
+PATCHLEVEL    = $(LIBPERF_PATCHLEVEL)
+EXTRAVERSION  = $(LIBPERF_EXTRAVERSION)
+VERSION       = $(LIBPERF_VERSION).$(LIBPERF_PATCHLEVEL).$(LIBPERF_EXTRAVERSION)
+
+LIBPERF_SO := $(OUTPUT)libperf.so.$(VERSION)
 LIBPERF_A  := $(OUTPUT)libperf.a
 LIBPERF_IN := $(OUTPUT)libperf-in.o
 
@@ -58,7 +68,11 @@ $(LIBPERF_A): $(LIBPERF_IN)
 	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN)
 
 $(LIBPERF_SO): $(LIBPERF_IN)
-	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so $^ -o $@
+	$(QUIET_LINK)$(CC) --shared -Wl,-soname,libperf.so \
+                                    -Wl,--version-script=$(VERSION_SCRIPT) $^ -o $@
+	@ln -sf $(@F) $(OUTPUT)libperf.so
+	@ln -sf $(@F) $(OUTPUT)libperf.so.$(LIBPERF_VERSION)
+
 
 libs: $(LIBPERF_A) $(LIBPERF_SO)
 
@@ -67,7 +81,7 @@ all: fixdep
 
 clean:
 	$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
-                *.o *~ *.a *.so .*.d .*.cmd LIBPERF-CFLAGS
+                *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd LIBPERF-CFLAGS
 
 FORCE:
 
tools/perf/lib/libperf.map new file +4 -0
new file mode 100644
index 000000000000..a8e913988edf
@@ -0,0 +1,4 @@
+LIBPERF_0.0.1 {
+	local:
+		*;
+};
author reviewer
#53 lore raw

PATCH 25/79 libperf: Add libperf in python.so compilation

In reply to Jiri Olsa

Link libperf.a with python.so.

---
 tools/perf/Makefile.perf | 1 +
 tools/perf/util/setup.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
tools/perf/Makefile.perf +1 -0
index 6e7e7d44ffac..67512a12276b 100644
@@ -307,6 +307,7 @@ LIBBPF = $(BPF_PATH)libbpf.a
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
 LIBPERF = $(LIBPERF_PATH)libperf.a
+export LIBPERF
 
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
tools/perf/util/setup.py +2 -1
index a1a68a2fa917..d48f9cd58964 100644
@@ -48,6 +48,7 @@ build_lib = getenv('PYTHON_EXTBUILD_LIB')
 build_tmp = getenv('PYTHON_EXTBUILD_TMP')
 libtraceevent = getenv('LIBTRACEEVENT')
 libapikfs = getenv('LIBAPI')
+libperf = getenv('LIBPERF')
 
 ext_sources = [f.strip() for f in open('util/python-ext-sources')
 				if len(f.strip()) > 0 and f[0] != '#']
@@ -64,7 +65,7 @@ perf = Extension('perf',
 		  include_dirs = ['util/include'],
 		  libraries = extra_libraries,
 		  extra_compile_args = cflags,
-		  extra_objects = [libtraceevent, libapikfs],
+		  extra_objects = [libtraceevent, libapikfs, libperf],
                  )
 
 setup(name='perf',
Signature · 1 line
2.21.0
#54 lore raw

[tip:perf/core] libperf: Add libperf to the python.so build

libperf: Add libperf to the python.so build
Commit-ID:  a429dcb8feb60b8500fed81e2275c1944e3091fc
Gitweb:     https://git.kernel.org/tip/a429dcb8feb60b8500fed81e2275c1944e3091fc
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:12 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add libperf to the python.so build

Link libperf.a with python.so.

Committer testing:

Continues to work:

  # perf test python
  18: 'import perf' in python                               : Ok
  #
---
 tools/perf/Makefile.perf | 1 +
 tools/perf/util/setup.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
tools/perf/Makefile.perf +1 -0
index 6e7e7d44ffac..67512a12276b 100644
@@ -307,6 +307,7 @@ LIBBPF = $(BPF_PATH)libbpf.a
 LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a
 
 LIBPERF = $(LIBPERF_PATH)libperf.a
+export LIBPERF
 
 # python extension build directories
 PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
tools/perf/util/setup.py +2 -1
index a1a68a2fa917..d48f9cd58964 100644
@@ -48,6 +48,7 @@ build_lib = getenv('PYTHON_EXTBUILD_LIB')
 build_tmp = getenv('PYTHON_EXTBUILD_TMP')
 libtraceevent = getenv('LIBTRACEEVENT')
 libapikfs = getenv('LIBAPI')
+libperf = getenv('LIBPERF')
 
 ext_sources = [f.strip() for f in open('util/python-ext-sources')
 				if len(f.strip()) > 0 and f[0] != '#']
@@ -64,7 +65,7 @@ perf = Extension('perf',
 		  include_dirs = ['util/include'],
 		  libraries = extra_libraries,
 		  extra_compile_args = cflags,
-		  extra_objects = [libtraceevent, libapikfs],
+		  extra_objects = [libtraceevent, libapikfs, libperf],
                  )
 
 setup(name='perf',
author reviewer
#55 lore raw

PATCH 26/79 libperf: Add perf/core.h header

In reply to Jiri Olsa

Adding perf/core.h header to be used in header files coming in following patches.

---
 tools/perf/lib/include/perf/core.h | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 tools/perf/lib/include/perf/core.h
tools/perf/lib/include/perf/core.h new file +9 -0
new file mode 100644
index 000000000000..e2e4b43c9131
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_CORE_H
+#define __LIBPERF_CORE_H
+
+#ifndef LIBPERF_API
+#define LIBPERF_API __attribute__((visibility("default")))
+#endif
+
+#endif /* __LIBPERF_CORE_H */
Signature · 1 line
2.21.0
#56 lore raw

[tip:perf/core] libperf: Add perf/core.h header

libperf: Add perf/core.h header
Commit-ID:  5b7f445d684fc287a2101e29d42d1fee19ae14ff
Gitweb:     https://git.kernel.org/tip/5b7f445d684fc287a2101e29d42d1fee19ae14ff
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:13 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf/core.h header

Add perf/core.h header to be used in header files coming in the following patches.

---
 tools/perf/lib/include/perf/core.h | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/perf/lib/include/perf/core.h new file +9 -0
new file mode 100644
index 000000000000..e2e4b43c9131
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_CORE_H
+#define __LIBPERF_CORE_H
+
+#ifndef LIBPERF_API
+#define LIBPERF_API __attribute__((visibility("default")))
+#endif
+
+#endif /* __LIBPERF_CORE_H */
author reviewer
#57 lore raw

PATCH 27/79 libperf: Add debug output support

In reply to Jiri Olsa

Adding perf_set_print function allowing to set output function for warn/info/debug messages.

---
 tools/perf/lib/core.c              | 34 ++++++++++++++++++++++++++++++
 tools/perf/lib/include/perf/core.h | 13 ++++++++++++
 tools/perf/lib/internal.h          | 18 ++++++++++++++++
 tools/perf/lib/libperf.map         |  2 ++
 4 files changed, 67 insertions(+)
 create mode 100644 tools/perf/lib/internal.h
tools/perf/lib/core.c +34 -0
index e69de29bb2d1..29d5e3348718 100644
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#define __printf(a, b)  __attribute__((format(printf, a, b)))
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <perf/core.h>
+#include "internal.h"
+
+static int __base_pr(enum libperf_print_level level, const char *format,
+		     va_list args)
+{
+	return vfprintf(stderr, format, args);
+}
+
+static libperf_print_fn_t __libperf_pr = __base_pr;
+
+void libperf_set_print(libperf_print_fn_t fn)
+{
+	__libperf_pr = fn;
+}
+
+__printf(2, 3)
+void libperf_print(enum libperf_print_level level, const char *format, ...)
+{
+	va_list args;
+
+	if (!__libperf_pr)
+		return;
+
+	va_start(args, format);
+	__libperf_pr(level, format, args);
+	va_end(args);
+}
tools/perf/lib/include/perf/core.h +13 -0
index e2e4b43c9131..c341a7b2c874 100644
@@ -2,8 +2,21 @@
 #ifndef __LIBPERF_CORE_H
 #define __LIBPERF_CORE_H
 
+#include <stdarg.h>
+
 #ifndef LIBPERF_API
 #define LIBPERF_API __attribute__((visibility("default")))
 #endif
 
+enum libperf_print_level {
+	LIBPERF_WARN,
+	LIBPERF_INFO,
+	LIBPERF_DEBUG,
+};
+
+typedef int (*libperf_print_fn_t)(enum libperf_print_level level,
+				  const char *, va_list ap);
+
+LIBPERF_API void libperf_set_print(libperf_print_fn_t fn);
+
 #endif /* __LIBPERF_CORE_H */
tools/perf/lib/internal.h new file +18 -0
new file mode 100644
index 000000000000..dc92f241732e
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_H
+#define __LIBPERF_INTERNAL_H
+
+void libperf_print(enum libperf_print_level level,
+		   const char *format, ...)
+	__attribute__((format(printf, 2, 3)));
+
+#define __pr(level, fmt, ...)   \
+do {                            \
+	libperf_print(level, "libperf: " fmt, ##__VA_ARGS__);     \
+} while (0)
+
+#define pr_warning(fmt, ...)    __pr(LIBPERF_WARN, fmt, ##__VA_ARGS__)
+#define pr_info(fmt, ...)       __pr(LIBPERF_INFO, fmt, ##__VA_ARGS__)
+#define pr_debug(fmt, ...)      __pr(LIBPERF_DEBUG, fmt, ##__VA_ARGS__)
+
+#endif /* __LIBPERF_INTERNAL_H */
tools/perf/lib/libperf.map +2 -0
index a8e913988edf..3536242c545c 100644
@@ -1,4 +1,6 @@
 LIBPERF_0.0.1 {
+	global:
+		libperf_set_print;
 	local:
 		*;
 };
Signature · 1 line
2.21.0
#58 lore raw

[tip:perf/core] libperf: Add debug output support

libperf: Add debug output support
Commit-ID:  a1556f8479ed58b8d5a33aef54578bad0165c7e7
Gitweb:     https://git.kernel.org/tip/a1556f8479ed58b8d5a33aef54578bad0165c7e7
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:14 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add debug output support

Add the perf_set_print() function to allow setting an output function for warn/info/debug messages.

---
 tools/perf/lib/core.c              | 34 ++++++++++++++++++++++++++++++++++
 tools/perf/lib/include/perf/core.h | 13 +++++++++++++
 tools/perf/lib/internal.h          | 18 ++++++++++++++++++
 tools/perf/lib/libperf.map         |  2 ++
 4 files changed, 67 insertions(+)
tools/perf/lib/core.c +34 -0
index e69de29bb2d1..29d5e3348718 100644
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#define __printf(a, b)  __attribute__((format(printf, a, b)))
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <perf/core.h>
+#include "internal.h"
+
+static int __base_pr(enum libperf_print_level level, const char *format,
+		     va_list args)
+{
+	return vfprintf(stderr, format, args);
+}
+
+static libperf_print_fn_t __libperf_pr = __base_pr;
+
+void libperf_set_print(libperf_print_fn_t fn)
+{
+	__libperf_pr = fn;
+}
+
+__printf(2, 3)
+void libperf_print(enum libperf_print_level level, const char *format, ...)
+{
+	va_list args;
+
+	if (!__libperf_pr)
+		return;
+
+	va_start(args, format);
+	__libperf_pr(level, format, args);
+	va_end(args);
+}
tools/perf/lib/include/perf/core.h +13 -0
index e2e4b43c9131..c341a7b2c874 100644
@@ -2,8 +2,21 @@
 #ifndef __LIBPERF_CORE_H
 #define __LIBPERF_CORE_H
 
+#include <stdarg.h>
+
 #ifndef LIBPERF_API
 #define LIBPERF_API __attribute__((visibility("default")))
 #endif
 
+enum libperf_print_level {
+	LIBPERF_WARN,
+	LIBPERF_INFO,
+	LIBPERF_DEBUG,
+};
+
+typedef int (*libperf_print_fn_t)(enum libperf_print_level level,
+				  const char *, va_list ap);
+
+LIBPERF_API void libperf_set_print(libperf_print_fn_t fn);
+
 #endif /* __LIBPERF_CORE_H */
tools/perf/lib/internal.h new file +18 -0
new file mode 100644
index 000000000000..dc92f241732e
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_H
+#define __LIBPERF_INTERNAL_H
+
+void libperf_print(enum libperf_print_level level,
+		   const char *format, ...)
+	__attribute__((format(printf, 2, 3)));
+
+#define __pr(level, fmt, ...)   \
+do {                            \
+	libperf_print(level, "libperf: " fmt, ##__VA_ARGS__);     \
+} while (0)
+
+#define pr_warning(fmt, ...)    __pr(LIBPERF_WARN, fmt, ##__VA_ARGS__)
+#define pr_info(fmt, ...)       __pr(LIBPERF_INFO, fmt, ##__VA_ARGS__)
+#define pr_debug(fmt, ...)      __pr(LIBPERF_DEBUG, fmt, ##__VA_ARGS__)
+
+#endif /* __LIBPERF_INTERNAL_H */
tools/perf/lib/libperf.map +2 -0
index a8e913988edf..3536242c545c 100644
@@ -1,4 +1,6 @@
 LIBPERF_0.0.1 {
+	global:
+		libperf_set_print;
 	local:
 		*;
 };
author reviewer
#59 lore raw

PATCH 28/79 libperf: Add perf_cpu_map struct

In reply to Jiri Olsa

Adding perf_cpu_map struct into libperf.

It's added as a declaration into into:
include/perf/cpumap.h
which will be included by users.

The perf_cpu_map struct definition is added into:
include/internal/cpumap.h

which is not to be included by users, but shared
within perf and libperf.

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

---
 tools/perf/lib/Build                     |  1 +
 tools/perf/lib/cpumap.c                  |  5 +++++
 tools/perf/lib/include/internal/cpumap.h | 13 +++++++++++++
 tools/perf/lib/include/perf/cpumap.h     |  7 +++++++
 tools/perf/util/cpumap.h                 |  7 +------
 5 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100644 tools/perf/lib/cpumap.c
 create mode 100644 tools/perf/lib/include/internal/cpumap.h
 create mode 100644 tools/perf/lib/include/perf/cpumap.h
tools/perf/lib/Build +1 -0
index 5196958cec01..195b274db49a 100644
@@ -1 +1,2 @@
 libperf-y += core.o
+libperf-y += cpumap.o
tools/perf/lib/cpumap.c new file +5 -0
new file mode 100644
index 000000000000..86a199c26f20
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <perf/cpumap.h>
+#include <stdlib.h>
+#include <linux/refcount.h>
+#include <internal/cpumap.h>
tools/perf/lib/include/internal/cpumap.h new file +13 -0
new file mode 100644
index 000000000000..53ce95374b05
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_CPUMAP_H
+#define __LIBPERF_INTERNAL_CPUMAP_H
+
+#include <linux/refcount.h>
+
+struct perf_cpu_map {
+	refcount_t	refcnt;
+	int		nr;
+	int		map[];
+};
+
+#endif /* __LIBPERF_INTERNAL_CPUMAP_H */
tools/perf/lib/include/perf/cpumap.h new file +7 -0
new file mode 100644
index 000000000000..8355d3ce7d0c
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_CPUMAP_H
+#define __LIBPERF_CPUMAP_H
+
+struct perf_cpu_map;
+
+#endif /* __LIBPERF_CPUMAP_H */
tools/perf/util/cpumap.h +1 -6
index 22729beae959..c2ba9ae195f7 100644
@@ -5,16 +5,11 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <linux/refcount.h>
+#include <internal/cpumap.h>
 
 #include "perf.h"
 #include "util/debug.h"
 
-struct perf_cpu_map {
-	refcount_t refcnt;
-	int nr;
-	int map[];
-};
-
 struct perf_cpu_map *cpu_map__new(const char *cpu_list);
 struct perf_cpu_map *cpu_map__empty_new(int nr);
 struct perf_cpu_map *cpu_map__dummy_new(void);
Signature · 1 line
2.21.0
#60 lore raw

[tip:perf/core] libperf: Add perf_cpu_map struct

libperf: Add perf_cpu_map struct
Commit-ID:  959b83c769389b24d64759f60e64c4c62620ff02
Gitweb:     https://git.kernel.org/tip/959b83c769389b24d64759f60e64c4c62620ff02
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:15 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf_cpu_map struct

Add perf_cpu_map struct to libperf.

It's added as a declaration into:

include/perf/cpumap.h

which will be included by users.

The perf_cpu_map struct definition is added into:

include/internal/cpumap.h

which is not to be included by users, but shared within perf and libperf.

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

---
 tools/perf/lib/Build                     |  1 +
 tools/perf/lib/cpumap.c                  |  5 +++++
 tools/perf/lib/include/internal/cpumap.h | 13 +++++++++++++
 tools/perf/lib/include/perf/cpumap.h     |  7 +++++++
 tools/perf/util/cpumap.h                 |  7 +------
 5 files changed, 27 insertions(+), 6 deletions(-)
tools/perf/lib/Build +1 -0
index 5196958cec01..195b274db49a 100644
@@ -1 +1,2 @@
 libperf-y += core.o
+libperf-y += cpumap.o
tools/perf/lib/cpumap.c new file +5 -0
new file mode 100644
index 000000000000..86a199c26f20
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <perf/cpumap.h>
+#include <stdlib.h>
+#include <linux/refcount.h>
+#include <internal/cpumap.h>
tools/perf/lib/include/internal/cpumap.h new file +13 -0
new file mode 100644
index 000000000000..53ce95374b05
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_CPUMAP_H
+#define __LIBPERF_INTERNAL_CPUMAP_H
+
+#include <linux/refcount.h>
+
+struct perf_cpu_map {
+	refcount_t	refcnt;
+	int		nr;
+	int		map[];
+};
+
+#endif /* __LIBPERF_INTERNAL_CPUMAP_H */
tools/perf/lib/include/perf/cpumap.h new file +7 -0
new file mode 100644
index 000000000000..8355d3ce7d0c
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_CPUMAP_H
+#define __LIBPERF_CPUMAP_H
+
+struct perf_cpu_map;
+
+#endif /* __LIBPERF_CPUMAP_H */
tools/perf/util/cpumap.h +1 -6
index 22729beae959..c2ba9ae195f7 100644
@@ -5,16 +5,11 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <linux/refcount.h>
+#include <internal/cpumap.h>
 
 #include "perf.h"
 #include "util/debug.h"
 
-struct perf_cpu_map {
-	refcount_t refcnt;
-	int nr;
-	int map[];
-};
-
 struct perf_cpu_map *cpu_map__new(const char *cpu_list);
 struct perf_cpu_map *cpu_map__empty_new(int nr);
 struct perf_cpu_map *cpu_map__dummy_new(void);
#61 lore raw

Re: [PATCH 28/79] libperf: Add perf_cpu_map struct

In reply to Jiri Olsa
Quoted 12 lines · Jiri Olsa

Adding perf_cpu_map struct into libperf.

It's added as a declaration into into:
include/perf/cpumap.h
which will be included by users.

The perf_cpu_map struct definition is added into:
include/internal/cpumap.h

which is not to be included by users, but shared within perf and libperf.

Quoted 6 lines

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

Hi,

this patch causes out-of-tree builds (make O=<destdir>) to fail.

In file included from tools/include/asm/atomic.h:6:0,

                 from include/linux/atomic.h:5,
		 from tools/include/linux/refcount.h:41,
		 from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:

fatal error: asm/cmpxchg.h: No such file or directory

Bisect log attached.

Guenter

---
# bad: [0c3d3d648b3ed72b920a89bc4fd125e9b7aa5f23] Add linux-next specific files for 20190816 # good: [d45331b00ddb179e291766617259261c112db872] Linux 5.3-rc4
git bisect start 'HEAD' 'v5.3-rc4'
# good: [4e6eaeb715ab76095f7ea03fa5926c7aa541361e] Merge remote-tracking branch 'crypto/master' git bisect good 4e6eaeb715ab76095f7ea03fa5926c7aa541361e
# good: [ef1c67aa73f33a29e3df672998056f18cb51468d] Merge remote-tracking branch 'sound-asoc/for-next' git bisect good ef1c67aa73f33a29e3df672998056f18cb51468d
# bad: [f414a0d92534d55591e3c295f37f8db40d08659a] Merge remote-tracking branch 'char-misc/char-misc-next' git bisect bad f414a0d92534d55591e3c295f37f8db40d08659a
# bad: [07f45358f90398b3bc44914a863317285a5dac55] Merge remote-tracking branch 'tip/auto-latest' git bisect bad 07f45358f90398b3bc44914a863317285a5dac55
# good: [b8c9806513153eb258f565b2f359958a94c93816] Merge remote-tracking branch 'watchdog/master' git bisect good b8c9806513153eb258f565b2f359958a94c93816
# bad: [7b9063c0c1c0b54db5eca8e4c36a926ee6234280] Merge branch 'sched/core'
git bisect bad 7b9063c0c1c0b54db5eca8e4c36a926ee6234280
# bad: [03617c22e31f32cbf0e4797e216db898fb898d90] libperf: Add threads to struct perf_evlist git bisect bad 03617c22e31f32cbf0e4797e216db898fb898d90
# good: [5972d1e07bd95c7458e2d7f484391d69008affc7] perf evsel: Rename perf_evsel__open() to evsel__open() git bisect good 5972d1e07bd95c7458e2d7f484391d69008affc7
# bad: [285a30c36d1e18e7e2afa24dae50ba5596be45e7] libperf: Add perf_evlist and perf_evsel structs git bisect bad 285a30c36d1e18e7e2afa24dae50ba5596be45e7
# good: [47f9bccc79cb067103ad5e9790e0d01c94839429] libperf: Add build version support git bisect good 47f9bccc79cb067103ad5e9790e0d01c94839429
# bad: [397721e06e52d017cfdd403f63284ed0995d4caf] libperf: Add perf_cpu_map__dummy_new() function git bisect bad 397721e06e52d017cfdd403f63284ed0995d4caf
# good: [5b7f445d684fc287a2101e29d42d1fee19ae14ff] libperf: Add perf/core.h header
git bisect good 5b7f445d684fc287a2101e29d42d1fee19ae14ff
# bad: [959b83c769389b24d64759f60e64c4c62620ff02] libperf: Add perf_cpu_map struct
git bisect bad 959b83c769389b24d64759f60e64c4c62620ff02
# good: [a1556f8479ed58b8d5a33aef54578bad0165c7e7] libperf: Add debug output support
git bisect good a1556f8479ed58b8d5a33aef54578bad0165c7e7

# first bad commit: [959b83c769389b24d64759f60e64c4c62620ff02] libperf: Add perf_cpu_map struct
#62 lore raw

Re: [PATCH 28/79] libperf: Add perf_cpu_map struct

Quoted 24 lines · Guenter Roeck
Quoted 12 lines · Jiri Olsa

Adding perf_cpu_map struct into libperf.

It's added as a declaration into into:
include/perf/cpumap.h
which will be included by users.

The perf_cpu_map struct definition is added into:
include/internal/cpumap.h

which is not to be included by users, but shared within perf and libperf.

Quoted 6 lines

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

Hi,

this patch causes out-of-tree builds (make O=<destdir>) to fail.

Quoted 7 lines

In file included from tools/include/asm/atomic.h:6:0,

                 from include/linux/atomic.h:5,
		 from tools/include/linux/refcount.h:41,
		 from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:

fatal error: asm/cmpxchg.h: No such file or directory

Bisect log attached.

hi,
I dont see any problem with v5.3-rc4, could you please send the full compilation log (after make clean) from:

  $ make V=1 <your options>

also I can't make sense of that bisect, because I can't find some of those commits.. what tree are you in?

thanks,
jirka

Quoted 36 lines

Guenter

---
# bad: [0c3d3d648b3ed72b920a89bc4fd125e9b7aa5f23] Add linux-next specific files for 20190816 # good: [d45331b00ddb179e291766617259261c112db872] Linux 5.3-rc4
git bisect start 'HEAD' 'v5.3-rc4'
# good: [4e6eaeb715ab76095f7ea03fa5926c7aa541361e] Merge remote-tracking branch 'crypto/master' git bisect good 4e6eaeb715ab76095f7ea03fa5926c7aa541361e
# good: [ef1c67aa73f33a29e3df672998056f18cb51468d] Merge remote-tracking branch 'sound-asoc/for-next' git bisect good ef1c67aa73f33a29e3df672998056f18cb51468d
# bad: [f414a0d92534d55591e3c295f37f8db40d08659a] Merge remote-tracking branch 'char-misc/char-misc-next' git bisect bad f414a0d92534d55591e3c295f37f8db40d08659a
# bad: [07f45358f90398b3bc44914a863317285a5dac55] Merge remote-tracking branch 'tip/auto-latest' git bisect bad 07f45358f90398b3bc44914a863317285a5dac55
# good: [b8c9806513153eb258f565b2f359958a94c93816] Merge remote-tracking branch 'watchdog/master' git bisect good b8c9806513153eb258f565b2f359958a94c93816
# bad: [7b9063c0c1c0b54db5eca8e4c36a926ee6234280] Merge branch 'sched/core'
git bisect bad 7b9063c0c1c0b54db5eca8e4c36a926ee6234280
# bad: [03617c22e31f32cbf0e4797e216db898fb898d90] libperf: Add threads to struct perf_evlist git bisect bad 03617c22e31f32cbf0e4797e216db898fb898d90
# good: [5972d1e07bd95c7458e2d7f484391d69008affc7] perf evsel: Rename perf_evsel__open() to evsel__open() git bisect good 5972d1e07bd95c7458e2d7f484391d69008affc7
# bad: [285a30c36d1e18e7e2afa24dae50ba5596be45e7] libperf: Add perf_evlist and perf_evsel structs git bisect bad 285a30c36d1e18e7e2afa24dae50ba5596be45e7
# good: [47f9bccc79cb067103ad5e9790e0d01c94839429] libperf: Add build version support git bisect good 47f9bccc79cb067103ad5e9790e0d01c94839429
# bad: [397721e06e52d017cfdd403f63284ed0995d4caf] libperf: Add perf_cpu_map__dummy_new() function git bisect bad 397721e06e52d017cfdd403f63284ed0995d4caf
# good: [5b7f445d684fc287a2101e29d42d1fee19ae14ff] libperf: Add perf/core.h header
git bisect good 5b7f445d684fc287a2101e29d42d1fee19ae14ff
# bad: [959b83c769389b24d64759f60e64c4c62620ff02] libperf: Add perf_cpu_map struct
git bisect bad 959b83c769389b24d64759f60e64c4c62620ff02
# good: [a1556f8479ed58b8d5a33aef54578bad0165c7e7] libperf: Add debug output support
git bisect good a1556f8479ed58b8d5a33aef54578bad0165c7e7

# first bad commit: [959b83c769389b24d64759f60e64c4c62620ff02] libperf: Add perf_cpu_map struct
#63 lore raw

Re: [PATCH 28/79] libperf: Add perf_cpu_map struct

Quoted 33 lines · Jiri Olsa
Quoted 24 lines · Guenter Roeck
Quoted 12 lines · Jiri Olsa

Adding perf_cpu_map struct into libperf.

It's added as a declaration into into:
include/perf/cpumap.h
which will be included by users.

The perf_cpu_map struct definition is added into:
include/internal/cpumap.h

which is not to be included by users, but shared within perf and libperf.

Quoted 6 lines

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

Hi,

this patch causes out-of-tree builds (make O=<destdir>) to fail.

Quoted 7 lines

In file included from tools/include/asm/atomic.h:6:0,

                 from include/linux/atomic.h:5,
		 from tools/include/linux/refcount.h:41,
		 from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:

fatal error: asm/cmpxchg.h: No such file or directory

Bisect log attached.

Quoted 9 lines

hi,
I dont see any problem with v5.3-rc4, could you please send the full compilation log (after make clean) from:

  $ make V=1 <your options>

also I can't make sense of that bisect, because I can't find some of those commits.. what tree are you in?

This is with -next, not with mainline. More specifically, with next-20190816, though the problem has been seen since at least next-20190801. Mainline builds fine.

Here is the script I used to bisect the problem:

make mrproper
rm -rf /tmp/linux
mkdir /tmp/linux
make ARCH=x86_64 O=/tmp/linux defconfig
make -j40 ARCH=x86_64 O=/tmp/linux tools/perf

It looks like the problem is related to "ARCH=x86_64". In mainline, x86_64 is replaced in the build command with x86. This is no longer the case, and make now tries to include from tools/arch/x86_64/include/, which doesn't exist. As it turns out, O=<destdir> is not needed to reproduce the problem, only ARCH=x86_64 (or ARCH=i386).

Output from build with V=1 below.

Guenter

---
make[1]: Entering directory '/tmp/linux'

  HOSTCC  scripts/basic/fixdep
  GEN     Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/conf
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
make[1]: Leaving directory '/tmp/linux'
make -C /tmp/linux -f /home/groeck/src/linux-next/Makefile tools/perf
make[1]: Entering directory '/tmp/linux'
mkdir -p ./tools
make LDFLAGS= MAKEFLAGS=" -j --jobserver-fds=3,4" O=/tmp/linux subdir=tools -C /home/groeck/src/linux-next/tools/ perf
mkdir -p /tmp/linux/tools/perf .
make --no-print-directory -C perf O=/tmp/linux/tools/perf subdir=
  BUILD:   Doing 'make -j24' parallel build
make -C /home/groeck/src/linux-next/tools/build CFLAGS= LDFLAGS= /tmp/linux/tools/perf/fixdep
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=. obj=fixdep
  gcc -Wp,-MD,/tmp/linux/tools/perf/.fixdep.o.d -Wp,-MT,/tmp/linux/tools/perf/fixdep.o -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89   -D"BUILD_STR(s)=#s"   -c -o /tmp/linux/tools/perf/fixdep.o fixdep.c
   ld -r -o /tmp/linux/tools/perf/fixdep-in.o  /tmp/linux/tools/perf/fixdep.o
gcc   -o /tmp/linux/tools/perf/fixdep /tmp/linux/tools/perf/fixdep-in.o
Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h'
diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/fs.h' differs from latest version at 'include/uapi/linux/fs.h'
diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/prctl.h' differs from latest version at 'include/uapi/linux/prctl.h'
diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h'
diff -u tools/include/uapi/linux/sched.h include/uapi/linux/sched.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/usbdevice_fs.h' differs from latest version at 'include/uapi/linux/usbdevice_fs.h'
diff -u tools/include/uapi/linux/usbdevice_fs.h include/uapi/linux/usbdevice_fs.h
Warning: Kernel ABI header at 'tools/include/linux/bits.h' differs from latest version at 'include/linux/bits.h'
diff -u tools/include/linux/bits.h include/linux/bits.h
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h'
diff -u tools/arch/x86/include/uapi/asm/unistd.h arch/x86/include/uapi/asm/unistd.h
Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
make FIXDEP=1 -f Makefile.perf 

Auto-detecting system features:

...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
...                        libaio: [ on  ]

... libzstd: [ OFF ]
... disassembler-four-args: [ OFF ]

Makefile.config:822: No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR
Makefile.config:890: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
$(:)
make -C /home/groeck/src/linux-next/tools/lib/api/ O=/tmp/linux/tools/perf/ /tmp/linux/tools/perf/libapi.a
make -C /home/groeck/src/linux-next/tools/lib/traceevent/ plugin_dir= 'EXTRA_CFLAGS=' 'LDFLAGS= -Wl,-z,noexecstack -lunwind-x86_64 -lunwind -llzma -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions' O=/tmp/linux/tools/perf/ /tmp/linux/tools/perf/libtraceevent.a
make -C /home/groeck/src/linux-next/tools/lib/subcmd/ O=/tmp/linux/tools/perf/ /tmp/linux/tools/perf/libsubcmd.a
make -C /home/groeck/src/linux-next/tools/perf/lib/ O=/tmp/linux/tools/perf/ /tmp/linux/tools/perf/libperf.a
make -C /home/groeck/src/linux-next/tools/lib/bpf/ O=/tmp/linux/tools/perf/ /tmp/linux/tools/perf/libbpf.a FEATURES_DUMP=/tmp/linux/tools/perf/FEATURE-DUMP
/bin/sh util/PERF-VERSION-GEN /tmp/linux/tools/perf/
. util/generate-cmdlist.sh > /tmp/linux/tools/perf/common-cmds.h+ && mv /tmp/linux/tools/perf/common-cmds.h+ /tmp/linux/tools/perf/common-cmds.h
/bin/sh '/home/groeck/src/linux-next/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh' /home/groeck/src/linux-next/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 'x86_64' > /tmp/linux/tools/perf/arch/x86/include/generated/asm/syscalls_64.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/drm_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/drm > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/drm_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/fadvise.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/fadvise_advice_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/fsconfig.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/fsconfig_arrays.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/fsmount.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/fsmount_arrays.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/fspick.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/fspick_arrays.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/pkey_alloc_access_rights.sh' /home/groeck/src/linux-next/tools/include/uapi/asm-generic/ > /tmp/linux/tools/perf/trace/beauty/generated/pkey_alloc_access_rights_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/sndrv_pcm_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/sound > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/sndrv_pcm_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/sndrv_ctl_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/sound > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/sndrv_ctl_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/kcmp_type.sh' /home/groeck/src/linux-next/tools/include/uapi/linux/ > /tmp/linux/tools/perf/trace/beauty/generated/kcmp_type_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/kvm_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/socket_ipproto.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/socket_ipproto_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/vhost_virtio_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/vhost_virtio_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/madvise_behavior.sh' /home/groeck/src/linux-next/tools/include/uapi/asm-generic/ > /tmp/linux/tools/perf/trace/beauty/generated/madvise_behavior_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/mmap_flags.sh' /home/groeck/src/linux-next/tools/include/uapi/linux /home/groeck/src/linux-next/tools/include/uapi/asm-generic /home/groeck/src/linux-next/tools/arch/x86/include/uapi/asm/ > /tmp/linux/tools/perf/trace/beauty/generated/mmap_flags_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/mount_flags.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/mount_flags_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/move_mount_flags.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/move_mount_flags_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/perf_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/perf_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/prctl_option.sh' /home/groeck/src/linux-next/tools/include/uapi/linux/ > /tmp/linux/tools/perf/trace/beauty/generated/prctl_option_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/usbdevfs_ioctl.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/ioctl/usbdevfs_ioctl_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/x86_arch_prctl.sh' /home/groeck/src/linux-next/tools/arch/x86/include/uapi/asm/ > /tmp/linux/tools/perf/trace/beauty/generated/x86_arch_prctl_code_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/rename_flags.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/rename_flags_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/arch_errno_names.sh' gcc /home/groeck/src/linux-next/tools > /tmp/linux/tools/perf/trace/beauty/generated/arch_errno_name_array.c
/bin/sh '/home/groeck/src/linux-next/tools/perf/trace/beauty/sync_file_range.sh' /home/groeck/src/linux-next/tools/include/uapi/linux > /tmp/linux/tools/perf/trace/beauty/generated/sync_file_range_arrays.c
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=pmu-events obj=jevents
make -C /home/groeck/src/linux-next/tools/lib/traceevent/ plugin_dir= 'EXTRA_CFLAGS=' 'LDFLAGS= -Wl,-z,noexecstack -lunwind-x86_64 -lunwind -llzma -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions' O=/tmp/linux/tools/perf/ plugins
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=jvmti obj=jvmti
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=. obj=gtk
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=./fd obj=libapi
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=./fs obj=libapi
make -f /home/groeck/src/linux-next/tools/build/Makefile.build dir=./ui/gtk obj=gtk
mkdir -p /tmp/linux/tools/perf/jvmti/
mkdir -p /tmp/linux/tools/perf/fd/
mkdir -p /tmp/linux/tools/perf/jvmti/
mkdir -p /tmp/linux/tools/perf/pmu-events/
mkdir -p /tmp/linux/tools/perf/fs/
mkdir -p /tmp/linux/tools/perf/pmu-events/
mkdir -p /tmp/linux/tools/perf/pmu-events/
mkdir -p /tmp/linux/tools/perf/ui/gtk/
gcc -Wp,-MD,/tmp/linux/tools/perf/.exec-cmd.o.d -Wp,-MT,/tmp/linux/tools/perf/exec-cmd.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/exec-cmd.o exec-cmd.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.cpu.o.d -Wp,-MT,/tmp/linux/tools/perf/cpu.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/cpu.o cpu.c
gcc -Wp,-MD,/tmp/linux/tools/perf/fd/.array.o.d -Wp,-MT,/tmp/linux/tools/perf/fd/array.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/fd/array.o fd/array.c
gcc -Wp,-MD,/tmp/linux/tools/perf/pmu-events/.json.o.d -Wp,-MT,/tmp/linux/tools/perf/pmu-events/json.o -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/pmu-events/json.o pmu-events/json.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.debug.o.d -Wp,-MT,/tmp/linux/tools/perf/debug.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/debug.o debug.c
gcc -Wp,-MD,/tmp/linux/tools/perf/pmu-events/.jsmn.o.d -Wp,-MT,/tmp/linux/tools/perf/pmu-events/jsmn.o -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/pmu-events/jsmn.o pmu-events/jsmn.c
gcc -Wp,-MD,/tmp/linux/tools/perf/jvmti/.libjvmti.o.d -Wp,-MT,/tmp/linux/tools/perf/jvmti/libjvmti.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wswitch-default -Wswitch-enum -Wundef -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DPIC -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -c -o /tmp/linux/tools/perf/jvmti/libjvmti.o jvmti/libjvmti.c
gcc -Wp,-MD,/tmp/linux/tools/perf/pmu-events/.jevents.o.d -Wp,-MT,/tmp/linux/tools/perf/pmu-events/jevents.o -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -D"BUILD_STR(s)=#s" -I/home/groeck/src/linux-next/tools/include -c -o /tmp/linux/tools/perf/pmu-events/jevents.o pmu-events/jevents.c
gcc -Wp,-MD,/tmp/linux/tools/perf/fs/.fs.o.d -Wp,-MT,/tmp/linux/tools/perf/fs/fs.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/fs/fs.o fs/fs.c
gcc -Wp,-MD,/tmp/linux/tools/perf/jvmti/.jvmti_agent.o.d -Wp,-MT,/tmp/linux/tools/perf/jvmti/jvmti_agent.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wswitch-default -Wswitch-enum -Wundef -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DPIC -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include -I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -c -o /tmp/linux/tools/perf/jvmti/jvmti_agent.o jvmti/jvmti_agent.c mkdir -p /tmp/linux/tools/perf/ui/gtk/
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.browser.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/browser.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/browser.o ui/gtk/browser.c mkdir -p /tmp/linux/tools/perf/fs/
gcc -Wp,-MD,/tmp/linux/tools/perf/.event-parse.o.d -Wp,-MT,/tmp/linux/tools/perf/event-parse.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/event-parse.o event-parse.c
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.setup.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/setup.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/setup.o ui/gtk/setup.c gcc -Wp,-MD,/tmp/linux/tools/perf/fs/.tracing_path.o.d -Wp,-MT,/tmp/linux/tools/perf/fs/tracing_path.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/fs/tracing_path.o fs/tracing_path.c
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.util.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/util.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/util.o ui/gtk/util.c gcc -Wp,-MD,/tmp/linux/tools/perf/.core.o.d -Wp,-MT,/tmp/linux/tools/perf/core.o -g -Wall -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/ -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/core.o core.c
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.hists.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/hists.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/hists.o ui/gtk/hists.c gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.helpline.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/helpline.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/helpline.o ui/gtk/helpline.c gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_jbd2.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_jbd2.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_jbd2.o plugin_jbd2.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.str_error_r.o.d -Wp,-MT,/tmp/linux/tools/perf/str_error_r.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/groeck/src/linux-next/tools/lib/api -I/home/groeck/src/linux-next/tools/include -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/str_error_r.o ../str_error_r.c
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.progress.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/progress.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/progress.o ui/gtk/progress.c gcc -Wp,-MD,/tmp/linux/tools/perf/.event-plugin.o.d -Wp,-MT,/tmp/linux/tools/perf/event-plugin.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/event-plugin.o event-plugin.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.cpumap.o.d -Wp,-MT,/tmp/linux/tools/perf/cpumap.o -g -Wall -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/ -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/cpumap.o cpumap.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.libbpf.o.d -Wp,-MT,/tmp/linux/tools/perf/libbpf.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/libbpf.o libbpf.c
ld -r -o /tmp/linux/tools/perf/fd/libapi-in.o /tmp/linux/tools/perf/fd/array.o
gcc -Wp,-MD,/tmp/linux/tools/perf/ui/gtk/.annotate.o.d -Wp,-MT,/tmp/linux/tools/perf/ui/gtk/annotate.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -DHAVE_ARCH_X86_64_SUPPORT -I/tmp/linux/tools/perf/arch/x86/include/generated -DHAVE_SYSCALL_TABLE_SUPPORT -DHAVE_PERF_REGS_SUPPORT -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -Werror -O6 -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all -D_FORTIFY_SOURCE=2 -I/home/groeck/src/linux-next/tools/perf/lib/include -I/home/groeck/src/linux-next/tools/perf/util/include -I/home/groeck/src/linux-next/tools/perf/arch/x86/include -I/home/groeck/src/linux-next/tools/include/uapi -I/home/groeck/src/linux-next/tools/include/ -I/home/groeck/src/linux-next/tools/arch/x86/include/uapi -I/home/groeck/src/linux-next/tools/arch/x86/include/ -I/home/groeck/src/linux-next/tools/arch/x86/ -I/tmp/linux/tools/perf//util -I/tmp/linux/tools/perf/ -I/home/groeck/src/linux-next/tools/perf/util -I/home/groeck/src/linux-next/tools/perf -I/home/groeck/src/linux-next/tools/lib/ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_PTHREAD_BARRIER -DHAVE_EVENTFD -DHAVE_GET_CURRENT_DIR_NAME -DHAVE_DWARF_GETLOCATIONS_SUPPORT -DHAVE_GLIBC_SUPPORT -DHAVE_AIO_SUPPORT -DHAVE_SCHED_GETCPU_SUPPORT -DHAVE_SETNS_SUPPORT -DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT -DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT -DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DNO_LIBUNWIND_DEBUG_FRAME -DHAVE_LIBUNWIND_SUPPORT -DHAVE_LIBCRYPTO_SUPPORT -DHAVE_SLANG_SUPPORT -DHAVE_GTK2_SUPPORT -DHAVE_LIBPERL_SUPPORT -DHAVE_TIMERFD_SUPPORT -DHAVE_LIBPYTHON_SUPPORT -DHAVE_CPLUS_DEMANGLE_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT -DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT -DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -DHAVE_JVMTI_CMLR -I/tmp/linux/tools/perf/ -D"BUILD_STR(s)=#s" -fPIC -DHAVE_GTK_INFO_BAR_SUPPORT -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -c -o /tmp/linux/tools/perf/ui/gtk/annotate.o ui/gtk/annotate.c gcc -Wp,-MD,/tmp/linux/tools/perf/.trace-seq.o.d -Wp,-MT,/tmp/linux/tools/perf/trace-seq.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/trace-seq.o trace-seq.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.bpf.o.d -Wp,-MT,/tmp/linux/tools/perf/bpf.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/bpf.o bpf.c
ld -r -o /tmp/linux/tools/perf/plugin_jbd2-in.o /tmp/linux/tools/perf/plugin_jbd2.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.nlattr.o.d -Wp,-MT,/tmp/linux/tools/perf/nlattr.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/nlattr.o nlattr.c
In file included from /home/groeck/src/linux-next/tools/include/asm/atomic.h:6:0,
from /home/groeck/src/linux-next/tools/include/linux/atomic.h:5,
from /home/groeck/src/linux-next/tools/include/linux/refcount.h:41,
from cpumap.c:4:
/home/groeck/src/linux-next/tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10: fatal error: asm/cmpxchg.h: No such file or directory

 #include <asm/cmpxchg.h>
          ^~~~~~~~~~~~~~~

compilation terminated.
gcc -Wp,-MD,/tmp/linux/tools/perf/.btf.o.d -Wp,-MT,/tmp/linux/tools/perf/btf.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/btf.o btf.c gcc -Wp,-MD,/tmp/linux/tools/perf/.parse-filter.o.d -Wp,-MT,/tmp/linux/tools/perf/parse-filter.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/parse-filter.o parse-filter.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_hrtimer.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_hrtimer.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_hrtimer.o plugin_hrtimer.c
mv: cannot stat '/tmp/linux/tools/perf/.cpumap.o.tmp': No such file or directory
/home/groeck/src/linux-next/tools/build/Makefile.build:96: recipe for target '/tmp/linux/tools/perf/cpumap.o' failed
make[7]: *** [/tmp/linux/tools/perf/cpumap.o] Error 1
Makefile:92: recipe for target '/tmp/linux/tools/perf/libperf-in.o' failed
make[6]: *** [/tmp/linux/tools/perf/libperf-in.o] Error 2
Makefile.perf:762: recipe for target '/tmp/linux/tools/perf/libperf.a' failed
make[5]: *** [/tmp/linux/tools/perf/libperf.a] Error 2
make[5]: *** Waiting for unfinished jobs....
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_kmem.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_kmem.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_kmem.o plugin_kmem.c
ld -r -o /tmp/linux/tools/perf/fs/libapi-in.o /tmp/linux/tools/perf/fs/fs.o /tmp/linux/tools/perf/fs/tracing_path.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_kvm.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_kvm.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_kvm.o plugin_kvm.c
ld -r -o /tmp/linux/tools/perf/libapi-in.o /tmp/linux/tools/perf/fd/libapi-in.o /tmp/linux/tools/perf/fs/libapi-in.o /tmp/linux/tools/perf/cpu.o /tmp/linux/tools/perf/debug.o /tmp/linux/tools/perf/str_error_r.o
rm -f /tmp/linux/tools/perf/libapi.a && ar rcs /tmp/linux/tools/perf/libapi.a /tmp/linux/tools/perf/libapi-in.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.help.o.d -Wp,-MT,/tmp/linux/tools/perf/help.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/help.o help.c
ld -r -o /tmp/linux/tools/perf/plugin_hrtimer-in.o /tmp/linux/tools/perf/plugin_hrtimer.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.parse-utils.o.d -Wp,-MT,/tmp/linux/tools/perf/parse-utils.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/parse-utils.o parse-utils.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.libbpf_errno.o.d -Wp,-MT,/tmp/linux/tools/perf/libbpf_errno.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/libbpf_errno.o libbpf_errno.c gcc -Wp,-MD,/tmp/linux/tools/perf/.kbuffer-parse.o.d -Wp,-MT,/tmp/linux/tools/perf/kbuffer-parse.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/kbuffer-parse.o kbuffer-parse.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_mac80211.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_mac80211.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_mac80211.o plugin_mac80211.c
ld -r -o /tmp/linux/tools/perf/plugin_kmem-in.o /tmp/linux/tools/perf/plugin_kmem.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.tep_strerror.o.d -Wp,-MT,/tmp/linux/tools/perf/tep_strerror.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/tep_strerror.o tep_strerror.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.str_error.o.d -Wp,-MT,/tmp/linux/tools/perf/str_error.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/str_error.o str_error.c gcc -Wp,-MD,/tmp/linux/tools/perf/.pager.o.d -Wp,-MT,/tmp/linux/tools/perf/pager.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/pager.o pager.c
ld -r -o /tmp/linux/tools/perf/plugin_kvm-in.o /tmp/linux/tools/perf/plugin_kvm.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.parse-options.o.d -Wp,-MT,/tmp/linux/tools/perf/parse-options.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/parse-options.o parse-options.c gcc -Wp,-MD,/tmp/linux/tools/perf/.run-command.o.d -Wp,-MT,/tmp/linux/tools/perf/run-command.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/run-command.o run-command.c
ld -r -o /tmp/linux/tools/perf/plugin_mac80211-in.o /tmp/linux/tools/perf/plugin_mac80211.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.sigchain.o.d -Wp,-MT,/tmp/linux/tools/perf/sigchain.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/sigchain.o sigchain.c gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_sched_switch.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_sched_switch.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_sched_switch.o plugin_sched_switch.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.event-parse-api.o.d -Wp,-MT,/tmp/linux/tools/perf/event-parse-api.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/event-parse-api.o event-parse-api.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_function.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_function.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_function.o plugin_function.c
gcc -Wp,-MD,/tmp/linux/tools/perf/.netlink.o.d -Wp,-MT,/tmp/linux/tools/perf/netlink.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/netlink.o netlink.c gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_xen.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_xen.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_xen.o plugin_xen.c
ld -r -o /tmp/linux/tools/perf/plugin_sched_switch-in.o /tmp/linux/tools/perf/plugin_sched_switch.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_scsi.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_scsi.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_scsi.o plugin_scsi.c
ld -r -o /tmp/linux/tools/perf/plugin_function-in.o /tmp/linux/tools/perf/plugin_function.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.bpf_prog_linfo.o.d -Wp,-MT,/tmp/linux/tools/perf/bpf_prog_linfo.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/bpf_prog_linfo.o bpf_prog_linfo.c gcc -Wp,-MD,/tmp/linux/tools/perf/.subcmd-config.o.d -Wp,-MT,/tmp/linux/tools/perf/subcmd-config.o -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -O6 -Werror -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/groeck/src/linux-next/tools/include/ -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/subcmd-config.o subcmd-config.c gcc -Wp,-MD,/tmp/linux/tools/perf/.libbpf_probes.o.d -Wp,-MT,/tmp/linux/tools/perf/libbpf_probes.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/libbpf_probes.o libbpf_probes.c
ld -r -o /tmp/linux/tools/perf/jvmti/jvmti-in.o /tmp/linux/tools/perf/jvmti/libjvmti.o /tmp/linux/tools/perf/jvmti/jvmti_agent.o
ld -r -o /tmp/linux/tools/perf/plugin_xen-in.o /tmp/linux/tools/perf/plugin_xen.o
gcc -Wp,-MD,/tmp/linux/tools/perf/.xsk.o.d -Wp,-MT,/tmp/linux/tools/perf/xsk.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/xsk.o xsk.c gcc -Wp,-MD,/tmp/linux/tools/perf/.hashmap.o.d -Wp,-MT,/tmp/linux/tools/perf/hashmap.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/hashmap.o hashmap.c

gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_jbd2.so /tmp/linux/tools/perf/plugin_jbd2-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_hrtimer.so /tmp/linux/tools/perf/plugin_hrtimer-in.o
  gcc -Wp,-MD,/tmp/linux/tools/perf/.btf_dump.o.d -Wp,-MT,/tmp/linux/tools/perf/btf_dump.o -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DCOMPAT_NEED_REALLOCARRAY -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I. -I/home/groeck/src/linux-next/tools/include -I/home/groeck/src/linux-next/tools/arch/x86_64/include/uapi -I/home/groeck/src/linux-next/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/btf_dump.o btf_dump.c
  gcc -Wp,-MD,/tmp/linux/tools/perf/.plugin_cfg80211.o.d -Wp,-MT,/tmp/linux/tools/perf/plugin_cfg80211.o -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -D"BUILD_STR(s)=#s" -c -o /tmp/linux/tools/perf/plugin_cfg80211.o plugin_cfg80211.c
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_kmem.so /tmp/linux/tools/perf/plugin_kmem-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_kvm.so /tmp/linux/tools/perf/plugin_kvm-in.o
   ld   -r -o /tmp/linux/tools/perf/plugin_scsi-in.o  /tmp/linux/tools/perf/plugin_scsi.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_mac80211.so /tmp/linux/tools/perf/plugin_mac80211-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_sched_switch.so /tmp/linux/tools/perf/plugin_sched_switch-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_function.so /tmp/linux/tools/perf/plugin_function-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_xen.so /tmp/linux/tools/perf/plugin_xen-in.o
gcc -g -Wall -fPIC  -I. -I /home/groeck/src/linux-next/tools/include    -D_GNU_SOURCE -shared -Wl,-z,noexecstack  -lunwind-x86_64 -lunwind -llzma  -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_scsi.so /tmp/linux/tools/perf/plugin_scsi-in.o

ld -r -o /tmp/linux/tools/perf/plugin_cfg80211-in.o /tmp/linux/tools/perf/plugin_cfg80211.o
gcc -g -Wall -fPIC -I. -I /home/groeck/src/linux-next/tools/include -D_GNU_SOURCE -shared -Wl,-z,noexecstack -lunwind-x86_64 -lunwind -llzma -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -nostartfiles -o /tmp/linux/tools/perf/plugin_cfg80211.so /tmp/linux/tools/perf/plugin_cfg80211-in.o
ld -r -o /tmp/linux/tools/perf/pmu-events/jevents-in.o /tmp/linux/tools/perf/pmu-events/json.o /tmp/linux/tools/perf/pmu-events/jsmn.o /tmp/linux/tools/perf/pmu-events/jevents.o
ld -r -o /tmp/linux/tools/perf/libtraceevent-in.o /tmp/linux/tools/perf/event-parse.o /tmp/linux/tools/perf/event-plugin.o /tmp/linux/tools/perf/trace-seq.o /tmp/linux/tools/perf/parse-filter.o /tmp/linux/tools/perf/parse-utils.o /tmp/linux/tools/perf/kbuffer-parse.o /tmp/linux/tools/perf/tep_strerror.o /tmp/linux/tools/perf/event-parse-api.o
rm -f /tmp/linux/tools/perf/libtraceevent.a; ar rcs /tmp/linux/tools/perf/libtraceevent.a /tmp/linux/tools/perf/libtraceevent-in.o
ld -r -o /tmp/linux/tools/perf/libbpf-in.o /tmp/linux/tools/perf/libbpf.o /tmp/linux/tools/perf/bpf.o /tmp/linux/tools/perf/nlattr.o /tmp/linux/tools/perf/btf.o /tmp/linux/tools/perf/libbpf_errno.o /tmp/linux/tools/perf/str_error.o /tmp/linux/tools/perf/netlink.o /tmp/linux/tools/perf/bpf_prog_linfo.o /tmp/linux/tools/perf/libbpf_probes.o /tmp/linux/tools/perf/xsk.o /tmp/linux/tools/perf/hashmap.o /tmp/linux/tools/perf/btf_dump.o
rm -f /tmp/linux/tools/perf/libbpf.a; ar rcs /tmp/linux/tools/perf/libbpf.a /tmp/linux/tools/perf/libbpf-in.o
ld -r -o /tmp/linux/tools/perf/libsubcmd-in.o /tmp/linux/tools/perf/exec-cmd.o /tmp/linux/tools/perf/help.o /tmp/linux/tools/perf/pager.o /tmp/linux/tools/perf/parse-options.o /tmp/linux/tools/perf/run-command.o /tmp/linux/tools/perf/sigchain.o /tmp/linux/tools/perf/subcmd-config.o
rm -f /tmp/linux/tools/perf/libsubcmd.a && ar rcs /tmp/linux/tools/perf/libsubcmd.a /tmp/linux/tools/perf/libsubcmd-in.o
ld -r -o /tmp/linux/tools/perf/ui/gtk/gtk-in.o /tmp/linux/tools/perf/ui/gtk/browser.o /tmp/linux/tools/perf/ui/gtk/hists.o /tmp/linux/tools/perf/ui/gtk/setup.o /tmp/linux/tools/perf/ui/gtk/util.o /tmp/linux/tools/perf/ui/gtk/helpline.o /tmp/linux/tools/perf/ui/gtk/progress.o /tmp/linux/tools/perf/ui/gtk/annotate.o
ld -r -o /tmp/linux/tools/perf/gtk-in.o /tmp/linux/tools/perf/ui/gtk/gtk-in.o
PERF_VERSION = 5.3.rc4.g0c3d3d648b3e
touch /tmp/linux/tools/perf/PERF-VERSION-FILE
Makefile.perf:218: recipe for target 'sub-make' failed
make[4]: *** [sub-make] Error 2
Makefile:69: recipe for target 'all' failed
make[3]: *** [all] Error 2
Makefile:80: recipe for target 'perf' failed
make[2]: *** [perf] Error 2
/home/groeck/src/linux-next/Makefile:1756: recipe for target 'tools/perf' failed
make[1]: *** [tools/perf] Error 2
make[1]: Leaving directory '/tmp/linux'
Makefile:179: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

#64 lore raw

Re: [PATCH 28/79] libperf: Add perf_cpu_map struct

Quoted 55 lines · Guenter Roeck
Quoted 33 lines · Jiri Olsa
Quoted 24 lines · Guenter Roeck
Quoted 12 lines · Jiri Olsa

Adding perf_cpu_map struct into libperf.

It's added as a declaration into into:
include/perf/cpumap.h
which will be included by users.

The perf_cpu_map struct definition is added into:
include/internal/cpumap.h

which is not to be included by users, but shared within perf and libperf.

Quoted 6 lines

We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

Hi,

this patch causes out-of-tree builds (make O=<destdir>) to fail.

Quoted 7 lines

In file included from tools/include/asm/atomic.h:6:0,

                 from include/linux/atomic.h:5,
		 from tools/include/linux/refcount.h:41,
		 from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:

fatal error: asm/cmpxchg.h: No such file or directory

Bisect log attached.

Quoted 9 lines

hi,
I dont see any problem with v5.3-rc4, could you please send the full compilation log (after make clean) from:

  $ make V=1 <your options>

also I can't make sense of that bisect, because I can't find some of those commits.. what tree are you in?

This is with -next, not with mainline. More specifically, with next-20190816, though the problem has been seen since at least next-20190801. Mainline builds fine.

Here is the script I used to bisect the problem:

make mrproper
rm -rf /tmp/linux
mkdir /tmp/linux
make ARCH=x86_64 O=/tmp/linux defconfig
make -j40 ARCH=x86_64 O=/tmp/linux tools/perf

Quoted 5 lines

It looks like the problem is related to "ARCH=x86_64". In mainline, x86_64 is replaced in the build command with x86. This is no longer the case, and make now tries to include from tools/arch/x86_64/include/, which doesn't exist. As it turns out, O=<destdir> is not needed to reproduce the problem, only ARCH=x86_64 (or ARCH=i386).

aaargh.. you're right ;-) it's the SRCARCH, which should be used in libperf instead of ARCH

change below fixes that for me

thanks,
jirka

---

tools/perf/lib/Makefile +1 -1
index 8a9ae50818e4..a67efb8d9d39 100644
@@ -59,7 +59,7 @@ else
   CFLAGS := -g -Wall
 endif
 
-INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/ -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/ -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)
#65 lore raw

PATCH 1/1 libperf: Fix arch include paths

On Mon, Aug 19, 2019 at 10:21:37AM +0200, Jiri Olsa wrote:

SNIP

Quoted 17 lines
Quoted 11 lines

next-20190816, though the problem has been seen since at least next-20190801. Mainline builds fine.

Here is the script I used to bisect the problem:

make mrproper
rm -rf /tmp/linux
mkdir /tmp/linux
make ARCH=x86_64 O=/tmp/linux defconfig
make -j40 ARCH=x86_64 O=/tmp/linux tools/perf

Quoted 5 lines

It looks like the problem is related to "ARCH=x86_64". In mainline, x86_64 is replaced in the build command with x86. This is no longer the case, and make now tries to include from tools/arch/x86_64/include/, which doesn't exist. As it turns out, O=<destdir> is not needed to reproduce the problem, only ARCH=x86_64 (or ARCH=i386).

Quoted 4 lines

aaargh.. you're right ;-) it's the SRCARCH, which should be used in libperf instead of ARCH

change below fixes that for me

attaching the full patch

jirka

---
Guenter Roeck reported problem with compilation
when the ARCH is specified:

  $ make ARCH=x86_64
  In file included from tools/include/asm/atomic.h:6:0,
                   from include/linux/atomic.h:5,
                   from tools/include/linux/refcount.h:41,
                   from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:
  fatal error: asm/cmpxchg.h: No such file or directory

The problem is that we don't use SRCARCH (the sanitized ARCH version) and we don't get the proper include path.

---
 tools/perf/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/lib/Makefile +1 -1
index 8a9ae50818e4..a67efb8d9d39 100644
@@ -59,7 +59,7 @@ else
   CFLAGS := -g -Wall
 endif
 
-INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/ -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/ -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)
Signature · 1 line
2.21.0
Tested-by on v1 1/1
#66 lore raw

Re: [PATCH] libperf: Fix arch include paths

Quoted 42 lines · Jiri Olsa

On Mon, Aug 19, 2019 at 10:21:37AM +0200, Jiri Olsa wrote:

SNIP

Quoted 17 lines
Quoted 11 lines

next-20190816, though the problem has been seen since at least next-20190801. Mainline builds fine.

Here is the script I used to bisect the problem:

make mrproper
rm -rf /tmp/linux
mkdir /tmp/linux
make ARCH=x86_64 O=/tmp/linux defconfig
make -j40 ARCH=x86_64 O=/tmp/linux tools/perf

Quoted 5 lines

It looks like the problem is related to "ARCH=x86_64". In mainline, x86_64 is replaced in the build command with x86. This is no longer the case, and make now tries to include from tools/arch/x86_64/include/, which doesn't exist. As it turns out, O=<destdir> is not needed to reproduce the problem, only ARCH=x86_64 (or ARCH=i386).

Quoted 4 lines

aaargh.. you're right ;-) it's the SRCARCH, which should be used in libperf instead of ARCH

change below fixes that for me

attaching the full patch

jirka

---
Guenter Roeck reported problem with compilation
when the ARCH is specified:

   $ make ARCH=x86_64
   In file included from tools/include/asm/atomic.h:6:0,
                    from include/linux/atomic.h:5,
                    from tools/include/linux/refcount.h:41,
                    from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:
   fatal error: asm/cmpxchg.h: No such file or directory
Quoted 6 lines

The problem is that we don't use SRCARCH (the sanitized ARCH version) and we don't get the proper include path.

Quoted 18 lines
---
  tools/perf/lib/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/lib/Makefile +1 -1
index 8a9ae50818e4..a67efb8d9d39 100644
@@ -59,7 +59,7 @@ else
    CFLAGS := -g -Wall
  endif
 
-INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/ -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/ -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
  # Append required CFLAGS
  override CFLAGS += $(EXTRA_WARNINGS)
#67 lore raw

Re: [PATCH] libperf: Fix arch include paths

Em Tue, Aug 20, 2019 at 08:26:45AM -0700, Guenter Roeck escreveu:

Quoted 8 lines · Jiri Olsa
Quoted 5 lines

version) and we don't get the proper include path.

Thanks, and added:

    Fixes: 314350491810 ("libperf: Make libperf.a part of the perf build")

- Arnaldo

merge bot Applied
#68 lore raw

[tip: perf/core] libperf: Fix arch include paths

In reply to Jiri Olsa
The following commit has been merged into the perf/core branch of tip:

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     b81d39c7a1efb83caa3f4419939a46e96191abb6
Gitweb:        https://git.kernel.org/tip/b81d39c7a1efb83caa3f4419939a46e96191abb6
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Tue, 20 Aug 2019 14:46:24 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Tue, 20 Aug 2019 12:29:36 -03:00

libperf: Fix arch include paths

Guenter Roeck reported problem with compilation when the ARCH is specified:

  $ make ARCH=x86_64
  In file included from tools/include/asm/atomic.h:6:0,
                   from include/linux/atomic.h:5,
                   from tools/include/linux/refcount.h:41,
                   from cpumap.c:4: tools/include/asm/../../arch/x86/include/asm/atomic.h:11:10:
  fatal error: asm/cmpxchg.h: No such file or directory

The problem is that we don't use SRCARCH (the sanitized ARCH version) and we don't get the proper include path.

Cc Alexander Shishkin <[email protected]>
Cc Alexey Budankov <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Michael Petlan <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Fixes 314350491810 ("libperf: Make libperf.a part of the perf build")
---
 tools/perf/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/lib/Makefile +1 -1
index 8a9ae50..a67efb8 100644
@@ -59,7 +59,7 @@ else
   CFLAGS := -g -Wall
 endif
 
-INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/ -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi
+INCLUDES = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/ -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
 
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)
author reviewer
#69 lore raw

PATCH 29/79 libperf: Add perf_cpu_map__dummy_new function

In reply to Jiri Olsa

Moving cpu_map__dummy_new into libperf as
perf_cpu_map__dummy_new function.

---
 tools/perf/lib/cpumap.c              | 13 +++++++++++++
 tools/perf/lib/include/perf/cpumap.h |  4 ++++
 tools/perf/lib/libperf.map           |  1 +
 tools/perf/tests/sw-clock.c          |  2 +-
 tools/perf/tests/task-exit.c         |  2 +-
 tools/perf/util/cpumap.c             | 15 +--------------
 tools/perf/util/cpumap.h             |  2 +-
 tools/perf/util/evlist.c             |  2 +-
 tools/perf/util/evsel.c              |  2 +-
 9 files changed, 24 insertions(+), 19 deletions(-)
tools/perf/lib/cpumap.c +13 -0
index 86a199c26f20..80d587ab95aa 100644
@@ -3,3 +3,16 @@
 #include <stdlib.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+
+struct perf_cpu_map *perf_cpu_map__dummy_new(void)
+{
+	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
+
+	if (cpus != NULL) {
+		cpus->nr = 1;
+		cpus->map[0] = -1;
+		refcount_set(&cpus->refcnt, 1);
+	}
+
+	return cpus;
+}
tools/perf/lib/include/perf/cpumap.h +4 -0
index 8355d3ce7d0c..fa1e5aa9d662 100644
@@ -2,6 +2,10 @@
 #ifndef __LIBPERF_CPUMAP_H
 #define __LIBPERF_CPUMAP_H
 
+#include <perf/core.h>
+
 struct perf_cpu_map;
 
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
+
 #endif /* __LIBPERF_CPUMAP_H */
tools/perf/lib/libperf.map +1 -0
index 3536242c545c..65201c6cbe7e 100644
@@ -1,6 +1,7 @@
 LIBPERF_0.0.1 {
 	global:
 		libperf_set_print;
+		perf_cpu_map__dummy_new;
 	local:
 		*;
 };
tools/perf/tests/sw-clock.c +1 -1
index ba033a6e6c0f..c6d3f4488b73 100644
@@ -56,7 +56,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	}
 	evlist__add(evlist, evsel);
 
-	cpus = cpu_map__dummy_new();
+	cpus = perf_cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(getpid());
 	if (!cpus || !threads) {
 		err = -ENOMEM;
tools/perf/tests/task-exit.c +1 -1
index d17effdd55c8..c094fb8cc877 100644
@@ -63,7 +63,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	 * perf_evlist__prepare_workload we'll fill in the only thread
 	 * we're monitoring, the one forked there.
 	 */
-	cpus = cpu_map__dummy_new();
+	cpus = perf_cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(-1);
 	if (!cpus || !threads) {
 		err = -ENOMEM;
tools/perf/util/cpumap.c +1 -14
index 5eb4e1fbb877..acda9bfb4002 100644
@@ -189,7 +189,7 @@ struct perf_cpu_map *cpu_map__new(const char *cpu_list)
 	else if (*cpu_list != '\0')
 		cpus = cpu_map__default_new();
 	else
-		cpus = cpu_map__dummy_new();
+		cpus = perf_cpu_map__dummy_new();
 invalid:
 	free(tmp_cpus);
 out:
@@ -256,19 +256,6 @@ size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp)
 #undef BUFSIZE
 }
 
-struct perf_cpu_map *cpu_map__dummy_new(void)
-{
-	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
-
-	if (cpus != NULL) {
-		cpus->nr = 1;
-		cpus->map[0] = -1;
-		refcount_set(&cpus->refcnt, 1);
-	}
-
-	return cpus;
-}
-
 struct perf_cpu_map *cpu_map__empty_new(int nr)
 {
 	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int) * nr);
tools/perf/util/cpumap.h +1 -1
index c2ba9ae195f7..0ce3f6bd9449 100644
@@ -6,13 +6,13 @@
 #include <stdbool.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+#include <perf/cpumap.h>
 
 #include "perf.h"
 #include "util/debug.h"
 
 struct perf_cpu_map *cpu_map__new(const char *cpu_list);
 struct perf_cpu_map *cpu_map__empty_new(int nr);
-struct perf_cpu_map *cpu_map__dummy_new(void);
 struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data);
 struct perf_cpu_map *cpu_map__read(FILE *file);
 size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size);
tools/perf/util/evlist.c +1 -1
index 1bedec28e58f..461c1e68e9e7 100644
@@ -1086,7 +1086,7 @@ int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
 		return -1;
 
 	if (target__uses_dummy_map(target))
-		cpus = cpu_map__dummy_new();
+		cpus = perf_cpu_map__dummy_new();
 	else
 		cpus = cpu_map__new(target->cpu_list);
 
tools/perf/util/evsel.c +1 -1
index 5aeb7260c8e1..a389752840a9 100644
@@ -1840,7 +1840,7 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
 		static struct perf_cpu_map *empty_cpu_map;
 
 		if (empty_cpu_map == NULL) {
-			empty_cpu_map = cpu_map__dummy_new();
+			empty_cpu_map = perf_cpu_map__dummy_new();
 			if (empty_cpu_map == NULL)
 				return -ENOMEM;
 		}
Signature · 1 line
2.21.0
#70 lore raw

[tip:perf/core] libperf: Add perf_cpu_map__dummy_new() function

libperf: Add perf_cpu_map__dummy_new() function
Commit-ID:  397721e06e52d017cfdd403f63284ed0995d4caf
Gitweb:     https://git.kernel.org/tip/397721e06e52d017cfdd403f63284ed0995d4caf
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:16 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf_cpu_map__dummy_new() function

Move cpu_map__dummy_new() to libperf as perf_cpu_map__dummy_new() function.

---
 tools/perf/lib/cpumap.c              | 13 +++++++++++++
 tools/perf/lib/include/perf/cpumap.h |  4 ++++
 tools/perf/lib/libperf.map           |  1 +
 tools/perf/tests/sw-clock.c          |  2 +-
 tools/perf/tests/task-exit.c         |  2 +-
 tools/perf/util/cpumap.c             | 15 +--------------
 tools/perf/util/cpumap.h             |  2 +-
 tools/perf/util/evlist.c             |  2 +-
 tools/perf/util/evsel.c              |  2 +-
 9 files changed, 24 insertions(+), 19 deletions(-)
tools/perf/lib/cpumap.c +13 -0
index 86a199c26f20..80d587ab95aa 100644
@@ -3,3 +3,16 @@
 #include <stdlib.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+
+struct perf_cpu_map *perf_cpu_map__dummy_new(void)
+{
+	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
+
+	if (cpus != NULL) {
+		cpus->nr = 1;
+		cpus->map[0] = -1;
+		refcount_set(&cpus->refcnt, 1);
+	}
+
+	return cpus;
+}
tools/perf/lib/include/perf/cpumap.h +4 -0
index 8355d3ce7d0c..fa1e5aa9d662 100644
@@ -2,6 +2,10 @@
 #ifndef __LIBPERF_CPUMAP_H
 #define __LIBPERF_CPUMAP_H
 
+#include <perf/core.h>
+
 struct perf_cpu_map;
 
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
+
 #endif /* __LIBPERF_CPUMAP_H */
tools/perf/lib/libperf.map +1 -0
index 3536242c545c..65201c6cbe7e 100644
@@ -1,6 +1,7 @@
 LIBPERF_0.0.1 {
 	global:
 		libperf_set_print;
+		perf_cpu_map__dummy_new;
 	local:
 		*;
 };
tools/perf/tests/sw-clock.c +1 -1
index ba033a6e6c0f..c6d3f4488b73 100644
@@ -56,7 +56,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	}
 	evlist__add(evlist, evsel);
 
-	cpus = cpu_map__dummy_new();
+	cpus = perf_cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(getpid());
 	if (!cpus || !threads) {
 		err = -ENOMEM;
tools/perf/tests/task-exit.c +1 -1
index d17effdd55c8..c094fb8cc877 100644
@@ -63,7 +63,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	 * perf_evlist__prepare_workload we'll fill in the only thread
 	 * we're monitoring, the one forked there.
 	 */
-	cpus = cpu_map__dummy_new();
+	cpus = perf_cpu_map__dummy_new();
 	threads = thread_map__new_by_tid(-1);
 	if (!cpus || !threads) {
 		err = -ENOMEM;
tools/perf/util/cpumap.c +1 -14
index 5eb4e1fbb877..acda9bfb4002 100644
@@ -189,7 +189,7 @@ struct perf_cpu_map *cpu_map__new(const char *cpu_list)
 	else if (*cpu_list != '\0')
 		cpus = cpu_map__default_new();
 	else
-		cpus = cpu_map__dummy_new();
+		cpus = perf_cpu_map__dummy_new();
 invalid:
 	free(tmp_cpus);
 out:
@@ -256,19 +256,6 @@ size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp)
 #undef BUFSIZE
 }
 
-struct perf_cpu_map *cpu_map__dummy_new(void)
-{
-	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
-
-	if (cpus != NULL) {
-		cpus->nr = 1;
-		cpus->map[0] = -1;
-		refcount_set(&cpus->refcnt, 1);
-	}
-
-	return cpus;
-}
-
 struct perf_cpu_map *cpu_map__empty_new(int nr)
 {
 	struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int) * nr);
tools/perf/util/cpumap.h +1 -1
index c2ba9ae195f7..0ce3f6bd9449 100644
@@ -6,13 +6,13 @@
 #include <stdbool.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+#include <perf/cpumap.h>
 
 #include "perf.h"
 #include "util/debug.h"
 
 struct perf_cpu_map *cpu_map__new(const char *cpu_list);
 struct perf_cpu_map *cpu_map__empty_new(int nr);
-struct perf_cpu_map *cpu_map__dummy_new(void);
 struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data);
 struct perf_cpu_map *cpu_map__read(FILE *file);
 size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size);
tools/perf/util/evlist.c +1 -1
index 1bedec28e58f..461c1e68e9e7 100644
@@ -1086,7 +1086,7 @@ int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
 		return -1;
 
 	if (target__uses_dummy_map(target))
-		cpus = cpu_map__dummy_new();
+		cpus = perf_cpu_map__dummy_new();
 	else
 		cpus = cpu_map__new(target->cpu_list);
 
tools/perf/util/evsel.c +1 -1
index 5aeb7260c8e1..a389752840a9 100644
@@ -1840,7 +1840,7 @@ int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus,
 		static struct perf_cpu_map *empty_cpu_map;
 
 		if (empty_cpu_map == NULL) {
-			empty_cpu_map = cpu_map__dummy_new();
+			empty_cpu_map = perf_cpu_map__dummy_new();
 			if (empty_cpu_map == NULL)
 				return -ENOMEM;
 		}
author reviewer
#71 lore raw

PATCH 30/79 libperf: Add perf_cpu_map__get/perf_cpu_map__put

In reply to Jiri Olsa

Moving following functions:
cpu_map__get
cpu_map__put

under libperf with following names:
perf_cpu_map__get
perf_cpu_map__put

---
 tools/perf/builtin-ftrace.c                |  2 +-
 tools/perf/builtin-stat.c                  |  4 ++--
 tools/perf/lib/cpumap.c                    | 24 ++++++++++++++++++++++
 tools/perf/lib/include/perf/cpumap.h       |  2 ++
 tools/perf/lib/libperf.map                 |  2 ++
 tools/perf/tests/bitmap.c                  |  2 +-
 tools/perf/tests/code-reading.c            |  4 ++--
 tools/perf/tests/cpumap.c                  |  8 ++++----
 tools/perf/tests/event-times.c             |  4 ++--
 tools/perf/tests/event_update.c            |  4 ++--
 tools/perf/tests/keep-tracking.c           |  2 +-
 tools/perf/tests/mem2node.c                |  2 +-
 tools/perf/tests/mmap-basic.c              |  2 +-
 tools/perf/tests/openat-syscall-all-cpus.c |  2 +-
 tools/perf/tests/sw-clock.c                |  2 +-
 tools/perf/tests/switch-tracking.c         |  2 +-
 tools/perf/tests/task-exit.c               |  2 +-
 tools/perf/tests/topology.c                |  2 +-
 tools/perf/util/cpumap.c                   | 22 --------------------
 tools/perf/util/cpumap.h                   |  3 ---
 tools/perf/util/cputopo.c                  |  4 ++--
 tools/perf/util/env.c                      |  2 +-
 tools/perf/util/event.c                    |  2 +-
 tools/perf/util/evlist.c                   | 16 +++++++--------
 tools/perf/util/evsel.c                    |  4 ++--
 tools/perf/util/parse-events.c             |  4 ++--
 tools/perf/util/pmu.c                      |  2 +-
 tools/perf/util/python.c                   |  2 +-
 tools/perf/util/record.c                   |  6 +++---
 tools/perf/util/session.c                  |  2 +-
 tools/perf/util/svghelper.c                |  2 +-
 31 files changed, 73 insertions(+), 70 deletions(-)
tools/perf/builtin-ftrace.c +1 -1
index 105ef2a17a9c..6943352b8d94 100644
@@ -206,7 +206,7 @@ static int reset_tracing_cpu(void)
 	int ret;
 
 	ret = set_tracing_cpumask(cpumap);
-	cpu_map__put(cpumap);
+	perf_cpu_map__put(cpumap);
 	return ret;
 }
 
tools/perf/builtin-stat.c +2 -2
index 36e66a4f3c57..39bd73d0e06e 100644
@@ -933,8 +933,8 @@ static int perf_stat_init_aggr_mode(void)
 
 static void perf_stat__exit_aggr_mode(void)
 {
-	cpu_map__put(stat_config.aggr_map);
-	cpu_map__put(stat_config.cpus_aggr_map);
+	perf_cpu_map__put(stat_config.aggr_map);
+	perf_cpu_map__put(stat_config.cpus_aggr_map);
 	stat_config.aggr_map = NULL;
 	stat_config.cpus_aggr_map = NULL;
 }
tools/perf/lib/cpumap.c +24 -0
index 80d587ab95aa..f3cfb4c71106 100644
@@ -3,6 +3,8 @@
 #include <stdlib.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+#include <asm/bug.h>
+#include <stdio.h>
 
 struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 {
@@ -16,3 +18,25 @@ struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 
 	return cpus;
 }
+
+static void cpu_map__delete(struct perf_cpu_map *map)
+{
+	if (map) {
+		WARN_ONCE(refcount_read(&map->refcnt) != 0,
+			  "cpu_map refcnt unbalanced\n");
+		free(map);
+	}
+}
+
+struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
+{
+	if (map)
+		refcount_inc(&map->refcnt);
+	return map;
+}
+
+void perf_cpu_map__put(struct perf_cpu_map *map)
+{
+	if (map && refcount_dec_and_test(&map->refcnt))
+		cpu_map__delete(map);
+}
tools/perf/lib/include/perf/cpumap.h +2 -0
index fa1e5aa9d662..e16c2515a499 100644
@@ -7,5 +7,7 @@
 struct perf_cpu_map;
 
 LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
+LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
 
 #endif /* __LIBPERF_CPUMAP_H */
tools/perf/lib/libperf.map +2 -0
index 65201c6cbe7e..76ce3bc59dd8 100644
@@ -2,6 +2,8 @@ LIBPERF_0.0.1 {
 	global:
 		libperf_set_print;
 		perf_cpu_map__dummy_new;
+		perf_cpu_map__get;
+		perf_cpu_map__put;
 	local:
 		*;
 };
tools/perf/tests/bitmap.c +1 -1
index 74d0cd32a5c4..95304d29092e 100644
@@ -21,7 +21,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
 	}
 
 	if (map)
-		cpu_map__put(map);
+		perf_cpu_map__put(map);
 	return bm;
 }
 
tools/perf/tests/code-reading.c +2 -2
index ec4b0bf28270..ce2d3266286a 100644
@@ -655,7 +655,7 @@ static int do_test_code_reading(bool try_kcore)
 				 * and will be freed by following perf_evlist__set_maps
 				 * call. Getting refference to keep them alive.
 				 */
-				cpu_map__get(cpus);
+				perf_cpu_map__get(cpus);
 				thread_map__get(threads);
 				perf_evlist__set_maps(evlist, NULL, NULL);
 				evlist__delete(evlist);
@@ -705,7 +705,7 @@ static int do_test_code_reading(bool try_kcore)
 	if (evlist) {
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 	machine__delete_threads(machine);
tools/perf/tests/cpumap.c +4 -4
index 10da4400493d..6c921087b0fe 100644
@@ -39,7 +39,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 		TEST_ASSERT_VAL("wrong cpu", map->map[i] == i);
 	}
 
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -68,7 +68,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 	TEST_ASSERT_VAL("wrong cpu", map->map[0] == 1);
 	TEST_ASSERT_VAL("wrong cpu", map->map[1] == 256);
 	TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -83,7 +83,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
 	TEST_ASSERT_VAL("failed to synthesize map",
 		!perf_event__synthesize_cpu_map(NULL, cpus, process_event_mask, NULL));
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	/* This one is better stores in cpu values. */
 	cpus = cpu_map__new("1,256");
@@ -91,7 +91,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
 	TEST_ASSERT_VAL("failed to synthesize map",
 		!perf_event__synthesize_cpu_map(NULL, cpus, process_event_cpus, NULL));
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return 0;
 }
 
tools/perf/tests/event-times.c +2 -2
index bf00d3d792fb..dcfff4b20c92 100644
@@ -132,7 +132,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
 		return err;
 	}
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return evsel__enable(evsel);
 }
 
@@ -154,7 +154,7 @@ static int attach__cpu_enabled(struct evlist *evlist)
 	if (err == -EACCES)
 		return TEST_SKIP;
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return err ? TEST_FAIL : TEST_OK;
 }
 
tools/perf/tests/event_update.c +2 -2
index eb0dd359762d..415d12e96834 100644
@@ -73,7 +73,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 	TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1);
 	TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
 	TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -113,6 +113,6 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu
 	TEST_ASSERT_VAL("failed to synthesize attr update cpus",
 			!perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus));
 
-	cpu_map__put(evsel->own_cpus);
+	perf_cpu_map__put(evsel->own_cpus);
 	return 0;
 }
tools/perf/tests/keep-tracking.c +1 -1
index 7bfc859971e5..43e55fe98f8c 100644
@@ -149,7 +149,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
 		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 
tools/perf/tests/mem2node.c +1 -1
index e12eedfba781..6fe2c1e7918b 100644
@@ -32,7 +32,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
 	}
 
 	if (map)
-		cpu_map__put(map);
+		perf_cpu_map__put(map);
 	else
 		free(bm);
 
tools/perf/tests/mmap-basic.c +1 -1
index 40511025208f..d15282174b2e 100644
@@ -155,7 +155,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
 	cpus	= NULL;
 	threads = NULL;
 out_free_cpus:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 out_free_threads:
 	thread_map__put(threads);
 	return err;
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index f96cbd304024..611f6ea9b702 100644
@@ -120,7 +120,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
 out_evsel_delete:
 	evsel__delete(evsel);
 out_cpu_map_delete:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 out_thread_map_delete:
 	thread_map__put(threads);
 	return err;
tools/perf/tests/sw-clock.c +1 -1
index c6d3f4488b73..c464e301ade9 100644
@@ -125,7 +125,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	}
 
 out_free_maps:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
 	evlist__delete(evlist);
tools/perf/tests/switch-tracking.c +1 -1
index d5537edb47db..27af7b7109a3 100644
@@ -569,7 +569,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
 		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 
tools/perf/tests/task-exit.c +1 -1
index c094fb8cc877..f026759a05d7 100644
@@ -135,7 +135,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
 	}
 
 out_free_maps:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
 	evlist__delete(evlist);
tools/perf/tests/topology.c +1 -1
index 443d0272ebbd..1b57ded58d59 100644
@@ -133,7 +133,7 @@ int test__session_topology(struct test *test __maybe_unused, int subtest __maybe
 	}
 
 	ret = check_cpu_topology(path, map);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 
 free_path:
 	unlink(path);
tools/perf/util/cpumap.c +0 -22
index acda9bfb4002..44082e5eabde 100644
@@ -273,28 +273,6 @@ struct perf_cpu_map *cpu_map__empty_new(int nr)
 	return cpus;
 }
 
-static void cpu_map__delete(struct perf_cpu_map *map)
-{
-	if (map) {
-		WARN_ONCE(refcount_read(&map->refcnt) != 0,
-			  "cpu_map refcnt unbalanced\n");
-		free(map);
-	}
-}
-
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map)
-{
-	if (map)
-		refcount_inc(&map->refcnt);
-	return map;
-}
-
-void cpu_map__put(struct perf_cpu_map *map)
-{
-	if (map && refcount_dec_and_test(&map->refcnt))
-		cpu_map__delete(map);
-}
-
 static int cpu__get_topology_int(int cpu, const char *name, int *value)
 {
 	char path[PATH_MAX];
tools/perf/util/cpumap.h +0 -3
index 0ce3f6bd9449..b7af2cb68c19 100644
@@ -29,9 +29,6 @@ int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct perf_cpu_map **diep
 int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep);
 const struct perf_cpu_map *cpu_map__online(void); /* thread unsafe */
 
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map);
-void cpu_map__put(struct perf_cpu_map *map);
-
 static inline int cpu_map__socket(struct perf_cpu_map *sock, int s)
 {
 	if (!sock || s > sock->nr || s < 0)
tools/perf/util/cputopo.c +2 -2
index 157b0988435e..0cd99c460cd4 100644
@@ -219,7 +219,7 @@ struct cpu_topology *cpu_topology__new(void)
 	}
 
 out_free:
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	if (ret) {
 		cpu_topology__delete(tp);
 		tp = NULL;
@@ -335,7 +335,7 @@ struct numa_topology *numa_topology__new(void)
 out:
 	free(buf);
 	fclose(fp);
-	cpu_map__put(node_map);
+	perf_cpu_map__put(node_map);
 	return tp;
 }
 
tools/perf/util/env.c +1 -1
index 9909ec40c6d2..d77912b2b5e7 100644
@@ -179,7 +179,7 @@ void perf_env__exit(struct perf_env *env)
 	zfree(&env->cpu);
 
 	for (i = 0; i < env->nr_numa_nodes; i++)
-		cpu_map__put(env->numa_nodes[i].map);
+		perf_cpu_map__put(env->numa_nodes[i].map);
 	zfree(&env->numa_nodes);
 
 	for (i = 0; i < env->caches_cnt; i++)
tools/perf/util/event.c +1 -1
index f78837788b14..1a3db35f9f7d 100644
@@ -1403,7 +1403,7 @@ size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp)
 	else
 		ret += fprintf(fp, "failed to get cpumap from event\n");
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return ret;
 }
 
tools/perf/util/evlist.c +8 -8
index 461c1e68e9e7..35020d50f51e 100644
@@ -141,7 +141,7 @@ void evlist__delete(struct evlist *evlist)
 
 	perf_evlist__munmap(evlist);
 	evlist__close(evlist);
-	cpu_map__put(evlist->cpus);
+	perf_cpu_map__put(evlist->cpus);
 	thread_map__put(evlist->threads);
 	evlist->cpus = NULL;
 	evlist->threads = NULL;
@@ -158,11 +158,11 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
 	 * keep it, if there's no target cpu list defined.
 	 */
 	if (!evsel->own_cpus || evlist->has_user_cpus) {
-		cpu_map__put(evsel->cpus);
-		evsel->cpus = cpu_map__get(evlist->cpus);
+		perf_cpu_map__put(evsel->cpus);
+		evsel->cpus = perf_cpu_map__get(evlist->cpus);
 	} else if (evsel->cpus != evsel->own_cpus) {
-		cpu_map__put(evsel->cpus);
-		evsel->cpus = cpu_map__get(evsel->own_cpus);
+		perf_cpu_map__put(evsel->cpus);
+		evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
 	}
 
 	thread_map__put(evsel->threads);
@@ -1115,8 +1115,8 @@ void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
 	 * the caller to increase the reference count.
 	 */
 	if (cpus != evlist->cpus) {
-		cpu_map__put(evlist->cpus);
-		evlist->cpus = cpu_map__get(cpus);
+		perf_cpu_map__put(evlist->cpus);
+		evlist->cpus = perf_cpu_map__get(cpus);
 	}
 
 	if (threads != evlist->threads) {
@@ -1383,7 +1383,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 out:
 	return err;
 out_put:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	goto out;
 }
 
tools/perf/util/evsel.c +2 -2
index a389752840a9..72c0e6948e83 100644
@@ -1325,8 +1325,8 @@ void perf_evsel__exit(struct evsel *evsel)
 	perf_evsel__free_id(evsel);
 	perf_evsel__free_config_terms(evsel);
 	cgroup__put(evsel->cgrp);
-	cpu_map__put(evsel->cpus);
-	cpu_map__put(evsel->own_cpus);
+	perf_cpu_map__put(evsel->cpus);
+	perf_cpu_map__put(evsel->own_cpus);
 	thread_map__put(evsel->threads);
 	zfree(&evsel->group_name);
 	zfree(&evsel->name);
tools/perf/util/parse-events.c +2 -2
index decb66d243ca..8c9928feb38a 100644
@@ -332,8 +332,8 @@ __add_event(struct list_head *list, int *idx,
 		return NULL;
 
 	(*idx)++;
-	evsel->cpus        = cpu_map__get(cpus);
-	evsel->own_cpus    = cpu_map__get(cpus);
+	evsel->cpus        = perf_cpu_map__get(cpus);
+	evsel->own_cpus    = perf_cpu_map__get(cpus);
 	evsel->system_wide = pmu ? pmu->is_uncore : false;
 	evsel->auto_merge_stats = auto_merge_stats;
 
tools/perf/util/pmu.c +1 -1
index 4929a50c0973..d355f9506a1c 100644
@@ -626,7 +626,7 @@ static bool pmu_is_uncore(const char *name)
 
 	snprintf(path, PATH_MAX, CPUS_TEMPLATE_UNCORE, sysfs, name);
 	cpus = __pmu_cpumask(path);
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	return !!cpus;
 }
tools/perf/util/python.c +1 -1
index cc4af99ab190..677c93f91c6c 100644
@@ -557,7 +557,7 @@ static int pyrf_cpu_map__init(struct pyrf_cpu_map *pcpus,
 
 static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus)
 {
-	cpu_map__put(pcpus->cpus);
+	perf_cpu_map__put(pcpus->cpus);
 	Py_TYPE(pcpus)->tp_free((PyObject*)pcpus);
 }
 
tools/perf/util/record.c +3 -3
index 9f8841548539..fecccfd71aa1 100644
@@ -67,7 +67,7 @@ static bool perf_probe_api(setup_probe_fn_t fn)
 	if (!cpus)
 		return false;
 	cpu = cpus->map[0];
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	do {
 		ret = perf_do_probe_api(fn, cpu, try[i++]);
@@ -122,7 +122,7 @@ bool perf_can_record_cpu_wide(void)
 	if (!cpus)
 		return false;
 	cpu = cpus->map[0];
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	fd = sys_perf_event_open(&attr, -1, cpu, -1, 0);
 	if (fd < 0)
@@ -278,7 +278,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 		struct perf_cpu_map *cpus = cpu_map__new(NULL);
 
 		cpu =  cpus ? cpus->map[0] : 0;
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 	} else {
 		cpu = evlist->cpus->map[0];
 	}
tools/perf/util/session.c +1 -1
index c191dc152175..62d37440cbee 100644
@@ -2310,7 +2310,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
 	err = 0;
 
 out_delete_map:
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return err;
 }
 
tools/perf/util/svghelper.c +1 -1
index 99132c6a30a6..a9ca5c4fffee 100644
@@ -745,7 +745,7 @@ static int str_to_bitmap(char *s, cpumask_t *b)
 		set_bit(c, cpumask_bits(b));
 	}
 
-	cpu_map__put(m);
+	perf_cpu_map__put(m);
 
 	return ret;
 }
Signature · 1 line
2.21.0
#72 lore raw

[tip:perf/core] libperf: Add perf_cpu_map__get()/perf_cpu_map__put()

libperf: Add perf_cpu_map__get()/perf_cpu_map__put()
Commit-ID:  38f01d8da1d8d28678ea16a0a484f4d3eded34b2
Gitweb:     https://git.kernel.org/tip/38f01d8da1d8d28678ea16a0a484f4d3eded34b2
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:17 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf_cpu_map__get()/perf_cpu_map__put()

Moving the following functions:

cpu_map__get()
cpu_map__put()

to libperf with following names:

perf_cpu_map__get()
perf_cpu_map__put()

Committer notes:

Added fixes for arm/arm64

---
 tools/perf/arch/arm/util/cs-etm.c          |  6 +++---
 tools/perf/arch/arm64/util/header.c        |  4 ++--
 tools/perf/builtin-ftrace.c                |  2 +-
 tools/perf/builtin-stat.c                  |  4 ++--
 tools/perf/lib/cpumap.c                    | 24 ++++++++++++++++++++++++
 tools/perf/lib/include/perf/cpumap.h       |  2 ++
 tools/perf/lib/libperf.map                 |  2 ++
 tools/perf/tests/bitmap.c                  |  2 +-
 tools/perf/tests/code-reading.c            |  4 ++--
 tools/perf/tests/cpumap.c                  |  8 ++++----
 tools/perf/tests/event-times.c             |  4 ++--
 tools/perf/tests/event_update.c            |  4 ++--
 tools/perf/tests/keep-tracking.c           |  2 +-
 tools/perf/tests/mem2node.c                |  2 +-
 tools/perf/tests/mmap-basic.c              |  2 +-
 tools/perf/tests/openat-syscall-all-cpus.c |  2 +-
 tools/perf/tests/sw-clock.c                |  2 +-
 tools/perf/tests/switch-tracking.c         |  2 +-
 tools/perf/tests/task-exit.c               |  2 +-
 tools/perf/tests/topology.c                |  2 +-
 tools/perf/util/cpumap.c                   | 22 ----------------------
 tools/perf/util/cpumap.h                   |  3 ---
 tools/perf/util/cputopo.c                  |  4 ++--
 tools/perf/util/env.c                      |  2 +-
 tools/perf/util/event.c                    |  2 +-
 tools/perf/util/evlist.c                   | 16 ++++++++--------
 tools/perf/util/evsel.c                    |  4 ++--
 tools/perf/util/parse-events.c             |  4 ++--
 tools/perf/util/pmu.c                      |  2 +-
 tools/perf/util/python.c                   |  2 +-
 tools/perf/util/record.c                   |  6 +++---
 tools/perf/util/session.c                  |  2 +-
 tools/perf/util/svghelper.c                |  2 +-
 33 files changed, 78 insertions(+), 75 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +3 -3
index 268fcb31cd53..3a78b38e43ca 100644
@@ -181,7 +181,7 @@ static int cs_etm_set_option(struct auxtrace_record *itr,
 
 	err = 0;
 out:
-	cpu_map__put(online_cpus);
+	perf_cpu_map__put(online_cpus);
 	return err;
 }
 
@@ -517,7 +517,7 @@ cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 		}
 	}
 
-	cpu_map__put(online_cpus);
+	perf_cpu_map__put(online_cpus);
 
 	return (CS_ETM_HEADER_SIZE +
 	       (etmv4 * CS_ETMV4_PRIV_SIZE) +
@@ -679,7 +679,7 @@ static int cs_etm_info_fill(struct auxtrace_record *itr,
 		if (cpu_map__has(cpu_map, i))
 			cs_etm_get_metadata(i, &offset, itr, info);
 
-	cpu_map__put(online_cpus);
+	perf_cpu_map__put(online_cpus);
 
 	return 0;
 }
tools/perf/arch/arm64/util/header.c +2 -2
index b3e73a413f5a..602caf550e7f 100644
@@ -27,7 +27,7 @@ char *get_cpuid_str(struct perf_pmu *pmu)
 		return NULL;
 
 	/* read midr from list of cpus mapped to this pmu */
-	cpus = cpu_map__get(pmu->cpus);
+	cpus = perf_cpu_map__get(pmu->cpus);
 	for (cpu = 0; cpu < cpus->nr; cpu++) {
 		scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
 				sysfs, cpus->map[cpu]);
@@ -60,6 +60,6 @@ char *get_cpuid_str(struct perf_pmu *pmu)
 		buf = NULL;
 	}
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return buf;
 }
tools/perf/builtin-ftrace.c +1 -1
index 105ef2a17a9c..6943352b8d94 100644
@@ -206,7 +206,7 @@ static int reset_tracing_cpu(void)
 	int ret;
 
 	ret = set_tracing_cpumask(cpumap);
-	cpu_map__put(cpumap);
+	perf_cpu_map__put(cpumap);
 	return ret;
 }
 
tools/perf/builtin-stat.c +2 -2
index 36e66a4f3c57..39bd73d0e06e 100644
@@ -933,8 +933,8 @@ static int perf_stat_init_aggr_mode(void)
 
 static void perf_stat__exit_aggr_mode(void)
 {
-	cpu_map__put(stat_config.aggr_map);
-	cpu_map__put(stat_config.cpus_aggr_map);
+	perf_cpu_map__put(stat_config.aggr_map);
+	perf_cpu_map__put(stat_config.cpus_aggr_map);
 	stat_config.aggr_map = NULL;
 	stat_config.cpus_aggr_map = NULL;
 }
tools/perf/lib/cpumap.c +24 -0
index 80d587ab95aa..f3cfb4c71106 100644
@@ -3,6 +3,8 @@
 #include <stdlib.h>
 #include <linux/refcount.h>
 #include <internal/cpumap.h>
+#include <asm/bug.h>
+#include <stdio.h>
 
 struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 {
@@ -16,3 +18,25 @@ struct perf_cpu_map *perf_cpu_map__dummy_new(void)
 
 	return cpus;
 }
+
+static void cpu_map__delete(struct perf_cpu_map *map)
+{
+	if (map) {
+		WARN_ONCE(refcount_read(&map->refcnt) != 0,
+			  "cpu_map refcnt unbalanced\n");
+		free(map);
+	}
+}
+
+struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
+{
+	if (map)
+		refcount_inc(&map->refcnt);
+	return map;
+}
+
+void perf_cpu_map__put(struct perf_cpu_map *map)
+{
+	if (map && refcount_dec_and_test(&map->refcnt))
+		cpu_map__delete(map);
+}
tools/perf/lib/include/perf/cpumap.h +2 -0
index fa1e5aa9d662..e16c2515a499 100644
@@ -7,5 +7,7 @@
 struct perf_cpu_map;
 
 LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
+LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
 
 #endif /* __LIBPERF_CPUMAP_H */
tools/perf/lib/libperf.map +2 -0
index 65201c6cbe7e..76ce3bc59dd8 100644
@@ -2,6 +2,8 @@ LIBPERF_0.0.1 {
 	global:
 		libperf_set_print;
 		perf_cpu_map__dummy_new;
+		perf_cpu_map__get;
+		perf_cpu_map__put;
 	local:
 		*;
 };
tools/perf/tests/bitmap.c +1 -1
index 74d0cd32a5c4..95304d29092e 100644
@@ -21,7 +21,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
 	}
 
 	if (map)
-		cpu_map__put(map);
+		perf_cpu_map__put(map);
 	return bm;
 }
 
tools/perf/tests/code-reading.c +2 -2
index ec4b0bf28270..ce2d3266286a 100644
@@ -655,7 +655,7 @@ static int do_test_code_reading(bool try_kcore)
 				 * and will be freed by following perf_evlist__set_maps
 				 * call. Getting refference to keep them alive.
 				 */
-				cpu_map__get(cpus);
+				perf_cpu_map__get(cpus);
 				thread_map__get(threads);
 				perf_evlist__set_maps(evlist, NULL, NULL);
 				evlist__delete(evlist);
@@ -705,7 +705,7 @@ out_err:
 	if (evlist) {
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 	machine__delete_threads(machine);
tools/perf/tests/cpumap.c +4 -4
index 10da4400493d..6c921087b0fe 100644
@@ -39,7 +39,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 		TEST_ASSERT_VAL("wrong cpu", map->map[i] == i);
 	}
 
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -68,7 +68,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 	TEST_ASSERT_VAL("wrong cpu", map->map[0] == 1);
 	TEST_ASSERT_VAL("wrong cpu", map->map[1] == 256);
 	TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -83,7 +83,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
 	TEST_ASSERT_VAL("failed to synthesize map",
 		!perf_event__synthesize_cpu_map(NULL, cpus, process_event_mask, NULL));
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	/* This one is better stores in cpu values. */
 	cpus = cpu_map__new("1,256");
@@ -91,7 +91,7 @@ int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __may
 	TEST_ASSERT_VAL("failed to synthesize map",
 		!perf_event__synthesize_cpu_map(NULL, cpus, process_event_cpus, NULL));
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return 0;
 }
 
tools/perf/tests/event-times.c +2 -2
index bf00d3d792fb..dcfff4b20c92 100644
@@ -132,7 +132,7 @@ static int attach__cpu_disabled(struct evlist *evlist)
 		return err;
 	}
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return evsel__enable(evsel);
 }
 
@@ -154,7 +154,7 @@ static int attach__cpu_enabled(struct evlist *evlist)
 	if (err == -EACCES)
 		return TEST_SKIP;
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return err ? TEST_FAIL : TEST_OK;
 }
 
tools/perf/tests/event_update.c +2 -2
index eb0dd359762d..415d12e96834 100644
@@ -73,7 +73,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 	TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1);
 	TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
 	TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return 0;
 }
 
@@ -113,6 +113,6 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu
 	TEST_ASSERT_VAL("failed to synthesize attr update cpus",
 			!perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus));
 
-	cpu_map__put(evsel->own_cpus);
+	perf_cpu_map__put(evsel->own_cpus);
 	return 0;
 }
tools/perf/tests/keep-tracking.c +1 -1
index 7bfc859971e5..43e55fe98f8c 100644
@@ -149,7 +149,7 @@ out_err:
 		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 
tools/perf/tests/mem2node.c +1 -1
index e12eedfba781..6fe2c1e7918b 100644
@@ -32,7 +32,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
 	}
 
 	if (map)
-		cpu_map__put(map);
+		perf_cpu_map__put(map);
 	else
 		free(bm);
 
tools/perf/tests/mmap-basic.c +1 -1
index 40511025208f..d15282174b2e 100644
@@ -155,7 +155,7 @@ out_delete_evlist:
 	cpus	= NULL;
 	threads = NULL;
 out_free_cpus:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 out_free_threads:
 	thread_map__put(threads);
 	return err;
tools/perf/tests/openat-syscall-all-cpus.c +1 -1
index f96cbd304024..611f6ea9b702 100644
@@ -120,7 +120,7 @@ out_close_fd:
 out_evsel_delete:
 	evsel__delete(evsel);
 out_cpu_map_delete:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 out_thread_map_delete:
 	thread_map__put(threads);
 	return err;
tools/perf/tests/sw-clock.c +1 -1
index c6d3f4488b73..c464e301ade9 100644
@@ -125,7 +125,7 @@ out_init:
 	}
 
 out_free_maps:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
 	evlist__delete(evlist);
tools/perf/tests/switch-tracking.c +1 -1
index d5537edb47db..27af7b7109a3 100644
@@ -569,7 +569,7 @@ out:
 		evlist__disable(evlist);
 		evlist__delete(evlist);
 	} else {
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 		thread_map__put(threads);
 	}
 
tools/perf/tests/task-exit.c +1 -1
index c094fb8cc877..f026759a05d7 100644
@@ -135,7 +135,7 @@ out_init:
 	}
 
 out_free_maps:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	thread_map__put(threads);
 out_delete_evlist:
 	evlist__delete(evlist);
tools/perf/tests/topology.c +1 -1
index 443d0272ebbd..1b57ded58d59 100644
@@ -133,7 +133,7 @@ int test__session_topology(struct test *test __maybe_unused, int subtest __maybe
 	}
 
 	ret = check_cpu_topology(path, map);
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 
 free_path:
 	unlink(path);
tools/perf/util/cpumap.c +0 -22
index acda9bfb4002..44082e5eabde 100644
@@ -273,28 +273,6 @@ struct perf_cpu_map *cpu_map__empty_new(int nr)
 	return cpus;
 }
 
-static void cpu_map__delete(struct perf_cpu_map *map)
-{
-	if (map) {
-		WARN_ONCE(refcount_read(&map->refcnt) != 0,
-			  "cpu_map refcnt unbalanced\n");
-		free(map);
-	}
-}
-
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map)
-{
-	if (map)
-		refcount_inc(&map->refcnt);
-	return map;
-}
-
-void cpu_map__put(struct perf_cpu_map *map)
-{
-	if (map && refcount_dec_and_test(&map->refcnt))
-		cpu_map__delete(map);
-}
-
 static int cpu__get_topology_int(int cpu, const char *name, int *value)
 {
 	char path[PATH_MAX];
tools/perf/util/cpumap.h +0 -3
index 0ce3f6bd9449..b7af2cb68c19 100644
@@ -29,9 +29,6 @@ int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct perf_cpu_map **diep
 int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep);
 const struct perf_cpu_map *cpu_map__online(void); /* thread unsafe */
 
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map);
-void cpu_map__put(struct perf_cpu_map *map);
-
 static inline int cpu_map__socket(struct perf_cpu_map *sock, int s)
 {
 	if (!sock || s > sock->nr || s < 0)
tools/perf/util/cputopo.c +2 -2
index 157b0988435e..0cd99c460cd4 100644
@@ -219,7 +219,7 @@ struct cpu_topology *cpu_topology__new(void)
 	}
 
 out_free:
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	if (ret) {
 		cpu_topology__delete(tp);
 		tp = NULL;
@@ -335,7 +335,7 @@ struct numa_topology *numa_topology__new(void)
 out:
 	free(buf);
 	fclose(fp);
-	cpu_map__put(node_map);
+	perf_cpu_map__put(node_map);
 	return tp;
 }
 
tools/perf/util/env.c +1 -1
index 9909ec40c6d2..d77912b2b5e7 100644
@@ -179,7 +179,7 @@ void perf_env__exit(struct perf_env *env)
 	zfree(&env->cpu);
 
 	for (i = 0; i < env->nr_numa_nodes; i++)
-		cpu_map__put(env->numa_nodes[i].map);
+		perf_cpu_map__put(env->numa_nodes[i].map);
 	zfree(&env->numa_nodes);
 
 	for (i = 0; i < env->caches_cnt; i++)
tools/perf/util/event.c +1 -1
index f78837788b14..1a3db35f9f7d 100644
@@ -1403,7 +1403,7 @@ size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp)
 	else
 		ret += fprintf(fp, "failed to get cpumap from event\n");
 
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	return ret;
 }
 
tools/perf/util/evlist.c +8 -8
index 461c1e68e9e7..35020d50f51e 100644
@@ -141,7 +141,7 @@ void evlist__delete(struct evlist *evlist)
 
 	perf_evlist__munmap(evlist);
 	evlist__close(evlist);
-	cpu_map__put(evlist->cpus);
+	perf_cpu_map__put(evlist->cpus);
 	thread_map__put(evlist->threads);
 	evlist->cpus = NULL;
 	evlist->threads = NULL;
@@ -158,11 +158,11 @@ static void __perf_evlist__propagate_maps(struct evlist *evlist,
 	 * keep it, if there's no target cpu list defined.
 	 */
 	if (!evsel->own_cpus || evlist->has_user_cpus) {
-		cpu_map__put(evsel->cpus);
-		evsel->cpus = cpu_map__get(evlist->cpus);
+		perf_cpu_map__put(evsel->cpus);
+		evsel->cpus = perf_cpu_map__get(evlist->cpus);
 	} else if (evsel->cpus != evsel->own_cpus) {
-		cpu_map__put(evsel->cpus);
-		evsel->cpus = cpu_map__get(evsel->own_cpus);
+		perf_cpu_map__put(evsel->cpus);
+		evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
 	}
 
 	thread_map__put(evsel->threads);
@@ -1115,8 +1115,8 @@ void perf_evlist__set_maps(struct evlist *evlist, struct perf_cpu_map *cpus,
 	 * the caller to increase the reference count.
 	 */
 	if (cpus != evlist->cpus) {
-		cpu_map__put(evlist->cpus);
-		evlist->cpus = cpu_map__get(cpus);
+		perf_cpu_map__put(evlist->cpus);
+		evlist->cpus = perf_cpu_map__get(cpus);
 	}
 
 	if (threads != evlist->threads) {
@@ -1383,7 +1383,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 out:
 	return err;
 out_put:
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 	goto out;
 }
 
tools/perf/util/evsel.c +2 -2
index a389752840a9..72c0e6948e83 100644
@@ -1325,8 +1325,8 @@ void perf_evsel__exit(struct evsel *evsel)
 	perf_evsel__free_id(evsel);
 	perf_evsel__free_config_terms(evsel);
 	cgroup__put(evsel->cgrp);
-	cpu_map__put(evsel->cpus);
-	cpu_map__put(evsel->own_cpus);
+	perf_cpu_map__put(evsel->cpus);
+	perf_cpu_map__put(evsel->own_cpus);
 	thread_map__put(evsel->threads);
 	zfree(&evsel->group_name);
 	zfree(&evsel->name);
tools/perf/util/parse-events.c +2 -2
index decb66d243ca..8c9928feb38a 100644
@@ -332,8 +332,8 @@ __add_event(struct list_head *list, int *idx,
 		return NULL;
 
 	(*idx)++;
-	evsel->cpus        = cpu_map__get(cpus);
-	evsel->own_cpus    = cpu_map__get(cpus);
+	evsel->cpus        = perf_cpu_map__get(cpus);
+	evsel->own_cpus    = perf_cpu_map__get(cpus);
 	evsel->system_wide = pmu ? pmu->is_uncore : false;
 	evsel->auto_merge_stats = auto_merge_stats;
 
tools/perf/util/pmu.c +1 -1
index 4929a50c0973..d355f9506a1c 100644
@@ -626,7 +626,7 @@ static bool pmu_is_uncore(const char *name)
 
 	snprintf(path, PATH_MAX, CPUS_TEMPLATE_UNCORE, sysfs, name);
 	cpus = __pmu_cpumask(path);
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	return !!cpus;
 }
tools/perf/util/python.c +1 -1
index cc4af99ab190..677c93f91c6c 100644
@@ -557,7 +557,7 @@ static int pyrf_cpu_map__init(struct pyrf_cpu_map *pcpus,
 
 static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus)
 {
-	cpu_map__put(pcpus->cpus);
+	perf_cpu_map__put(pcpus->cpus);
 	Py_TYPE(pcpus)->tp_free((PyObject*)pcpus);
 }
 
tools/perf/util/record.c +3 -3
index 9f8841548539..fecccfd71aa1 100644
@@ -67,7 +67,7 @@ static bool perf_probe_api(setup_probe_fn_t fn)
 	if (!cpus)
 		return false;
 	cpu = cpus->map[0];
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	do {
 		ret = perf_do_probe_api(fn, cpu, try[i++]);
@@ -122,7 +122,7 @@ bool perf_can_record_cpu_wide(void)
 	if (!cpus)
 		return false;
 	cpu = cpus->map[0];
-	cpu_map__put(cpus);
+	perf_cpu_map__put(cpus);
 
 	fd = sys_perf_event_open(&attr, -1, cpu, -1, 0);
 	if (fd < 0)
@@ -278,7 +278,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
 		struct perf_cpu_map *cpus = cpu_map__new(NULL);
 
 		cpu =  cpus ? cpus->map[0] : 0;
-		cpu_map__put(cpus);
+		perf_cpu_map__put(cpus);
 	} else {
 		cpu = evlist->cpus->map[0];
 	}
tools/perf/util/session.c +1 -1
index c191dc152175..62d37440cbee 100644
@@ -2310,7 +2310,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
 	err = 0;
 
 out_delete_map:
-	cpu_map__put(map);
+	perf_cpu_map__put(map);
 	return err;
 }
 
tools/perf/util/svghelper.c +1 -1
index 99132c6a30a6..a9ca5c4fffee 100644
@@ -745,7 +745,7 @@ static int str_to_bitmap(char *s, cpumask_t *b)
 		set_bit(c, cpumask_bits(b));
 	}
 
-	cpu_map__put(m);
+	perf_cpu_map__put(m);
 
 	return ret;
 }
author reviewer
#73 lore raw

PATCH 31/79 libperf: Add perf_thread_map struct

In reply to Jiri Olsa

Adding perf_thread_map struct into libperf.

It's added as a declaration into into:
include/perf/threadmap.h
which will be included by users.

The perf_thread_map struct definition is added into:
include/internal/threadmap.h

which is not to be included by users, but shared
within perf and libperf.

We tried the total separation of the perf_thread_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

---
 tools/perf/lib/Build                        |  1 +
 tools/perf/lib/include/internal/threadmap.h | 21 +++++++++++++++++++++
 tools/perf/lib/include/perf/threadmap.h     |  7 +++++++
 tools/perf/lib/threadmap.c                  |  5 +++++
 tools/perf/util/thread_map.h                | 13 +------------
 5 files changed, 35 insertions(+), 12 deletions(-)
 create mode 100644 tools/perf/lib/include/internal/threadmap.h
 create mode 100644 tools/perf/lib/include/perf/threadmap.h
 create mode 100644 tools/perf/lib/threadmap.c
tools/perf/lib/Build +1 -0
index 195b274db49a..9beadfc81a71 100644
@@ -1,2 +1,3 @@
 libperf-y += core.o
 libperf-y += cpumap.o
+libperf-y += threadmap.o
tools/perf/lib/include/internal/threadmap.h new file +21 -0
new file mode 100644
index 000000000000..c8088005a9ab
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_THREADMAP_H
+#define __LIBPERF_INTERNAL_THREADMAP_H
+
+#include <linux/refcount.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+struct thread_map_data {
+	pid_t	 pid;
+	char	*comm;
+};
+
+struct perf_thread_map {
+	refcount_t	refcnt;
+	int		nr;
+	int		err_thread;
+	struct thread_map_data map[];
+};
+
+#endif /* __LIBPERF_INTERNAL_THREADMAP_H */
tools/perf/lib/include/perf/threadmap.h new file +7 -0
new file mode 100644
index 000000000000..dc3a3837b56f
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_THREADMAP_H
+#define __LIBPERF_THREADMAP_H
+
+struct perf_thread_map;
+
+#endif /* __LIBPERF_THREADMAP_H */
tools/perf/lib/threadmap.c new file +5 -0
new file mode 100644
index 000000000000..163dc609b909
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <perf/threadmap.h>
+#include <stdlib.h>
+#include <linux/refcount.h>
+#include <internal/threadmap.h>
tools/perf/util/thread_map.h +1 -12
index 9358b1b6e657..5a7be6f8934f 100644
@@ -5,18 +5,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include <linux/refcount.h>
-
-struct thread_map_data {
-	pid_t    pid;
-	char	*comm;
-};
-
-struct perf_thread_map {
-	refcount_t refcnt;
-	int nr;
-	int err_thread;
-	struct thread_map_data map[];
-};
+#include <internal/threadmap.h>
 
 struct thread_map_event;
 
Signature · 1 line
2.21.0
#74 lore raw

[tip:perf/core] libperf: Add perf_thread_map struct

libperf: Add perf_thread_map struct
Commit-ID:  07acd22677ac6bb2db404d1d258e8c7d06ca7706
Gitweb:     https://git.kernel.org/tip/07acd22677ac6bb2db404d1d258e8c7d06ca7706
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:18 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf_thread_map struct

Add perf_thread_map struct to libperf.

It's added as a declaration into into:

include/perf/threadmap.h

which will be included by users.

The perf_thread_map struct definition is added into:

include/internal/threadmap.h

which is not to be included by users, but shared within perf and libperf.

We tried the total separation of the perf_thread_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration.

---
 tools/perf/lib/Build                        |  1 +
 tools/perf/lib/include/internal/threadmap.h | 21 +++++++++++++++++++++
 tools/perf/lib/include/perf/threadmap.h     |  7 +++++++
 tools/perf/lib/threadmap.c                  |  5 +++++
 tools/perf/util/thread_map.h                | 13 +------------
 5 files changed, 35 insertions(+), 12 deletions(-)
tools/perf/lib/Build +1 -0
index 195b274db49a..9beadfc81a71 100644
@@ -1,2 +1,3 @@
 libperf-y += core.o
 libperf-y += cpumap.o
+libperf-y += threadmap.o
tools/perf/lib/include/internal/threadmap.h new file +21 -0
new file mode 100644
index 000000000000..c8088005a9ab
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_INTERNAL_THREADMAP_H
+#define __LIBPERF_INTERNAL_THREADMAP_H
+
+#include <linux/refcount.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+struct thread_map_data {
+	pid_t	 pid;
+	char	*comm;
+};
+
+struct perf_thread_map {
+	refcount_t	refcnt;
+	int		nr;
+	int		err_thread;
+	struct thread_map_data map[];
+};
+
+#endif /* __LIBPERF_INTERNAL_THREADMAP_H */
tools/perf/lib/include/perf/threadmap.h new file +7 -0
new file mode 100644
index 000000000000..dc3a3837b56f
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LIBPERF_THREADMAP_H
+#define __LIBPERF_THREADMAP_H
+
+struct perf_thread_map;
+
+#endif /* __LIBPERF_THREADMAP_H */
tools/perf/lib/threadmap.c new file +5 -0
new file mode 100644
index 000000000000..163dc609b909
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <perf/threadmap.h>
+#include <stdlib.h>
+#include <linux/refcount.h>
+#include <internal/threadmap.h>
tools/perf/util/thread_map.h +1 -12
index 9358b1b6e657..5a7be6f8934f 100644
@@ -5,18 +5,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include <linux/refcount.h>
-
-struct thread_map_data {
-	pid_t    pid;
-	char	*comm;
-};
-
-struct perf_thread_map {
-	refcount_t refcnt;
-	int nr;
-	int err_thread;
-	struct thread_map_data map[];
-};
+#include <internal/threadmap.h>
 
 struct thread_map_event;
 
author reviewer
#75 lore raw

PATCH 32/79 libperf: Add perf_thread_map__new_dummy function

In reply to Jiri Olsa

Moving following functions:
thread_map__new_dummy
thread_map__realloc
thread_map__set_pid

under libperf with following names:
perf_thread_map__new_dummy
perf_thread_map__realloc
perf_thread_map__set_pid

the other 2 functions are dependencies of the
perf_thread_map__new_dummy function.

The perf_thread_map__realloc function is not exported.

---
 tools/perf/lib/include/internal/threadmap.h |  2 +
 tools/perf/lib/include/perf/threadmap.h     |  7 +++
 tools/perf/lib/libperf.map                  |  2 +
 tools/perf/lib/threadmap.c                  | 43 +++++++++++++++
 tools/perf/tests/openat-syscall-tp-fields.c |  2 +-
 tools/perf/tests/thread-map.c               |  2 +-
 tools/perf/util/evlist.c                    |  4 +-
 tools/perf/util/thread_map.c                | 59 +++++----------------
 tools/perf/util/thread_map.h                |  7 +--
 9 files changed, 71 insertions(+), 57 deletions(-)
tools/perf/lib/include/internal/threadmap.h +2 -0
index c8088005a9ab..df748baf9eda 100644
@@ -18,4 +18,6 @@ struct perf_thread_map {
 	struct thread_map_data map[];
 };
 
+struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr);
+
 #endif /* __LIBPERF_INTERNAL_THREADMAP_H */
tools/perf/lib/include/perf/threadmap.h +7 -0
index dc3a3837b56f..34ed7f587101 100644
@@ -2,6 +2,13 @@
 #ifndef __LIBPERF_THREADMAP_H
 #define __LIBPERF_THREADMAP_H
 
+#include <perf/core.h>
+#include <sys/types.h>
+
 struct perf_thread_map;
 
+LIBPERF_API struct perf_thread_map *perf_thread_map__new_dummy(void);
+
+LIBPERF_API void perf_thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid);
+
 #endif /* __LIBPERF_THREADMAP_H */
tools/perf/lib/libperf.map +2 -0
index 76ce3bc59dd8..6b4ec1c4d3f3 100644
@@ -4,6 +4,8 @@ LIBPERF_0.0.1 {
 		perf_cpu_map__dummy_new;
 		perf_cpu_map__get;
 		perf_cpu_map__put;
+		perf_thread_map__new_dummy;
+		perf_thread_map__set_pid;
 	local:
 		*;
 };
tools/perf/lib/threadmap.c +43 -0

46 lines not on this page · raw message

tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index c7182b7840e5..1de79208e690 100644
@@ -58,7 +58,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 
 	perf_evsel__config(evsel, &opts, NULL);
 
-	thread_map__set_pid(evlist->threads, 0, getpid());
+	perf_thread_map__set_pid(evlist->threads, 0, getpid());
 
 	err = evlist__open(evlist);
 	if (err < 0) {
tools/perf/tests/thread-map.c +1 -1
index 367dfe708e4c..73bc404ed390 100644
@@ -35,7 +35,7 @@ int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unuse
 	thread_map__put(map);
 
 	/* test dummy pid */
-	map = thread_map__new_dummy();
+	map = perf_thread_map__new_dummy();
 	TEST_ASSERT_VAL("failed to alloc map", map);
 
 	thread_map__read_comms(map);
tools/perf/util/evlist.c +2 -2
index 35020d50f51e..88d131769df4 100644
@@ -1375,7 +1375,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 	if (!cpus)
 		goto out;
 
-	threads = thread_map__new_dummy();
+	threads = perf_thread_map__new_dummy();
 	if (!threads)
 		goto out_put;
 
@@ -1504,7 +1504,7 @@ int perf_evlist__prepare_workload(struct evlist *evlist, struct target *target,
 				__func__, __LINE__);
 			goto out_close_pipes;
 		}
-		thread_map__set_pid(evlist->threads, 0, evlist->workload.pid);
+		perf_thread_map__set_pid(evlist->threads, 0, evlist->workload.pid);
 	}
 
 	close(child_ready_pipe[1]);
tools/perf/util/thread_map.c +12 -47

130 lines not on this page · raw message

tools/perf/util/thread_map.h +1 -6
index 5a7be6f8934f..94a1f9565f5e 100644
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <linux/refcount.h>
 #include <internal/threadmap.h>
+#include <perf/threadmap.h>
 
 struct thread_map_event;
 
@@ -37,12 +38,6 @@ static inline pid_t thread_map__pid(struct perf_thread_map *map, int thread)
 	return map->map[thread].pid;
 }
 
-static inline void
-thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid)
-{
-	map->map[thread].pid = pid;
-}
-
 static inline char *thread_map__comm(struct perf_thread_map *map, int thread)
 {
 	return map->map[thread].comm;
Signature · 1 line
2.21.0
#76 lore raw

[tip:perf/core] libperf: Add perf_thread_map__new_dummy() function

libperf: Add perf_thread_map__new_dummy() function
Commit-ID:  4b49cce25e719587e934b745fe9bbb5bc8c4ba29
Gitweb:     https://git.kernel.org/tip/4b49cce25e719587e934b745fe9bbb5bc8c4ba29
Author:     Jiri Olsa <[email protected]>
AuthorDate: Sun, 21 Jul 2019 13:24:19 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 29 Jul 2019 18:34:44 -0300

libperf: Add perf_thread_map__new_dummy() function

Moving the following functions:

thread_map__new_dummy()
thread_map__realloc()
thread_map__set_pid()

to libperf with the following names:

perf_thread_map__new_dummy()
perf_thread_map__realloc()
perf_thread_map__set_pid()

the other 2 functions are dependencies of the
perf_thread_map__new_dummy() function.

The perf_thread_map__realloc() function is not exported.

---
 tools/perf/lib/include/internal/threadmap.h |  2 +
 tools/perf/lib/include/perf/threadmap.h     |  7 ++++
 tools/perf/lib/libperf.map                  |  2 +
 tools/perf/lib/threadmap.c                  | 43 +++++++++++++++++++++
 tools/perf/tests/openat-syscall-tp-fields.c |  2 +-
 tools/perf/tests/thread-map.c               |  2 +-
 tools/perf/util/evlist.c                    |  4 +-
 tools/perf/util/thread_map.c                | 59 ++++++-----------------------
 tools/perf/util/thread_map.h                |  7 +---
 9 files changed, 71 insertions(+), 57 deletions(-)
tools/perf/lib/include/internal/threadmap.h +2 -0
index c8088005a9ab..df748baf9eda 100644
@@ -18,4 +18,6 @@ struct perf_thread_map {
 	struct thread_map_data map[];
 };
 
+struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr);
+
 #endif /* __LIBPERF_INTERNAL_THREADMAP_H */
tools/perf/lib/include/perf/threadmap.h +7 -0
index dc3a3837b56f..34ed7f587101 100644
@@ -2,6 +2,13 @@
 #ifndef __LIBPERF_THREADMAP_H
 #define __LIBPERF_THREADMAP_H
 
+#include <perf/core.h>
+#include <sys/types.h>
+
 struct perf_thread_map;
 
+LIBPERF_API struct perf_thread_map *perf_thread_map__new_dummy(void);
+
+LIBPERF_API void perf_thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid);
+
 #endif /* __LIBPERF_THREADMAP_H */
tools/perf/lib/libperf.map +2 -0
index 76ce3bc59dd8..6b4ec1c4d3f3 100644
@@ -4,6 +4,8 @@ LIBPERF_0.0.1 {
 		perf_cpu_map__dummy_new;
 		perf_cpu_map__get;
 		perf_cpu_map__put;
+		perf_thread_map__new_dummy;
+		perf_thread_map__set_pid;
 	local:
 		*;
 };
tools/perf/lib/threadmap.c +43 -0

46 lines not on this page · raw message

tools/perf/tests/openat-syscall-tp-fields.c +1 -1
index c7182b7840e5..1de79208e690 100644
@@ -58,7 +58,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
 
 	perf_evsel__config(evsel, &opts, NULL);
 
-	thread_map__set_pid(evlist->threads, 0, getpid());
+	perf_thread_map__set_pid(evlist->threads, 0, getpid());
 
 	err = evlist__open(evlist);
 	if (err < 0) {
tools/perf/tests/thread-map.c +1 -1
index 367dfe708e4c..73bc404ed390 100644
@@ -35,7 +35,7 @@ int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unuse
 	thread_map__put(map);
 
 	/* test dummy pid */
-	map = thread_map__new_dummy();
+	map = perf_thread_map__new_dummy();
 	TEST_ASSERT_VAL("failed to alloc map", map);
 
 	thread_map__read_comms(map);
tools/perf/util/evlist.c +2 -2
index 35020d50f51e..88d131769df4 100644
@@ -1375,7 +1375,7 @@ static int perf_evlist__create_syswide_maps(struct evlist *evlist)
 	if (!cpus)
 		goto out;
 
-	threads = thread_map__new_dummy();
+	threads = perf_thread_map__new_dummy();
 	if (!threads)
 		goto out_put;
 
@@ -1504,7 +1504,7 @@ int perf_evlist__prepare_workload(struct evlist *evlist, struct target *target,
 				__func__, __LINE__);
 			goto out_close_pipes;
 		}
-		thread_map__set_pid(evlist->threads, 0, evlist->workload.pid);
+		perf_thread_map__set_pid(evlist->threads, 0, evlist->workload.pid);
 	}
 
 	close(child_ready_pipe[1]);
tools/perf/util/thread_map.c +12 -47

130 lines not on this page · raw message

tools/perf/util/thread_map.h +1 -6
index 5a7be6f8934f..94a1f9565f5e 100644
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <linux/refcount.h>
 #include <internal/threadmap.h>
+#include <perf/threadmap.h>
 
 struct thread_map_event;
 
@@ -37,12 +38,6 @@ static inline pid_t thread_map__pid(struct perf_thread_map *map, int thread)
 	return map->map[thread].pid;
 }
 
-static inline void
-thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid)
-{
-	map->map[thread].pid = pid;
-}
-
 static inline char *thread_map__comm(struct perf_thread_map *map, int thread)
 {
 	return map->map[thread].comm;