I tried to make Event implement Debug to easily add debugging information in retis and found out that:
error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not derive `Copy`
and String does not implement Copy.
That and the fact that in order to avoid misaligned accesses, sometimes EventSection fields have to be copied first (which probably makes writing getters complicated), makes me think we should avoid using EventSections to parse bpf directly (using packed and Plain). Creating an issue to try to do some macro magic to generate the packed version and avoid boilerplate explosion.
I tried to make Event implement
Debug
to easily add debugging information in retis and found out that:and
String
does not implementCopy
.That and the fact that in order to avoid misaligned accesses, sometimes EventSection fields have to be copied first (which probably makes writing getters complicated), makes me think we should avoid using EventSections to parse bpf directly (using
packed
andPlain
). Creating an issue to try to do some macro magic to generate the packed version and avoid boilerplate explosion.