]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
perf script: Fix memory 'threads' and 'cpus' leaks on exit
authorRiccardo Mancini <rickyman7@gmail.com>
Thu, 15 Jul 2021 16:07:18 +0000 (18:07 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:49:27 +0000 (18:49 +0200)
commit0203c7464157f4673d021e235570a6caa752aa6e
treee9ab0982f0cee90fe3be0898a0477511e24ae104
parent79667bb9a74363b465569ac1d831a45b6d89c777
perf script: Fix memory 'threads' and 'cpus' leaks on exit

BugLink: https://bugs.launchpad.net/bugs/1939899
[ Upstream commit faf3ac305d61341c74e5cdd9e41daecce7f67bfe ]

ASan reports several memory leaks while running:

  # perf test "82: Use vfs_getname probe to get syscall args filenames"

Two of these are caused by some refcounts not being decreased on
perf-script exit, namely script.threads and script.cpus.

This patch adds the missing __put calls in a new perf_script__exit
function, which is called at the end of cmd_script.

This patch concludes the fixes of all remaining memory leaks in perf
test "82: Use vfs_getname probe to get syscall args filenames".

Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Fixes: cfc8874a48599249 ("perf script: Process cpu/threads maps")
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/5ee73b19791c6fa9d24c4d57f4ac1a23609400d7.1626343282.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
tools/perf/builtin-script.c