Access to kmem - System namelist - 'ps' etc
Steven M. Haflich
smh at mit-eddie.UUCP
Sat Dec 29 03:41:34 AEST 1984
These various ideas to make kernel structure accesses more efficient are
certainly well motivated, but I will never understand the current
propensity for installing less-than-absolutely-necessary hacks in the
kernel. I paraphrase a theorem from DMR's [?] dimly-remembered but
venerable paper on the implementation of Unix: The kernel is [ought to
be] little more than an I/O multiplexer. My corollary: Every byte of
kernel code implementing unnecessary or little-used features is a byte
permanently unavailable for buffer cache and paging user code.
Historically the kernel namelist problem has been elegantly solved many
times by various commands which, upon first invocation after a reboot,
create a predigested symbol table file somewhere (like in /tmp, which
gets cleared out by every reboot). It seems to me that the right thing
to do is to standardize this procedure, run it just once per boot from
/etc/rc, and be done with it. Existing tools are perfectly adequate:
nm -pg /vmunix | fgrep -f /interesting_symbols > /kernel_symbols
The resulting /kernel_symbols file is quite short and can be read and
parsed trivially and quickly using scanf. The mechanism seems elegant
and Unixy, something becoming rare in these days of .5MB kernels.
More information about the Comp.unix.wizards
mailing list