Bug 217351 - Confusing/missing doc for string section in trace-cmd.dat.v7.5.txt
Summary: Confusing/missing doc for string section in trace-cmd.dat.v7.5.txt
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Default virtual assignee for Trace-cmd and kernelshark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-18 16:12 UTC by Douglas RAILLARD
Modified: 2023-06-07 19:38 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Douglas RAILLARD 2023-04-18 16:12:02 UTC
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 ?
Comment 1 Tzvetomir Stoyanov (VMware) 2023-04-18 17:13:29 UTC
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.
Comment 2 Douglas RAILLARD 2023-04-19 09:04:24 UTC
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.
Comment 3 Steven Rostedt 2023-06-07 19:38:30 UTC
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")

Note You need to log in before you can comment on or make changes to this bug.