Re: [PATCH 03/24] perf: Add build id data in mmap2 event

From: Peter Zijlstra
Date: Tue Nov 10 2020 - 03:07:36 EST


On Mon, Nov 09, 2020 at 10:53:54PM +0100, Jiri Olsa wrote:
> Adding support to carry build id data in mmap2 event.
>
> The build id data replaces maj/min/ino/ino_generation
> fields, whichc are also used to identify map's binary,
> so it's ok to replace them with build id data:
>
> union {
> struct {
> u32 maj;
> u32 min;
> u64 ino;
> u64 ino_generation;
> };
> struct {
> u8 build_id[20];
> u8 build_id_size;

What's the purpose of a size field for a fixed size array? Also, I'd
flip the order of these fields, first have the size and then the array.

> u8 __reserved_1;
> u16 __reserved_2;
> };
> };
>
> Replaced maj/min/ino/ino_generation fields give us size
> of 24 bytes. We use 20 bytes for build id data, 1 byte
> for size and rest is unused.