Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/usr.bin/systat Pull up revision 1.21 (requested by somm...
details: https://anonhg.NetBSD.org/src/rev/de127ef9dd06
branches: netbsd-1-6
changeset: 528301:de127ef9dd06
user: lukem <lukem%NetBSD.org@localhost>
date: Sun Jun 30 05:47:15 2002 +0000
description:
Pull up revision 1.21 (requested by sommerfeld in ticket #406):
Since the KERN_CP_TIME sysctl reports total clock ticks across all
cpus and hz is measured in ticks per cpu, divide tick count by ncpu to
determine elapsed time since last sample.
Fixes I/O rate deflation observed on multiprocessors.
diffstat:
usr.bin/systat/iostat.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diffs (39 lines):
diff -r 68878b23d9ee -r de127ef9dd06 usr.bin/systat/iostat.c
--- a/usr.bin/systat/iostat.c Sat Jun 29 23:26:02 2002 +0000
+++ b/usr.bin/systat/iostat.c Sun Jun 30 05:47:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iostat.c,v 1.19.4.1 2002/06/10 16:31:28 tv Exp $ */
+/* $NetBSD: iostat.c,v 1.19.4.2 2002/06/30 05:47:15 lukem Exp $ */
/*
* Copyright (c) 1980, 1992, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: iostat.c,v 1.19.4.1 2002/06/10 16:31:28 tv Exp $");
+__RCSID("$NetBSD: iostat.c,v 1.19.4.2 2002/06/30 05:47:15 lukem Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -190,18 +190,12 @@
return;
dkswap();
- etime = 0;
- for(i = 0; i < CPUSTATES; i++) {
- etime += cur.cp_time[i];
- }
- if (etime == 0.0)
- etime = 1.0;
- etime /= (float) hz;
+ etime = cur.cp_etime;
row = 1;
/*
* Interrupt CPU state not calculated yet.
- */
+ */
for (i = 0; i < CPUSTATES; i++)
stat1(row++, i);
if (!numbers) {
Home |
Main Index |
Thread Index |
Old Index