Commit 11043d8b125671a32253cddb0b05177be0e976f6
Committed by
Steven Rostedt
1 parent
8be0709f10
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com> Signed-off-by: David Sharp <dhsharp@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Showing 1 changed file with 17 additions and 6 deletions Side-by-side Diff
kernel/trace/trace.c
... | ... | @@ -4388,13 +4388,24 @@ |
4388 | 4388 | cnt = ring_buffer_bytes_cpu(tr->buffer, cpu); |
4389 | 4389 | trace_seq_printf(s, "bytes: %ld\n", cnt); |
4390 | 4390 | |
4391 | - t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu)); | |
4392 | - usec_rem = do_div(t, USEC_PER_SEC); | |
4393 | - trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n", t, usec_rem); | |
4391 | + if (trace_clocks[trace_clock_id].in_ns) { | |
4392 | + /* local or global for trace_clock */ | |
4393 | + t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu)); | |
4394 | + usec_rem = do_div(t, USEC_PER_SEC); | |
4395 | + trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n", | |
4396 | + t, usec_rem); | |
4394 | 4397 | |
4395 | - t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu)); | |
4396 | - usec_rem = do_div(t, USEC_PER_SEC); | |
4397 | - trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem); | |
4398 | + t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu)); | |
4399 | + usec_rem = do_div(t, USEC_PER_SEC); | |
4400 | + trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem); | |
4401 | + } else { | |
4402 | + /* counter or tsc mode for trace_clock */ | |
4403 | + trace_seq_printf(s, "oldest event ts: %llu\n", | |
4404 | + ring_buffer_oldest_event_ts(tr->buffer, cpu)); | |
4405 | + | |
4406 | + trace_seq_printf(s, "now ts: %llu\n", | |
4407 | + ring_buffer_time_stamp(tr->buffer, cpu)); | |
4408 | + } | |
4398 | 4409 | |
4399 | 4410 | cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu); |
4400 | 4411 | trace_seq_printf(s, "dropped events: %ld\n", cnt); |