trace-cmd: Do not depend on timestamp not being zero
trace-cmd will interleave events based on timestamp when reading
multiple buffers (for each CPU as well as between trace files).
Currently, it is assumed that no timestamp will be zero, as tracing
doesn't start until a bit of time has passed. This is an incorrect
assumption, as tracing can use a "counter" clock that is not based on
time, as well as new ftrace code can start really early in boot before
the timer is active and all events will have a zero timestamp.
This causes trace-cmd to print events out of order, or worse, not even
show events with timestamps of zero.
Use a 'first_record' flag instead of the shortcut to use a timestap of
zero to denote if a record has been compared or not.
Signed-off-by: Steven Rostedt <firstname.lastname@example.org>
2 files changed