Re: [PATCH v4 02/19] perf/uapi: Factor perf_build_id out into its own top-level struct

From: Peter Zijlstra

Date: Wed Nov 25 2026 - 08:18:12 EST


On Tue, Nov 24, 2026 at 04:50:51PM -0800, Ian Rogers wrote:
> Document struct perf_build_id as a top-level structure in the perf_event
> UAPI comment and add it to the PERF_RECORD_MMAP2 union comment so future
> sample types can reference struct perf_build_id directly.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> include/uapi/linux/perf_event.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> index c49fc76292f7..deb7c42d109b 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -1099,6 +1099,18 @@ enum perf_event_type {
> */
> PERF_RECORD_SAMPLE = 9,
>
> + /*
> + * Build IDs may be present in a number of events. They have a
> + * consistent encoding of:
> + *
> + * struct perf_build_id {
> + * u8 size;
> + * u8 __reserved_1;
> + * u16 __reserved_2;
> + * u8 data[20];
> + * };
> + */
> +
> /*
> * The MMAP2 records are an augmented version of MMAP, they add
> * maj, min, ino numbers to be used to uniquely identify each mapping
> @@ -1123,6 +1135,7 @@ enum perf_event_type {
> * u16 __reserved_2;
> * u8 build_id[20];
> * };
> + * struct perf_build_id bid;

Why not remove the anonymous version?

> * };
> * u32 prot, flags;
> * char filename[];
> --
> 2.56.1.831.g720f3f5937-goog
>