> +namespace perf_data {
> +
> +/* Scalar loaders for little-endian perf binary payloads. afdo_tools
> + supports only little-endian hosts (enforced by configure) and
> + little-endian perf.data files. memcpy into a native integer. */
Well in this case you could just use the structs directly?
The wrappers seem overkill.
> +/* Bit layout matches Linux `PERF_SAMPLE_*`
> (include/uapi/linux/perf_event.h).
> + perf.data attrs.sample_type uses these values. */
Why not just use the standard linux include?
> +
> +#pragma pack(push, 1)
Is the pack only needed for the sizeof of the struct? Otherwise I don't
think anybody supported does unnatural alignment.