Use BPF filters for a "perf top -u" workaround
Status from this message: Applied to perf-tools-next, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 2 repliesApplied
- v23 patches 3 repliesSuperseded
- v13 patches 7 repliesSuperseded
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | perf bpf filter: Give terms their own enumtools/ tools/ tools/ +3 more | +141 | 0 replies | |
| 2/3 | perf bpf filter: Add uid and gid termstools/ tools/ tools/ +2 more | +15 | 0 replies | |
| 3/3 | perf top: Allow filters on eventstools/ tools/ | +13 | 0 replies |
Reviews trailers per patch
None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Namhyung Kim |
|---|---|
| Series | A-b |
| 1/3 | |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/3] Use BPF filters for a "perf top -u" workaround
Allow uid and gid to be terms in BPF filters by first breaking the connection between filter terms and PERF_SAMPLE_xx values. Calculate the uid and gid using the bpf_get_current_uid_gid helper, rather than from a value in the sample. Allow filters to be passed to perf top, this allows:
$ perf top -e cycles:P --filter "uid == $(id -u)"
to work as a "perf top -u" workaround, as "perf top -u" usually fails due to processes/threads terminating between the /proc scan and the perf_event_open.
v3. Move PERF_SAMPLE_xx asserts to sample_filter.bpf.c to avoid
conflicting definitions between vmlinux.h and perf_event.h as reported by Namhyung.
v2. Allow PERF_SAMPLE_xx to be computed from the PBF_TERM_xx value
using a shift as requested by Namhyung.
Ian Rogers (3):
perf bpf filter: Give terms their own enum
perf bpf filter: Add uid and gid terms
perf top: Allow filters on events
tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/Documentation/perf-top.txt | 4 ++ tools/perf/builtin-top.c | 9 +++ tools/perf/util/bpf-filter.c | 33 +++++---- tools/perf/util/bpf-filter.h | 5 +- tools/perf/util/bpf-filter.l | 66 +++++++++--------- tools/perf/util/bpf-filter.y | 7 +- tools/perf/util/bpf_skel/sample-filter.h | 40 ++++++++++- tools/perf/util/bpf_skel/sample_filter.bpf.c | 73 +++++++++++++++----- 9 files changed, 169 insertions(+), 70 deletions(-)
Signature · 1 line
2.45.1.288.g0e0cd299f1-goog