diff options
| author | Ian Rogers <[email protected]> | 2025-03-08 01:28:53 +0000 |
|---|---|---|
| committer | Namhyung Kim <[email protected]> | 2025-03-10 21:26:45 +0000 |
| commit | db5af2e4a02c9b3744453a84657ed1fc54a1ef82 (patch) | |
| tree | f0f602ca90afd91a8e5bb85a613bf1776548c08b /tools/perf/util/python.c | |
| parent | perf vendor events riscv: Add SiFive P650 events (diff) | |
| download | kernel-db5af2e4a02c9b3744453a84657ed1fc54a1ef82.tar.gz kernel-db5af2e4a02c9b3744453a84657ed1fc54a1ef82.zip | |
perf mem: Don't leak mem event names
When preparing the mem events for the argv copies are intentionally
made. These copies are leaked and cause runs of perf using address
sanitizer to fail. Rather than leak the memory allocate a chunk of
memory for the mem event names upfront and build the strings in this -
the storage is sized larger than the previous buffer size. The caller
is then responsible for clearing up this memory. As part of this
change, remove the mem_loads_name and mem_stores_name global buffers
then change the perf_pmu__mem_events_name to write to an out argument
buffer.
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Thomas Falcon <[email protected]>
Reviewed-by: Leo Yan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/python.c')
0 files changed, 0 insertions, 0 deletions
