diff mbox series

[v3,17/23] trace-cmd: Change "--nodate" option to affect "--date" option only

Message ID 20210324130418.436206-18-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series TSC trace clock to nanosecond conversion | expand

Commit Message

Tzvetomir Stoyanov (VMware) March 24, 2021, 1:04 p.m. UTC
When displaying a trace.dat file, the option "--nodate" disables all
corrections on the events timestamps. It was originally designed to
suppress the "timestamp to date" translation, triggered by the "--date"
record option. When more timestamp corrections have been implemented,
the same option "--nodate" was used for all of them.
Now there is a new flag RAW_TS and new option "--raw-ts", that is used
to show raw event timestamps, without any correction. The "--nodate" is
changed to suppress the "--date" option only, and the new "--raw-ts"
affects all timestamps corrections.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/trace-input.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 27ddd8eb..9b4f8cca 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2618,7 +2618,7 @@  static int handle_options(struct tracecmd_input *handle)
 			 * Similar to date option, but just adds an
 			 * offset to the timestamp.
 			 */
-			if (handle->flags & TRACECMD_FL_IGNORE_DATE)
+			if (handle->flags & TRACECMD_FL_RAW_TS)
 				break;
 			offset = strtoll(buf, NULL, 0);
 			handle->ts_offset += offset;
@@ -2633,7 +2633,7 @@  static int handle_options(struct tracecmd_input *handle)
 			 * long long array of size [count] of timestamp offsets.
 			 * long long array of size [count] of timestamp scaling ratios.*
 			 */
-			if (size < 16 || handle->flags & TRACECMD_FL_IGNORE_DATE)
+			if (size < 16 || (handle->flags & TRACECMD_FL_RAW_TS))
 				break;
 			handle->host.peer_trace_id = tep_read_number(handle->pevent,
 								     buf, 8);