Re: ARMS WAVING!!! Proposal to fix /proc dainbrammage.

Tethys (tethys@ml.com)
Mon, 26 Oct 1998 11:18:03 +0000


>In article <Pine.LNX.3.91.981024070909.7978B-100000@mhw.ULib.IUPUI.Edu> Mark W
>ood writes:
>>[...] Perhaps much more important than
>>endianness or punctuation is once and for all settling the question of
>>whether /proc is for humans or for programs.
> ^^^^^^ ^^^^^^^^
> That is a false dichotomy. /proc is aimed at scripts (a type
>of program) and, to a lesser degree, system administrators (a type of
>human) and programmers.
>
> /proc enables programs that may be as simple shell scripts to
>access all kinds of obscure kernel data in a concise, obvious and
>easily debuggable style without necessarily needing a layer of C
>library calls and helper programs, using the strategy of putting
>everything in text formats designed to be as easy as possible to parse
>by programs and viewed by system administrators. The rise of "scripting"
>languages shows that this approach ends up being beneficial to a wider
>range of programs and users than one would initially think, because it
>enables more or better software to be produced from a given amount of
>effort, or enables software to be produced faster.

My take on this is that all information in /proc should be available
from sysctl() or some other similar method. The contents of /proc
should be human readable. For scripting purposes, I'd have a userland
program (called sysctl?) that's simply a wrapper around the appropriate
calls to sysctl(). That way, the human readable output of /proc could
be changed as appropriate without affecting programs that rely on the
information (which would be using the "official" interface, the sysctl
userland program, which wouldn't change).

Yes, starting a new process is a higher cost than simply reading a
file in /proc, but if you wanted performance, you wouldn't be scripting.

Tet

--
Politicians should read SF, not westerns and detective stories. - A.C.Clarke
--------------------+--------------+----------------------------------------
tethys@ml.com       |  Micro$oft:  | Linux,  the choice of a GNU generation.
tet@astradyne.co.uk | Just say no! | See http://www.uk.linux.org for details

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/