linux/tools
Ian Rogers 1865b4164b perf trace: Free the whole evsel_trace in evsel__put_and_free_priv
Every evsel->priv in builtin-trace.c is a struct evsel_trace, allocated
by evsel_trace__new(). It holds a syscall_arg_fmt array in its fmt
member, which evsel__syscall_arg_fmt() allocates on demand for the
syscalls:sys_{enter,exit}_SYSCALL tracepoints and for every other
tracepoint that gets its arguments pretty printed.

evsel__put_and_free_priv() only did zfree(&evsel->priv), releasing the
evsel_trace itself and leaking that array. Use evsel_trace__delete(),
which frees fmt first, exactly as the out_delete path of
evsel__syscall_arg_fmt() already does.

The current callers are all error paths that run before fmt can have
been allocated, so nothing leaks in practice today, but the helper is
the obvious thing to reach for whenever an evsel is discarded and it
should be safe for that.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-22 15:00:23 +02:00
..
accounting
arch perf headers: Sync perf_event.h/perf_regs.h with the kernel headers 2026-09-14 15:32:52 -03:00
bootconfig Bootconfig updates for v7.3: 2026-08-25 08:59:09 -07:00
bpf perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
build tools build: Fix timerfd feature detection with clang 2026-09-12 17:22:18 -03:00
certs
cgroup
counter
crypto
debugging
dma
docs doc tools: fix 'path' typos 2026-08-11 10:43:16 -06:00
firewire
firmware
gpio
hv
iio
include perf headers: Sync perf_event.h/perf_regs.h with the kernel headers 2026-09-14 15:32:52 -03:00
kvm/kvm_stat
laptop
leds
lib perf record: Fix unhandled POLLHUP on non_perf_event descriptors 2026-09-17 12:27:34 -03:00
memory-model
mm mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
net Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
objtool Rust fixes for v7.3 2026-08-30 09:47:39 -07:00
pcmcia
perf perf trace: Free the whole evsel_trace in evsel__put_and_free_priv 2026-09-22 15:00:23 +02:00
platform/x86/amd
power
rcu
sched
sched_ext sched_ext: Check bpf_timer_start return values in scx_qmap 2026-08-31 06:47:39 -10:00
scripts perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
sound
spi
testing bpf-fixes 2026-09-06 13:49:44 -07:00
thermal
time
tracing
unittests
usb
verification verification/rvgen: Use .old instead of .bak for kunit backup files 2026-08-25 13:56:53 +02:00
virtio tools/virtio: Fix control typo in trace agent comment 2026-08-19 06:38:48 -04:00
wmi
workqueue tools/workqueue/wq_dump.py: Support backward compatibility for wq->attrs rename 2026-08-31 10:17:08 -10:00
writeback
Makefile