libperf: Add API for allocating new thread map array
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Mon, 21 Feb 2022 10:26:28 +0000 (12:26 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 23 Feb 2022 17:40:23 +0000 (14:40 -0300)
commit56dce868198cd01b023e05d72bbbba7c87cc384d
tree287744573d74ffa37a015d1f0398f4e63fe15d86
parent41415b8a974a311c42d48064722540e691010edc
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>
tools/lib/perf/Documentation/libperf.txt
tools/lib/perf/include/perf/threadmap.h
tools/lib/perf/libperf.map
tools/lib/perf/tests/test-threadmap.c
tools/lib/perf/threadmap.c