aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-04-04 11:10:37 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-04-04 14:11:10 -0400
commit93905494355b23d4323e59bc53aa1cfb01402fe6 (patch)
tree9e1fba5c98e50660c59405461323c68771cef06c
parent6970855d121a02724111f0ed315845377686f500 (diff)
downloadtrace-cmd-93905494355b23d4323e59bc53aa1cfb01402fe6.tar.gz
trace-cmd library: Process trace_clock for v7 trace.dat files
One of my ftrace tests records tracing data with the counter clock (just counts by 1 for every event, it is not a time stamp), but the test failed with the latest trace-cmd, as it was showing the counters as "usecs" and truncating them: Instead of: <idle>-0 [002] 818923: sched_switch: swapper/2:0 [120] R ==> sleep:8298 [120] <idle>-0 [003] 818924: sched_switch: swapper/3:0 [120] R ==> rb_consumer:47 [139] <idle>-0 [000] 818925: sched_switch: swapper/0:0 [120] R ==> trace-cmd:8293 [120] sleep-8298 [002] 818926: sched_switch: sleep:8298 [120] Z ==> swapper/2:0 [120] It was showing the output like: sleep-8225 [002] 0.000809: sched_switch: sleep:8225 [120] S ==> swapper/2:0 [120] <idle>-0 [003] 0.000809: sched_switch: swapper/3:0 [120] R ==> rcu_preempt:13 [120] rcu_preempt-13 [003] 0.000809: sched_switch: rcu_preempt:13 [120] W ==> swapper/3:0 [120] <idle>-0 [003] 0.000809: sched_switch: swapper/3:0 [120] R ==> rcu_preempt:13 [120] When the TRACECLOCK option is found, use it to set the appropriate clock for trace-cmd. Link: https://lore.kernel.org/linux-trace-devel/20220404111037.2248bb52@gandalf.local.home Fixes: 02dfe3593624 ("trace-cmd library: Initialize CPU data for reading from version 7 trace files") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--lib/trace-cmd/trace-input.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index d3500629..9943d69e 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -3435,6 +3435,7 @@ static int handle_options(struct tracecmd_input *handle)
goto out;
break;
case TRACECMD_OPTION_TRACECLOCK:
+ tracecmd_parse_trace_clock(handle, buf, size);
if (!handle->ts2secs)
handle->use_trace_clock = true;
break;