Bug 16206

Summary: PATCH: vmstat column alignment, %ll not supported in -stable
Product: Base System Reporter: jc <jc>
Component: binAssignee: Jens Schweikhardt <schweikh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jc 2000-01-19 16:00:01 UTC
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
Comment 1 jc 2000-01-19 16:17:52 UTC
Quoting John Capo (jc@irbs.com):
> +	(void)printf("Total        %10qu %8qu\n", inttotal,
> +			inttotal / uptime);

I should have made the Total field width larger, perhaps very large.

        (void)printf("Total%18qu %8qu\n", inttotal,

A field width of 10 overflows on several of my machines.
Comment 2 Mike Heffner freebsd_committer freebsd_triage 2001-06-24 05:59:11 UTC
Responsible Changed
From-To: freebsd-bugs->schweikh

Jens been doing some work with columns widths in vmstat.
Comment 3 Jens Schweikhardt freebsd_committer freebsd_triage 2001-06-26 19:49:22 UTC
State Changed
From-To: open->closed

Fixed in -current. Thanks a bunch, John!