Re: [PATCH 1/2] libperf: Add perf_evlist__reset_id_hash()

From: Namhyung Kim
Date: Wed Feb 24 2021 - 03:45:28 EST


On Wed, Feb 24, 2021 at 5:11 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> Add the perf_evlist__reset_id_hash() function to libperf API so that
> it can be called to reset the hash table. This is necessary for perf
> stat to run the workload multiple times.
>
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> ---
[SNIP]
> diff --git a/tools/lib/perf/libperf.map b/tools/lib/perf/libperf.map
> index 7be1af8a546c..285100143d89 100644
> --- a/tools/lib/perf/libperf.map
> +++ b/tools/lib/perf/libperf.map
> @@ -42,6 +42,7 @@ LIBPERF_0.0.1 {
> perf_evlist__munmap;
> perf_evlist__filter_pollfd;
> perf_evlist__next_mmap;
> + perf_evlist__reset_id_hash;
> perf_mmap__consume;
> perf_mmap__read_init;
> perf_mmap__read_done;

I saw perf_evsel__free_fd and perf_evsel__free_id is called from
util/evlist.c without being listed here. Do we need to add them?

Thanks,
Namhyung