diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-26 15:47:03 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-26 15:47:03 -0400 |
commit | 1e1b37273cf719545da50b76f214f983a710aaf4 (patch) | |
tree | 033f6062325ef7aaeefe8559bb409ab7d2be3c76 /kernel/time/timekeeping_debug.c | |
parent | c183a603e8d8a5a189729b77d0c623a3d5950e5f (diff) | |
parent | c291b015158577be533dd5a959dfc09bab119eed (diff) |
Merge branch 'x86/urgent' into x86/apic
Bring in the upstream modifications so we can fixup the silent merge
conflict which is introduced by this merge.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/timekeeping_debug.c')
-rw-r--r-- | kernel/time/timekeeping_debug.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c index f6bd65236712..107310a6f36f 100644 --- a/kernel/time/timekeeping_debug.c +++ b/kernel/time/timekeeping_debug.c | |||
@@ -23,7 +23,9 @@ | |||
23 | 23 | ||
24 | #include "timekeeping_internal.h" | 24 | #include "timekeeping_internal.h" |
25 | 25 | ||
26 | static unsigned int sleep_time_bin[32] = {0}; | 26 | #define NUM_BINS 32 |
27 | |||
28 | static unsigned int sleep_time_bin[NUM_BINS] = {0}; | ||
27 | 29 | ||
28 | static int tk_debug_show_sleep_time(struct seq_file *s, void *data) | 30 | static int tk_debug_show_sleep_time(struct seq_file *s, void *data) |
29 | { | 31 | { |
@@ -69,6 +71,9 @@ late_initcall(tk_debug_sleep_time_init); | |||
69 | 71 | ||
70 | void tk_debug_account_sleep_time(struct timespec64 *t) | 72 | void tk_debug_account_sleep_time(struct timespec64 *t) |
71 | { | 73 | { |
72 | sleep_time_bin[fls(t->tv_sec)]++; | 74 | /* Cap bin index so we don't overflow the array */ |
75 | int bin = min(fls(t->tv_sec), NUM_BINS-1); | ||
76 | |||
77 | sleep_time_bin[bin]++; | ||
73 | } | 78 | } |
74 | 79 | ||