summaryrefslogtreecommitdiff
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-07-21 14:24:20 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-30 00:34:44 +0300
commit7836e52e518b5e3fd695850f1d4081f756f58406 (patch)
tree0dd7986d87a1a7065be0eb472928a648b8825d09 /tools/perf/tests
parent4b49cce25e719587e934b745fe9bbb5bc8c4ba29 (diff)
downloadlinux-7836e52e518b5e3fd695850f1d4081f756f58406.tar.xz
libperf: Add perf_thread_map__get()/perf_thread_map__put()
Move the following functions: thread_map__get() thread_map__put() thread_map__comm() to libperf with the following names: perf_thread_map__get() perf_thread_map__put() perf_thread_map__comm() Add the perf_thread_map__comm() function for it to work/compile. 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-34-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.c4
-rw-r--r--tools/perf/tests/event-times.c4
-rw-r--r--tools/perf/tests/keep-tracking.c2
-rw-r--r--tools/perf/tests/mmap-basic.c2
-rw-r--r--tools/perf/tests/mmap-thread-lookup.c2
-rw-r--r--tools/perf/tests/openat-syscall-all-cpus.c2
-rw-r--r--tools/perf/tests/openat-syscall.c2
-rw-r--r--tools/perf/tests/sw-clock.c2
-rw-r--r--tools/perf/tests/switch-tracking.c2
-rw-r--r--tools/perf/tests/task-exit.c2
-rw-r--r--tools/perf/tests/thread-map.c18
11 files changed, 21 insertions, 21 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index ce2d3266286a..7b26be1dfb47 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -656,7 +656,7 @@ static int do_test_code_reading(bool try_kcore)
* call. Getting refference to keep them alive.
*/
perf_cpu_map__get(cpus);
- thread_map__get(threads);
+ perf_thread_map__get(threads);
perf_evlist__set_maps(evlist, NULL, NULL);
evlist__delete(evlist);
evlist = NULL;
@@ -706,7 +706,7 @@ out_err:
evlist__delete(evlist);
} else {
perf_cpu_map__put(cpus);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
}
machine__delete_threads(machine);
machine__delete(machine);
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
index dcfff4b20c92..9238180416b0 100644
--- a/tools/perf/tests/event-times.c
+++ b/tools/perf/tests/event-times.c
@@ -76,7 +76,7 @@ static int attach__current_disabled(struct evlist *evlist)
return err;
}
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL;
}
@@ -96,7 +96,7 @@ static int attach__current_enabled(struct evlist *evlist)
err = perf_evsel__open_per_thread(evsel, threads);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return err == 0 ? TEST_OK : TEST_FAIL;
}
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 43e55fe98f8c..830fb3d7ea2e 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -150,7 +150,7 @@ out_err:
evlist__delete(evlist);
} else {
perf_cpu_map__put(cpus);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
}
return err;
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index d15282174b2e..72fbf55f4fc3 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -157,6 +157,6 @@ out_delete_evlist:
out_free_cpus:
perf_cpu_map__put(cpus);
out_free_threads:
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return err;
}
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index ad6ca943e568..360d70deb855 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -147,7 +147,7 @@ static int synth_process(struct machine *machine)
perf_event__process,
machine, 0);
- thread_map__put(map);
+ perf_thread_map__put(map);
return err;
}
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index 611f6ea9b702..674b0fa035ec 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -122,6 +122,6 @@ out_evsel_delete:
out_cpu_map_delete:
perf_cpu_map__put(cpus);
out_thread_map_delete:
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return err;
}
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index 20e353fbfdd0..87c212545767 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -61,6 +61,6 @@ out_close_fd:
out_evsel_delete:
evsel__delete(evsel);
out_thread_map_delete:
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return err;
}
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index c464e301ade9..2decda2d4c17 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -126,7 +126,7 @@ out_init:
out_free_maps:
perf_cpu_map__put(cpus);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
out_delete_evlist:
evlist__delete(evlist);
return err;
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 27af7b7109a3..0935a5a1ecaa 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -570,7 +570,7 @@ out:
evlist__delete(evlist);
} else {
perf_cpu_map__put(cpus);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
}
return err;
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index f026759a05d7..24257285844b 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -136,7 +136,7 @@ out_init:
out_free_maps:
perf_cpu_map__put(cpus);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
out_delete_evlist:
evlist__delete(evlist);
return err;
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
index 73bc404ed390..d61773cacf0b 100644
--- a/tools/perf/tests/thread-map.c
+++ b/tools/perf/tests/thread-map.c
@@ -28,11 +28,11 @@ int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unuse
TEST_ASSERT_VAL("wrong pid",
thread_map__pid(map, 0) == getpid());
TEST_ASSERT_VAL("wrong comm",
- thread_map__comm(map, 0) &&
- !strcmp(thread_map__comm(map, 0), NAME));
+ perf_thread_map__comm(map, 0) &&
+ !strcmp(perf_thread_map__comm(map, 0), NAME));
TEST_ASSERT_VAL("wrong refcnt",
refcount_read(&map->refcnt) == 1);
- thread_map__put(map);
+ perf_thread_map__put(map);
/* test dummy pid */
map = perf_thread_map__new_dummy();
@@ -43,11 +43,11 @@ int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unuse
TEST_ASSERT_VAL("wrong nr", map->nr == 1);
TEST_ASSERT_VAL("wrong pid", thread_map__pid(map, 0) == -1);
TEST_ASSERT_VAL("wrong comm",
- thread_map__comm(map, 0) &&
- !strcmp(thread_map__comm(map, 0), "dummy"));
+ perf_thread_map__comm(map, 0) &&
+ !strcmp(perf_thread_map__comm(map, 0), "dummy"));
TEST_ASSERT_VAL("wrong refcnt",
refcount_read(&map->refcnt) == 1);
- thread_map__put(map);
+ perf_thread_map__put(map);
return 0;
}
@@ -70,11 +70,11 @@ static int process_event(struct perf_tool *tool __maybe_unused,
TEST_ASSERT_VAL("wrong pid",
thread_map__pid(threads, 0) == getpid());
TEST_ASSERT_VAL("wrong comm",
- thread_map__comm(threads, 0) &&
- !strcmp(thread_map__comm(threads, 0), NAME));
+ perf_thread_map__comm(threads, 0) &&
+ !strcmp(perf_thread_map__comm(threads, 0), NAME));
TEST_ASSERT_VAL("wrong refcnt",
refcount_read(&threads->refcnt) == 1);
- thread_map__put(threads);
+ perf_thread_map__put(threads);
return 0;
}