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

From: Dunlap, Randy (randy.dunlap@intel.com)
Date: Sun Apr 09 2000 - 15:06:18 EST


So with one value per "file," how do you handle the
well-known problem of inconsistent data, i.e.,
one or more values being updated, program reads
file value(s), some more value(s) updated, program
reams some more value(s)?

Is there also a well-known solution to this?

Example: eth0.receive.packets is updated on a new packet,
but eth0.receive.bytes is not yet updated. A program
reads eth0.receive.packets and eth0.receive.bytes.
These values are inconsistent, they do not represent
a snapshot of the statistics (or whatever data is
interesting).

In this example, it's not so critical, but it could
be in some cases. Or are there no cases where /proc
data is critical?

~Randy
___________________________________________________
|Randy Dunlap Intel Corp., DAL Sr. SW Engr.|
|randy.dunlap.at.intel.com 503-696-2055|
|NOTE: Any views presented here are mine alone |
|and may not represent the views of my employer. |
|_________________________________________________|

> -----Original Message-----
> From: George Bonser [mailto:grep@shorelink.com]
> Sent: Sunday, April 09, 2000 12:37 PM
> To: Bill Wendling
> Cc: Ed Carp; linux-kernel@vger.rutgers.edu
> Subject: Re: Suggested dual human/binary interface for proc/devfs
>
>
> On Sun, 9 Apr 2000, Bill Wendling wrote:
>
> > It may be wordy, but it is standard, parsers do exist for
> it, and you
> > don't have the fun of having 10 kagillion different file formats to
> > parse.
> >
> > Sometimes the bleeding edge is a good thing.
>
> There is no need to store it in XML, really, if data in /proc is
> presented in a standard way. It would be easy enough to convert that
> standard format to XML with a utility. Imagine:
>
> procdump --xml /proc/net/*
> procdump --text /proc/net/*
> procdump --html /proc/net/*
>
> My mythical procdump util here would be able to convert it
> very easily.
>
> I am actualy growing fonder of the method of using the filesystem
> completely and having no more than one value per file where
> the filename
> is the attribute and the data is the value.
>
> /proc/net/dev/interface
> |
> |--eth0
> | |
> | |--receive
> | | |
> | | |--bytes
> | | |--packets
> | | |--errors
> | | |--drop
> | | |-- ...
> | | `--multicast
> | `--transmit
> | |
> | |--bytes
> | |--packets
> | |--errors
> | |--drop
> | `--...
> `--eth1
> |
> and so on.

-
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:12 EST