linux/tools/perf/bench
Sohaib Mohamed 9e0df711f8 perf bench futex: Fix memory leak of perf_cpu_map__new()
[ Upstream commit 88e48238d53682281c9de2a0b65d24d3b64542a0 ]

ASan reports memory leaks while running:

  $ sudo ./perf bench futex all

The leaks are caused by perf_cpu_map__new not being freed.
This patch adds the missing perf_cpu_map__put since it calls
cpu_map_delete implicitly.

Fixes: 9c3516d1b8 ("libperf: Add perf_cpu_map__new()/perf_cpu_map__read() functions")
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: André Almeida <andrealmeid@collabora.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
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>
Cc: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lore.kernel.org/lkml/20211112201134.77892-1-sohaib.amhmd@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-26 10:47:18 +01:00
..
Build perf bench: Add epoll_ctl(2) benchmark 2018-11-21 22:39:55 -03:00
bench.h perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
epoll-ctl.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
epoll-wait.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
futex-hash.c perf bench: Share some global variables to fix build with gcc 10 2020-08-05 09:59:52 +02:00
futex-lock-pi.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:47:18 +01:00
futex-requeue.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:47:18 +01:00
futex-wake-parallel.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:47:18 +01:00
futex-wake.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:47:18 +01:00
futex.h perf bench: Move HAVE_PTHREAD_ATTR_SETAFFINITY_NP into bench.h 2018-11-21 12:00:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-21 13:05:38 +02:00
mem-memcpy-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm-def.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memcpy-x86-64-asm.S tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
mem-memcpy-x86-64-lib.c tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
mem-memset-arch.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm-def.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem-memset-x86-64-asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
numa.c perf tools: Remove needless builtin.h include directives 2019-09-20 09:19:20 -03:00
sched-messaging.c perf bench: Fix 2 memory sanitizer warnings 2021-07-19 08:53:14 +02:00
sched-pipe.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00