提交 11043d8b 编写于 作者: Y Yoshihiro YUNOMAE 提交者: Steven Rostedt

tracing: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock

Show raw time stamp values for stats per cpu if you choose counter or tsc mode
for trace_clock. Although a unit of tracing time stamp is nsec in local or global mode,
the units in counter and TSC mode are tracing counter and cycles respectively.
Link: http://lkml.kernel.org/r/1352837903-32191-3-git-send-email-dhsharp@google.com

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: NDavid Sharp <dhsharp@google.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 8be0709f
...@@ -4388,13 +4388,24 @@ tracing_stats_read(struct file *filp, char __user *ubuf, ...@@ -4388,13 +4388,24 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
cnt = ring_buffer_bytes_cpu(tr->buffer, cpu); cnt = ring_buffer_bytes_cpu(tr->buffer, cpu);
trace_seq_printf(s, "bytes: %ld\n", cnt); trace_seq_printf(s, "bytes: %ld\n", cnt);
t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu)); if (trace_clocks[trace_clock_id].in_ns) {
usec_rem = do_div(t, USEC_PER_SEC); /* local or global for trace_clock */
trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n", t, usec_rem); t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu));
usec_rem = do_div(t, USEC_PER_SEC);
trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n",
t, usec_rem);
t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu));
usec_rem = do_div(t, USEC_PER_SEC);
trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem);
} else {
/* counter or tsc mode for trace_clock */
trace_seq_printf(s, "oldest event ts: %llu\n",
ring_buffer_oldest_event_ts(tr->buffer, cpu));
t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu)); trace_seq_printf(s, "now ts: %llu\n",
usec_rem = do_div(t, USEC_PER_SEC); ring_buffer_time_stamp(tr->buffer, cpu));
trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem); }
cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu); cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu);
trace_seq_printf(s, "dropped events: %ld\n", cnt); trace_seq_printf(s, "dropped events: %ld\n", cnt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册