perf trace: Switch user option to use BPF filter
authorIan Rogers <irogers@google.com>
Wed, 4 Jun 2025 17:45:41 +0000 (10:45 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 9 Jun 2025 18:18:18 +0000 (11:18 -0700)
commitbf1976dd28b4ec611d4f0bf5b0de40b1dd21b253
treef8a452a257fba88f3e04b58f9cc916898f2318f5
parent38f83cc9ab8f74732de66044d1a126ca46347eea
perf trace: Switch user option to use BPF filter

Finding user processes by scanning /proc is inherently racy and
results in perf_event_open failures. Use a BPF filter to drop samples
where the uid doesn't match. Ensure adding the BPF filter forces
system-wide.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250604174545.2853620-8-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c