On Sat, Dec 4, 2021 at 3:35 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Thu, 11 Nov 2021 17:09:00 +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 > > <string>, null terminated ASCII string, description of the header > > We may have discussed this before, but I don't remember. Why did we make > the second item a string? I would think we would want all the fixed size > portions of the header to be first, and the variable size portion to be > last? > The only reason to have a string is for "trace-cmd dump" - to be able to dump some description for unknown sections, we discussed that in the past. But now when I'm looking at that again - there is no sense to have it only for that reason, the ID is enough. I can remove the string from the header. > <2 bytes> header ID > <2 bytes> section flags > <4 bytes> size of section. > > Although, is 4 bytes big enough? Perhaps it should be 8 bytes? What happens > if a section is bigger than 4 gigs? agree, I will make it 8 bytes in the next version. > > And then have the string description at the end. Thoughts? > > -- Steve > > > > <2 bytes>, section flags: > > 1: the section is compressed > > <4 bytes>, size of the section > > > > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> > > --- > > include/trace-cmd/trace-cmd.h | 5 ++ > > .../include/private/trace-cmd-private.h | 1 + > > lib/trace-cmd/include/trace-cmd-local.h | 5 ++ > > lib/trace-cmd/trace-output.c | 68 +++++++++++++++++++ > > 4 files changed, 79 insertions(+) > > -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center
![]() |