Subject: bin/940: systat's iostat screen does not correcly display idle time
To: None <gnats-admin@NetBSD.ORG>
From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>
List: netbsd-bugs
Date: 04/04/1995 05:05:07
>Number:         940
>Category:       bin
>Synopsis:       systat's iostat screen does not correcly display idle time
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr  4 05:05:03 1995
>Originator:     Kenneth Stailey
>Organization:
self
>Release:        NetBSD 1.0A supped April 1 1995
>Environment:
System: NetBSD pluto 1.0A NetBSD 1.0A (PLUTO) #0: Sun Apr 2 12:21:12 EDT 1995 ken@pluto:/usr/src/sys/arch/i386/compile/PLUTO i386


>Description:
	The cpu times are in this order: user, nice, system, interrupt, idle.
	'Systat' is coded as if they where: user, nice, system, idle.
	As a result the interrupt time comes out in the idle field, and
	since no value is currenly computed for interrupt, the idle field
	is always equal to zero.
>How-To-Repeat:
	Run 'systat -i', observe that idle field never has a value > 0.
>Fix:
this goes in the /usr/src/usr.bin/systat directory.
--- iostat.c.DIST	Fri Jan 20 03:51:57 1995
+++ iostat.c	Wed Mar 15 13:26:53 1995
@@ -174,6 +174,7 @@
 	mvwaddstr(wnd, row++, 0, "cpu  user|");
 	mvwaddstr(wnd, row++, 0, "     nice|");
 	mvwaddstr(wnd, row++, 0, "   system|");
+	mvwaddstr(wnd, row++, 0, "interrupt|");
 	mvwaddstr(wnd, row++, 0, "     idle|");
 	if (numbers)
 		row = numlabels(row + 1);
@@ -265,9 +266,9 @@
 	row = 1;
 
 	/*
-	 * Last CPU state not calculated yet.
+	 * Interrupt CPU state not calculated yet.
 	 */ 
-	for (i = 0; i < CPUSTATES - 1; i++)
+	for (i = 0; i < CPUSTATES; i++)
 		stat1(row++, i);
 	if (!numbers) {
 		row += 2;

--HAA00323.796996251/pluto.spacenet.com--


>Audit-Trail:
>Unformatted: