RE: Suggested dual human/binary interface for proc/devfs

From: Mike Porter (mike@UDel.Edu)
Date: Tue Apr 11 2000 - 22:56:14 EST


> Continuing evaluation of these possibilities,
> the VFS method uses a file name as an attribute name,
> with only a single value in each file.
> The alternative of multiple values in /proc/net/devices/eth0,
> for example, would have lines of the format "name=value"
> (maybe).
>
> So a program (or script) can know the VFS directory structure
> and just open eth0/receive/packets, eth0/receive/bytes,
> eth0/receive/errors, etc., but it would be better (smarter)
> if this program (or script) read eth0/receive to see what
> files (attributes) are there and then tried to do something
> with them intelligently, so there is overhead not only of
> reading N files for N values, but also of reading the
> directory entries at each level.

I used to dislike this idea...catting all those files when you want
to see what info is available. But the most basic 'pd' (proc dump)
program could be:

#!/bin/sh
for i in `find -name "*" ! -type d ! -type l | sort`; do echo -n "$i: "; cat $i; done

It would only take a few minutes to write a little program that
does the same without the process creation overhead. Is there
really much overhead with opening files in /proc? And the patch
that was posted recently for creating whole hierarchies simply is a
pretty nice way to set it all up.

Mike

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



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:17 EST