aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-06-17 11:30:47 -0400
committerJohn Stultz <john.stultz@linaro.org>2016-06-20 15:47:33 -0400
commit7c71feb0a6766c7c3a262e3cc33ae231f3953cb6 (patch)
tree0013bd8099c1a042faf755da832ca48345b48747
parent4a19bd3d22d51a0c89db10879dacaffa0f52aecf (diff)
timer: Avoid using timespec
The tstats_show() function prints a ktime_t variable by converting it to struct timespec first. The algorithm is ok, but we want to stop using timespec in general because of the 32-bit time_t overflow problem. This changes the code to use struct timespec64, without any functional change. Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/time/timer_stats.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
index 1adecb4b87c8..087204c733eb 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -279,7 +279,7 @@ static void print_name_offset(struct seq_file *m, unsigned long addr)
279 279
280static int tstats_show(struct seq_file *m, void *v) 280static int tstats_show(struct seq_file *m, void *v)
281{ 281{
282 struct timespec period; 282 struct timespec64 period;
283 struct entry *entry; 283 struct entry *entry;
284 unsigned long ms; 284 unsigned long ms;
285 long events = 0; 285 long events = 0;
@@ -295,11 +295,11 @@ static int tstats_show(struct seq_file *m, void *v)
295 295
296 time = ktime_sub(time_stop, time_start); 296 time = ktime_sub(time_stop, time_start);
297 297
298 period = ktime_to_timespec(time); 298 period = ktime_to_timespec64(time);
299 ms = period.tv_nsec / 1000000; 299 ms = period.tv_nsec / 1000000;
300 300
301 seq_puts(m, "Timer Stats Version: v0.3\n"); 301 seq_puts(m, "Timer Stats Version: v0.3\n");
302 seq_printf(m, "Sample period: %ld.%03ld s\n", period.tv_sec, ms); 302 seq_printf(m, "Sample period: %ld.%03ld s\n", (long)period.tv_sec, ms);
303 if (atomic_read(&overflow_count)) 303 if (atomic_read(&overflow_count))
304 seq_printf(m, "Overflow: %d entries\n", atomic_read(&overflow_count)); 304 seq_printf(m, "Overflow: %d entries\n", atomic_read(&overflow_count));
305 seq_printf(m, "Collection: %s\n", timer_stats_active ? "active" : "inactive"); 305 seq_printf(m, "Collection: %s\n", timer_stats_active ? "active" : "inactive");