Bug 262687 - vmstat does not handle disk names properly, column alignment broken if number of DA disks goes over 9
Summary: vmstat does not handle disk names properly, column alignment broken if number...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-20 16:58 UTC by Oleg Cherkasov
Modified: 2022-03-21 08:49 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Cherkasov 2022-03-20 16:58:27 UTC
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).