Commit:     74922be1485818ed368c4cf4f0b100f70bf01e08
Parent:     0c2043abefacac97b6d01129c1123a466c95b7c1
Author:     Anton Blanchard <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 7 00:24:31 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Oct 7 16:28:43 2007 -0700

    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 <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/time/timer_stats.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c
index 3c38fb5..c36bb7e 100644
--- a/kernel/time/timer_stats.c
+++ b/kernel/time/timer_stats.c
@@ -327,8 +327,9 @@ static int tstats_show(struct seq_file *m, void *v)
                ms = 1;
        if (events && period.tv_sec)
-               seq_printf(m, "%ld total events, %ld.%ld events/sec\n", events,
-                          events / period.tv_sec, events * 1000 / ms);
+               seq_printf(m, "%ld total events, %ld.%03ld events/sec\n",
+                          events, events * 1000 / ms,
+                          (events * 1000000 / ms) % 1000);
                seq_printf(m, "%ld total events\n", events);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to