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>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
4b49cce25e
commit
7836e52e51
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user