[Bug 262687] vmstat does not handle disk names properly, column alignment broken if number of DA disks goes over 9

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 20 Mar 2022 16:58:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262687

            Bug ID: 262687
           Summary: vmstat does not handle disk names properly, column
                    alignment broken if number of DA disks goes over 9
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: oleg.cherkasov@linux.com

Hi,

vmstat does not handle disk names properly if the counter goes over 9.  Here is
the example from my system with 16 disks:

vmstat -p SCSI -n 32 2

 procs    memory    page                      disks                            
                                faults       cpu
 r  b  w  avm  fre  flt  re  pi  po   fr   sr da0 da1 da2 da3 da4 da5 da6 da7
da8 da9 da10 da11 da12 da13 da14 da15   in   sy   cs us sy id
 4  0  1 454G  32G  951  46 163   0 1.9K 9.3K   0   0   0   0   0   0   0   0  
0   0   0   0   0   0   0   0  465 9.1K 7.9K  5  1 94
 1  0  1 454G  32G  12K   0  46   0  13K 4.1K  37  37   4   4   4   4   4   4  
1   1   1   1   1   1   1   1  147  15K 4.1K  3  1 96
 3  0  1 454G  32G 6.0K   0 290   0 7.8K 4.1K   0   0  72  68  69  65  65  69 
61  60  60  58  63  61  66  60  877  18K 9.5K  8  1 92
 1  0  1 454G  32G 6.4K   0 254   0 5.9K 4.2K  37  36  12  12  12  12  12  12 
13  13  13  13  14  14  14  14  241  18K 5.0K  7  1 92
 1  0  1 454G  32G  16K   0   5   0  18K 4.0K   0   0   0   0   0   0   0   0  
5   5   4   4   4   4   5   5   86  11K 2.2K  2  0 97
 1  0  1 454G  32G 6.9K   0   0   0 5.4K 4.2K   0   0  50  48  54  51  56  52 
46  44  47  45  43  46  43  42  713  14K 6.8K  3  1 96

There is an assumption that disk number length is always equal to 1 (single
digit).

-- 
You are receiving this mail because:
You are the assignee for the bug.