Bug 197353 - /proc/net/dev columns don't line up
Summary: /proc/net/dev columns don't line up
Status: RESOLVED WILL_NOT_FIX
Alias: None
Product: Networking
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-22 21:44 UTC by Dan Jacobson
Modified: 2017-10-23 14:41 UTC (History)
0 users

See Also:
Kernel Version: 4.13
Tree: Mainline
Regression: No


Attachments

Description Dan Jacobson 2017-10-22 21:44:35 UTC
Some columns don't line up:
$ cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:  520401    1604    0    0    0     0          0         0   520401    1604    0    0    0     0       0          0
wlp2s0b1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
enp1s0: 149899665  108492    0    0    0     0          0         0  6876084   68889    0    0    0     0       0          0
  ppp0: 147510463  108431    0    0    0     0          0         0  5352451   68759    0    0    0     0       0          0
Comment 1 Stephen Hemminger 2017-10-23 14:41:07 UTC
The file /proc/net/dev is really not intended for direct user consumption in modern Linux.

The columns are printed with a printf format that was wide enough in the days of 32 bit systems (%8llu). With 64 bit systems the full width of a statistic can be bigger than 8.

This can't be fixed because it might break existing apps that are parsing the output.

Note You need to log in before you can comment on or make changes to this bug.