perf sched: Free thread->priv using priv_destructor
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:36 +0000 (18:49 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 18:28:29 +0000 (11:28 -0700)
commitaa9fdd106bab8c478d37eba5703c0950ad5c0d4f
tree7607aef955781b67984483e91202030d745adf8c
parent10d9b89203765fb776512742c13af8dd92821842
perf sched: Free thread->priv using priv_destructor

In many perf sched subcommand saves priv data structure in the thread
but it forgot to free them.  As it's an opaque type with 'void *', it
needs to register that knows how to free the data.  In this case, just
regular 'free()' is fine.

Fixes: 04cb4fc4d40a5bf1 ("perf thread: Allow tools to register a thread->priv destructor")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-3-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-sched.c