diff options
author | Jiri Olsa | 2019-07-21 13:24:43 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2019-07-29 18:34:45 -0300 |
commit | 453fa03090a64c0e0a561f10dfd5e8747796949c (patch) | |
tree | 6564b16701f97ca029f27513b0d19c1fc478146f /tools/perf/tests | |
parent | 03617c22e31f32cbf0e4797e216db898fb898d90 (diff) |
libperf: Add perf_evlist__set_maps() function
Move the evlist__set_maps() function from tools/perf to libperf.
Committer notes:
Fix up reject due to earlier inversion in calling perf_evlist__init().
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-57-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/code-reading.c | 5 | ||||
-rw-r--r-- | tools/perf/tests/keep-tracking.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/mmap-basic.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/sw-clock.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/switch-tracking.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/task-exit.c | 3 |
6 files changed, 13 insertions, 7 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index bfaf22c2023c..e45df0736261 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -9,6 +9,7 @@ #include <string.h> #include <sys/param.h> #include <perf/cpumap.h> +#include <perf/evlist.h> #include "parse-events.h" #include "evlist.h" @@ -629,7 +630,7 @@ static int do_test_code_reading(bool try_kcore) goto out_put; } - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); str = do_determine_event(excl_kernel); pr_debug("Parsing event '%s'\n", str); @@ -658,7 +659,7 @@ static int do_test_code_reading(bool try_kcore) */ perf_cpu_map__get(cpus); perf_thread_map__get(threads); - perf_evlist__set_maps(evlist, NULL, NULL); + perf_evlist__set_maps(&evlist->core, NULL, NULL); evlist__delete(evlist); evlist = NULL; continue; diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index 46478ba1ed16..0ce5ce33bac4 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c @@ -3,6 +3,7 @@ #include <unistd.h> #include <sys/prctl.h> #include <perf/cpumap.h> +#include <perf/evlist.h> #include "parse-events.h" #include "evlist.h" @@ -82,7 +83,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un evlist = evlist__new(); CHECK_NOT_NULL__(evlist); - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); CHECK__(parse_events(evlist, "dummy:u", NULL)); CHECK__(parse_events(evlist, "cycles:u", NULL)); diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index aa792aebd7f0..7327694fbde0 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -12,6 +12,7 @@ #include "tests.h" #include <linux/err.h> #include <linux/kernel.h> +#include <perf/evlist.h> /* * This test will generate random numbers of calls to some getpid syscalls, @@ -68,7 +69,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse goto out_free_cpus; } - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); for (i = 0; i < nsyscalls; ++i) { char name[64]; diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 2decda2d4c17..c5f1a9f83380 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c @@ -11,6 +11,7 @@ #include "util/evlist.h" #include "util/cpumap.h" #include "util/thread_map.h" +#include <perf/evlist.h> #define NR_LOOPS 10000000 @@ -64,7 +65,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) goto out_free_maps; } - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); cpus = NULL; threads = NULL; diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 9e0bbea15005..e3cee69f6ea2 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -6,6 +6,7 @@ #include <stdlib.h> #include <linux/zalloc.h> #include <perf/cpumap.h> +#include <perf/evlist.h> #include "parse-events.h" #include "evlist.h" @@ -354,7 +355,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ goto out_err; } - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); /* First event */ err = parse_events(evlist, "cpu-clock:u", NULL); diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index b0192ea636a7..4ca38fd0379a 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -7,6 +7,7 @@ #include <errno.h> #include <signal.h> +#include <perf/evlist.h> static int exited; static int nr_exit; @@ -71,7 +72,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused goto out_free_maps; } - perf_evlist__set_maps(evlist, cpus, threads); + perf_evlist__set_maps(&evlist->core, cpus, threads); cpus = NULL; threads = NULL; |