Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
external/trace: Introduce structure for reading traces
Currently the trace_get and trace_empty functions operate on a tracebuf struct. This requires being able to write to that struct. If dump_trace were able to use these functions it would be convenient as it would reduce code duplication and these functions are already unit tested. However, a tracebuf accessed via mmaping will not be able to be written. The tracebuf struct fields that need to be written are only to be used by a reader. The fields are never used by a writer. Add a new structure for readers, trace_reader, which contains these fields and remove them from the tracebuf struct. Change trace_get and trace_empty to use the trace_reader struct and update the unit tests accordingly. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
- Loading branch information
1 parent
8c47630
commit 3f61c83
Showing
4 changed files
with
73 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters