]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf sched: Fix memory leaks for evsel->priv in timehist
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:39 +0000 (18:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:53 +0000 (12:08 +0200)
commit282d4b34694f83b00c45ab85f85bd5fbdabed491
treebc40941d5762da56ea5b3aed1ab09af4848f17ad
parent16ce5ce11145e42e89dbcf68a5c56466f163ffde
perf sched: Fix memory leaks for evsel->priv in timehist

[ Upstream commit 117e5c33b1c44037af016d77ce6c0b086d55535f ]

It uses evsel->priv to save per-cpu timing information.  It should be
freed when the evsel is released.

Add the priv destructor for evsel same as thread to handle that.

Fixes: 49394a2a24c78ce0 ("perf sched timehist: Introduce timehist command")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-6-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-sched.c
tools/perf/util/evsel.c
tools/perf/util/evsel.h