]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf bpf filter: Add uid and gid terms
authorIan Rogers <irogers@google.com>
Fri, 24 May 2024 20:52:26 +0000 (13:52 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 30 May 2024 17:05:57 +0000 (10:05 -0700)
commitd92aa899fe0a66350303a1986d6dc7ec4b3a1ea7
treea57346e02167583943c079105dfa62e3c33d7fb9
parent63b9cbd7941aa9ec5cb61567042176c4ce04b020
perf bpf filter: Add uid and gid terms

Allow the BPF filter to use the uid and gid terms determined by the
bpf_get_current_uid_gid BPF helper. For example, the following will
record the cpu-clock event system wide discarding samples that don't
belong to the current user.

$ perf record -e cpu-clock --filter "uid == $(id -u)" -a sleep 0.1

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240524205227.244375-3-irogers@google.com
tools/perf/Documentation/perf-record.txt
tools/perf/util/bpf-filter.c
tools/perf/util/bpf-filter.l
tools/perf/util/bpf_skel/sample-filter.h
tools/perf/util/bpf_skel/sample_filter.bpf.c