Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf trace: Fix leaks of 'struct thread' in set_filter_loop_pids()

I've found some leaks from 'perf trace -a'.

It seems there are more leaks but this is what I can find for now.

Fixes: 082ab9a18e532864 ("perf trace: Filter out 'sshd' in the tracer ancestry in syswide tracing")
Reviewed-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250403054213.7021-1-namhyung@kernel.org
[ split from a larget patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
30d20fb1 bb3de7fa

+3
+3
tools/perf/builtin-trace.c
··· 4128 4128 if (!strcmp(thread__comm_str(parent), "sshd") || 4129 4129 strstarts(thread__comm_str(parent), "gnome-terminal")) { 4130 4130 pids[nr++] = thread__tid(parent); 4131 + thread__put(parent); 4131 4132 break; 4132 4133 } 4134 + thread__put(thread); 4133 4135 thread = parent; 4134 4136 } 4137 + thread__put(thread); 4135 4138 4136 4139 err = evlist__append_tp_filter_pids(trace->evlist, nr, pids); 4137 4140 if (!err && trace->filter_pids.map)