perf test: add test for BPF metadata collection
authorBlake Jones <blakejones@google.com>
Thu, 12 Jun 2025 19:49:39 +0000 (12:49 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 20 Jun 2025 21:55:24 +0000 (14:55 -0700)
commitedf2cadf01e8f2620af25b337d15ebc584911b46
tree9e30c5bcb781d609eeeb2e721e22ed93387143f4
parentf19860ea9477f5ac33775cc0a602c7d54188c00a
perf test: add test for BPF metadata collection

This is an end-to-end test for the PERF_RECORD_BPF_METADATA support.
It adds a new "bpf_metadata_perf_version" variable to perf's BPF programs,
so that when they are loaded, there will be at least one BPF program with
some metadata to parse. The test invokes "perf record" in a way that loads
one of those BPF programs, and then sifts through the output to find its
BPF metadata.

Signed-off-by: Blake Jones <blakejones@google.com>
Link: https://lore.kernel.org/r/20250612194939.162730-6-blakejones@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/Makefile.perf
tools/perf/tests/shell/test_bpf_metadata.sh [new file with mode: 0755]
tools/perf/util/bpf_skel/perf_version.h [new file with mode: 0644]