summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2016-08-11 14:35:01 -0700
committerJohn Stultz <john.stultz@linaro.org>2016-08-31 14:43:34 -0700
commit0bf43f15db857e83daf4134aa062c8b157a80ee0 (patch)
tree5a632667392b9e47f75a6bd5f0ded329bcc7976d /kernel/time
parent36374583f9084cdab4b5dcf5521a3ce55bebb9fa (diff)
timekeeping: Prints the amounts of time spent during suspend
In addition to keeping a histogram of suspend times, also print out the time spent in suspend to dmesg. This helps to keep track of suspend time while debugging using kernel logs. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com> [jstultz: Tweaked commit message] Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timekeeping_debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c
index 107310a6f36f..ca9fb800336b 100644
--- a/kernel/time/timekeeping_debug.c
+++ b/kernel/time/timekeeping_debug.c
@@ -75,5 +75,7 @@ void tk_debug_account_sleep_time(struct timespec64 *t)
int bin = min(fls(t->tv_sec), NUM_BINS-1);
sleep_time_bin[bin]++;
+ pr_info("Suspended for %lld.%03lu seconds\n", (s64)t->tv_sec,
+ t->tv_nsec / NSEC_PER_MSEC);
}