diff options
author | jhay <jhay@FreeBSD.org> | 1998-05-27 21:01:37 +0000 |
---|---|---|
committer | jhay <jhay@FreeBSD.org> | 1998-05-27 21:01:37 +0000 |
commit | 02b6208b98526c48563bb198479cf2cbe0480d2b (patch) | |
tree | 950697f99207f9991fa77a5e9321d70593f726ab | |
parent | f9b1d081712f1294cabf5a158fd607832fdf119d (diff) | |
download | FreeBSD-src-02b6208b98526c48563bb198479cf2cbe0480d2b.zip FreeBSD-src-02b6208b98526c48563bb198479cf2cbe0480d2b.tar.gz |
Correctly display the interrupt counts.
Reviewed with optimizations by: Tor Egge <tegge>
-rw-r--r-- | usr.bin/systat/vmstat.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 5faf3c0..ad35b55 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif static const char rcsid[] = - "$Id: vmstat.c,v 1.22 1997/08/13 06:45:11 charnier Exp $"; + "$Id: vmstat.c,v 1.23 1997/09/25 01:14:25 peter Exp $"; #endif /* not lint */ /* @@ -104,6 +104,7 @@ static void putint __P((int, int, int, int)); static void putfloat __P((double, int, int, int, int, int)); static int ucount __P((void)); +static int ncpu; static int ut; static char buf[26]; static time_t t; @@ -402,6 +403,7 @@ showkre() } failcnt = 0; etime /= hertz; + etime /= ncpu; inttotal = 0; for (i = 0; i < nintr; i++) { if (s.intrcnt[i] == 0) @@ -642,6 +644,9 @@ getinfo(s, st) error("Can't get kernel info: %s\n", strerror(errno)); bzero(&s->Total, sizeof(s->Total)); } + size = sizeof(ncpu); + if (sysctlbyname("hw.ncpu", &ncpu, &size, NULL, 0) < 0) + ncpu = 1; } static void |