TRACECMD_OPTION_STRINGS which I assume provides the location of the STRINGS SECTION is not documented in the trace.dat v7.5 man pages. Also the STRING SECTION doc is somewhat confusing: > An ID of the string is used in the file meta data, which is the offset of the actual string into the string section. And then: > Strings can be stored into multiple string sections in the file. If strings are only encoded with an index inside "the" string section, how can there be multiple string sections without ambiguity ? It's also not clear what metadata it refers to. Is e.g. the string in the DATE option stored this way ?
Hi Douglas, I agree that the description in the man page is a bit unclear and should be improved. TRACECMD_OPTION_STRINGS is the id of a section with strings. Currently, only the descriptions of the sections are stored there, you can see them with "trace-cmd dump --strings". The file format allows multiple (physical) string sections in the file, which are combined into one virtual and continuous string section on file read. The ID of the string is the offset in this virtual continuous string section, not the actual offset in the file.
That makes sense, thanks for the details. So I suppose it's not really mandatory to parse it anyway unless you want to display a nicer error in case of unknown section with the section name.
Fixed by https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/commit/?id=6776d7af303beaf2c39c67d2443c88987900c387 ("trace-cmd: Update v7 trace.dat documentation to clarify the strings section")