lkml.org 
[lkml]   [1996]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: /proc/net/dev: candidate for reformatting
Date
> Despite of some problems with the network card I'd like to present an 
> other candidate to reformat a little:
>
> pc1542:/proc/net# cat dev
> Inter-| Receive | Transmit
> face |packets errs drop fifo frame|packets errs drop fifo colls carrier
> lo: 3041 0 0 0 0 3041 0 0 0 0 0
> eth0:16010389 0 421559 0 71224 110093 0 0 0 2578 0
> pc1542:/proc/net#
>
> This is after an uptime of 29 days on a NOT busy machine.
>
> This is from /proc/net/udp:
>
> 67: 00000000:0043 00000000:0000 07 00000000:00000000 00:F09045D1 00000000 0 0
> 111: 00000000:006F 00000000:0000 07 00000000:00000000 00:F09045D1 00000000 0 0
>
> Note the shift because of one more digit for the slot. This applies
> to tcp and raw as well.

This is why _all_ numbers in /proc should be 0-padded hex.

For many files, fixed-record length text is most appropriate.
You get most of the speed of a binary format while /bin/cat
is still usable when the proper tool is missing. It is possible
to read and write hex numbers much faster than decimal numbers,
most of all 0-padded ones at fixed offsets.



\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.048 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site