Date: Wed, 14 Aug 2002 17:04:35 -0700 (PDT) From: Aragon Gouveia <aragon@phat.za.net> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/41674: iostat column formatting overlaps Message-ID: <200208150004.g7F04ZAI057147@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 41674
>Category: misc
>Synopsis: iostat column formatting overlaps
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 14 17:10:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Aragon Gouveia
>Release: 4.6-STABLE
>Organization:
>Environment:
FreeBSD host.fqdn.org 4.6-STABLE FreeBSD 4.6-STABLE #0: Thu Aug 8 23:39:11 SAST 2002 root@host.fqdn.org:/usr/src/sys/compile/KERN i386
>Description:
When iostat outputs CPU usage values, columns are too narrow to accomodate 100%. For example:
tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id
68 103 0.00 0 0.00 0.00 0 0.00 0 0 0 0100
0 319 0.00 0 0.00 0.00 0 0.00 0 0 0 0100
Making it both slightly confusing to read, and a nightmare to accurately text process.
>How-To-Repeat:
>Fix:
Simple reformatting. Diff available from http://decoder.geek.sh/iostat.aragon.diff and also follows below :
--- iostat.c Thu Jul 19 06:15:42 2001
+++ iostat.c.new Thu Aug 15 01:43:07 2002
@@ -551,7 +551,7 @@
}
}
if ((dflag == 0) || (Cflag > 0))
- (void)printf(" cpu\n");
+ (void)printf(" cpu\n");
else
(void)printf("\n");
@@ -576,7 +576,7 @@
}
}
if ((dflag == 0) || (Cflag > 0))
- (void)printf(" us ni sy in id\n");
+ (void)printf(" us ni sy in id\n");
else
printf("\n");
@@ -674,6 +674,6 @@
for (state = 0; state < CPUSTATES; ++state)
time += cur.cp_time[state];
for (state = 0; state < CPUSTATES; ++state)
- printf("%3.0f",
+ printf("%6.1f",
100. * cur.cp_time[state] / (time ? time : 1));
}
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208150004.g7F04ZAI057147>
