Date: Wed, 19 Jan 2000 10:54:10 -0500 (EST) From: John Capo <jc@irbs.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/16206: PATCH: vmstat column alignment, %ll not supported in -stable Message-ID: <200001191554.KAA05077@irbs.irbs.com>
next in thread | raw e-mail | index | archive | help
>Number: 16206
>Category: bin
>Synopsis: PATCH: vmstat column alignment, %ll not supported in -stable
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jan 19 08:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: John Capo
>Release: FreeBSD 3.4-STABLE i386
>Organization:
IRBS Engineering
>Environment:
3.4 system with high interrupt rate
>Description:
3.4 with latest vmstat.c MFC:
interrupt total rate
clk0 irq0 88009614 99
rtc0 irq8 112654001 127
pci irq12 1681736896 1910
pci irq15 824752586 937
pci irq10 1645044289 1869
pci irq11 206810620 234
fdc0 irq6 1 0
wdc0 irq14 149002 0
Total 264189713 1
Bogus column alignment and Total printed as 32 bit value.
With included patch:
interrupt total rate
clk0 irq0 88010165 99
rtc0 irq8 112654707 127
pci irq12 1681747863 1910
pci irq15 824757776 937
pci irq10 1645055676 1869
pci irq11 206811727 234
fdc0 irq6 1 0
wdc0 irq14 149004 0
Total 4559186919 5180
>How-To-Repeat:
Generate a bunch of interrupts, run vmstat -i
>Fix:
Index: vmstat.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/vmstat/vmstat.c,v
retrieving revision 1.29.2.3
diff -u -r1.29.2.3 vmstat.c
--- vmstat.c 2000/01/18 17:39:38 1.29.2.3
+++ vmstat.c 2000/01/19 15:43:43
@@ -774,18 +774,18 @@
errx(1, "malloc");
kread(X_INTRCNT, intrcnt, (size_t)nintr);
kread(X_INTRNAMES, intrname, (size_t)inamlen);
- (void)printf("interrupt total rate\n");
+ (void)printf("interrupt total rate\n");
inttotal = 0;
nintr /= sizeof(long);
while (--nintr >= 0) {
if (*intrcnt)
- (void)printf("%-12s %8lu %8lu\n", intrname,
+ (void)printf("%-12s %10lu %8lu\n", intrname,
*intrcnt, *intrcnt / uptime);
intrname += strlen(intrname) + 1;
inttotal += *intrcnt++;
}
- (void)printf("Total %8llu %8llu\n", inttotal,
- inttotal / (u_int64_t) uptime);
+ (void)printf("Total %10qu %8qu\n", inttotal,
+ inttotal / uptime);
}
void
>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?200001191554.KAA05077>
