Re: /proc/cpuinfo verbiage differ unnecessarily between ports...

Mark H. Wood (mwood@IUPUI.Edu)
Fri, 3 Sep 1999 12:51:04 -0500 (EST)


On 3 Sep 1999, Jes Sorensen wrote:
> >>>>> "Glen" == Glen Turner <glen.turner@adelaide.edu.au> writes:
>
> Glen> As the author of some SNMP code, I'd like to see the *whole* of
> Glen> /proc adopt a consistent, simple to parse, simple to read,
> Glen> simple to write structure.
>
> Actually for this you'd want a simple sructured kernel interface,
> maybe via syscall, to get this information out of the kernel rather
> than having your user space tool parse /proc. Having the kernel
> generate ascii strings, then copying these to user space just to have
> the user space application reparse them in the end is pretty expensive
> when all you really want is to read an integer value or two.

Hear, hear.

I've created a patch that flattens out the IPV4 statistics into individual
longs retrievable via sysctl (so you can still find them in /proc if you
want them there) that I mean to hack into UCD SNMP at some point, for just
this reason (among others).

There's still a problem though, if I understand sysctl's argument
structure: you can only fetch (or set) one thing at a time. That means
that a monitoring tool could be causing quite a lot of context-switching.
A better way would be (say) a sysctln() that would take a whole list of
items and return them all in a single pair of context switches.
(*Setting* N items in one call leads to difficulties with partial success,
so maybe it should be a read-only sysjustshowmen(). :-)

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
A Brazil-nut is neatly packaged and tightly integrated.  To turn it into
food, you must crack and remove the shell.  I find that I feel the same   
way about an increasing number of software products.  *sigh*

- 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/