On Sat, Jan 15, 2022 at 2:59 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Fri, 10 Dec 2021 12:54:28 +0200 > "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > > > Introduce headers before each file section, in trace file version 7. The > > section header has the following format: > > <2 bytes>, header ID > > <4 bytes>, offset within the strings section, where the section > > description string is located. > > <2 bytes>, section flags: > > 1: the section is compressed > > Would in make more sense to have the ID and flags together, followed by > the string? That way you could use a normal structure to represent it. > It would make sense in the previous version of this implementation, where a dynamic string was stored between the ID and the flags. Now as all these are in fixed positions, the order should not be a problem. But anyway, I'll change it in the next version. > struct { > unsigned short id; > unsigned short flags; > unsigned int string_offset; > unsigned long long size; > }; > > Otherwise, all tools to read it will be forced to read each part > individually. I can imaging that being annoying in the future. > > -- Steve > > > > <8 bytes>, size of the section > > > > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> > > --- -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center