Re: [PATCH v2 3/4] perf: collect BPF metadata from new programs, and display the new event
From: Namhyung Kim
Date: Fri Jun 06 2025 - 15:03:11 EST
Hi Blake,
On Thu, Jun 05, 2025 at 04:39:33PM -0700, Blake Jones wrote:
> This collects metadata for any BPF programs that were loaded during a
> "perf record" run, and emits it at the end of the run. It also adds support
> for displaying the new PERF_RECORD_BPF_METADATA type.
Can you please split the final synthesis and the processing/display
parts? I prefer commits doing one at a time.
>
> Here's some example "perf script -D" output for the new event type. The
> ": unhandled!" message is from tool.c, analogous to other behavior there.
> I've elided some rows with all NUL characters for brevity, and I wrapped
> one of the >75-column lines to fit in the commit guidelines.
>
> 0x50fc8@xxxxxxxxx [0x260]: event: 84
> .
> . ... raw event: size 608 bytes
> . 0000: 54 00 00 00 00 00 60 02 62 70 66 5f 70 72 6f 67 T.....`.bpf_prog
> . 0010: 5f 31 65 30 61 32 65 33 36 36 65 35 36 66 31 61 _1e0a2e366e56f1a
> . 0020: 32 5f 70 65 72 66 5f 73 61 6d 70 6c 65 5f 66 69 2_perf_sample_fi
> . 0030: 6c 74 65 72 00 00 00 00 00 00 00 00 00 00 00 00 lter............
> . 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> [...]
> . 0110: 74 65 73 74 5f 76 61 6c 75 65 00 00 00 00 00 00 test_value......
> . 0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> [...]
> . 0150: 34 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 42..............
> . 0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> [...]
>
> 0 0x50fc8 [0x260]: PERF_RECORD_BPF_METADATA \
> prog bpf_prog_1e0a2e366e56f1a2_perf_sample_filter
> entry 0: test_value = 42
> : unhandled!
Looks good, thanks!
Namhyung