diff options
author | Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> | 2022-02-21 12:26:28 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-02-23 14:40:23 -0300 |
commit | 56dce868198cd01b023e05d72bbbba7c87cc384d (patch) | |
tree | 287744573d74ffa37a015d1f0398f4e63fe15d86 /tools/lib/perf/include/perf | |
parent | libperf: Rename arguments of perf_thread_map APIs (diff) | |
download | linux-dev-56dce868198cd01b023e05d72bbbba7c87cc384d.tar.xz linux-dev-56dce868198cd01b023e05d72bbbba7c87cc384d.zip |
libperf: Add API for allocating new thread map array
The existing API perf_thread_map__new_dummy() allocates new thread map
for one thread. I couldn't find a way to reallocate the map with more
threads, or to allocate a new map for more than one thread.
Having multiple threads in a thread map is essential for some use cases.
That's why a new API is proposed, which allocates a new thread map for
given number of threads: perf_thread_map__new_array()
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/linux-perf-users/20220221102628.43904-1-tz.stoyanov@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/perf/include/perf')
-rw-r--r-- | tools/lib/perf/include/perf/threadmap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/perf/include/perf/threadmap.h b/tools/lib/perf/include/perf/threadmap.h index 58f7fbdce446..8b40e7777cea 100644 --- a/tools/lib/perf/include/perf/threadmap.h +++ b/tools/lib/perf/include/perf/threadmap.h @@ -8,6 +8,7 @@ struct perf_thread_map; LIBPERF_API struct perf_thread_map *perf_thread_map__new_dummy(void); +LIBPERF_API struct perf_thread_map *perf_thread_map__new_array(int nr_threads, pid_t *array); LIBPERF_API void perf_thread_map__set_pid(struct perf_thread_map *map, int idx, pid_t pid); LIBPERF_API char *perf_thread_map__comm(struct perf_thread_map *map, int idx); |