Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix timer_stats printout of events/sec

When using /proc/timer_stats on ppc64 I noticed the events/sec field wasnt
accurate. Sometimes the integer part was incorrect due to rounding (we
werent taking the fractional seconds into consideration).

The fraction part is also wrong, we need to pad the printf statement and
take the bottom three digits of 1000 times the value.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Anton Blanchard and committed by
Linus Torvalds
74922be1 0c2043ab

+3 -2
+3 -2
kernel/time/timer_stats.c
··· 327 327 ms = 1; 328 328 329 329 if (events && period.tv_sec) 330 - seq_printf(m, "%ld total events, %ld.%ld events/sec\n", events, 331 - events / period.tv_sec, events * 1000 / ms); 330 + seq_printf(m, "%ld total events, %ld.%03ld events/sec\n", 331 + events, events * 1000 / ms, 332 + (events * 1000000 / ms) % 1000); 332 333 else 333 334 seq_printf(m, "%ld total events\n", events); 334 335