Re: /proc file system, seems to -not- have standardisation ?

Theodore Y. Ts'o (tytso@MIT.EDU)
Wed, 19 Feb 1997 03:12:00 -0500


Well, I'll mention what I'm doing with /proc/tty, as an example of what
I consider to be good proc design:

/proc/tty contains the following files and directories

driver/
ldisc/
drivers
ldiscs

driver/ and ldisc/ are directories which contain proc files which are
registered by the driver or line discpline code itself. For example,
/proc/tty/driver/serial is where the serial specific information is
available. (Instead of /proc/serial, as one patch sent to me proposed).

/proc/tty/drivers and /proc/tty/ldiscs are files which contain a listing
of all of the drivers and line disciplines that are currently
registered.

As far as how information in the files should be organized, the current
format of /proc/tty/driver/serial is as follows:

serinfo:1.0 driver:4.22
0: uart:16550A port:0x3f8 irq:4 rx:34 tx:66 oe:4
1: uart:unknown port:0x2d8 irq:3
2: uart:unknown port:0x3e8 irq:4
3: uart:16550A port:0x2e8 irq:3 rx:4412 tx:1142 fe:45 brk:1

The fields are marked with a colon, fields that are zero are ommitted,
and there's expansion room for new fields and a new format, if
necessary.

As far as your suggestion about moviing around existing items --- think
very hard before doing so. A few extra pieces of "cruft" in the top
level of /proc isn't going to be the end of the world..... Is
/proc/meminfo really that worse compared with /proc/memory/meminfo?

- Ted