UPSTREAM: trace: Add an option for boot clock as trace clock
authorJoel Fernandes <joelaf@google.com>
Mon, 28 Nov 2016 22:35:23 +0000 (14:35 -0800)
committerJoel Fernandes <joelaf@google.com>
Tue, 29 Nov 2016 02:46:46 +0000 (18:46 -0800)
Unlike monotonic clock, boot clock as a trace clock will account for
time spent in suspend useful for tracing suspend/resume. This uses
earlier introduced infrastructure for using the fast boot clock.

Bug: b/33184060

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c

index 5f375d4c05fb9d95cbacc7955a674ba37b72eb5a..312557c04c10a4c0710b8788f4cc1aadeaa7f715 100644 (file)
@@ -890,6 +890,7 @@ static struct {
        { trace_clock,                  "perf",         1 },
        { ktime_get_mono_fast_ns,       "mono",         1 },
        { ktime_get_raw_fast_ns,        "mono_raw",     1 },
+       { ktime_get_boot_fast_ns,       "boot",         1 },
        ARCH_TRACE_CLOCKS
 };