public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Device Registry (DevReg) Patch 0.2.0
@ 2001-04-25 17:10 Dan Kegel
  2001-04-25 18:09 ` H. Peter Anvin
  2001-04-25 18:55 ` /proc format (was Device Registry (DevReg) Patch 0.2.0) Tim Jansen
  0 siblings, 2 replies; 19+ messages in thread
From: Dan Kegel @ 2001-04-25 17:10 UTC (permalink / raw)
  To: tim, linux-kernel@vger.kernel.org

Tim Jansen wrote:
> On Tuesday 24 April 2001 18:39, Martin Dalecki wrote: 
> >> Are there alternatives to get complex and extendable information out to 
> >> user space? 
> > Yes filesystem structures. 
> 
> How exactly can this work? A single value per file is not very helpful if you 
> have a thousand values. You could cluster them (for example one level in the 
> XML hierarchy == one file), but this will soon get very complicated. Its much 
> more work to implement in the kernel, its painful in user-space and you cant 
> just use a text editor to look at it (because you always have to look at 10 
> files per device). 

The command
  more foo/* foo/*/* 
will display the values in the foo subtree nicely, I think.

Think of the /proc tree as the XML parse tree already exploded for you.

The only problem with /proc as it stands is that there is no formal
syntax for its entries.  Some of them are hard to parse.

Before we add a new /proc entry that generates XML which summarizes
the rest of /proc, it might make sense to standardize /proc entries
and write a regression test to verify they are formatted correctly.
It would then be trivial to write a /proc to XML converter which
ran solely in userspace.

See 
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0101.0/0506.html
and
http://marc.theaimsgroup.com/?l=linux-kernel&s=%2Fproc+xml

for prior discussion on the matter.

I don't want to dismiss the reasons you want to use XML for this,
but tread carefully, lest you duplicate lots of code and introduce
cruft.  Better to factor the XML part out to a userspace library...

- Dan

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <200104252056.PAA44995@tomcat.admin.navo.hpc.mil>]
* Re: /proc format (was Device Registry (DevReg) Patch 0.2.0)
@ 2001-04-26  1:09 Dan Kegel
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Kegel @ 2001-04-26  1:09 UTC (permalink / raw)
  To: hahn, linux-kernel@vger.kernel.org

Mark Hahn wrote:
> the main goal at this point is to make kernel proc-related 
> code more efficient, easy-to-use, etc. a purely secondary goal 
> is to make user-space tools more robust, efficient, and simpler. 
> 
> there are three things that need to be communicated through the proc 
> interface, for each chunk of data: its type, it's name and its value. 
> it's critical that data be tagged in some way, since that's the only 
> way to permit back-compatibility. that is, a tool looking for a particular 
> tag will naturally ignore new data with other tags. 

Agreed.

> [three example schemes in use in /proc today]
> I have a sense that all of these could be collapsed into a single 
> api where kernel systems would register hierarchies of tuples of 
> <type,tag,callback>, where callback would be passed the tag, 
> and proc code would take care of "rendering" the data into 
> human readable text (default), binary, or even xml. 

Sounds reasonable to me.  Relieve the modules of having to
format their /proc entries by defining standard code that does
it.   And as an extra bonus, if tuples registration was table-driven,
the tables would define a grammar that could be fed to a parser
generator.

(It sounds a little bit like the snmpd code I'm working on,
actually.  How eerie.)

(It also sounds a little like (gasp) the windows registry,
but hey, that's ok.)

- Dan

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2001-04-26 14:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-25 17:10 Device Registry (DevReg) Patch 0.2.0 Dan Kegel
2001-04-25 18:09 ` H. Peter Anvin
2001-04-25 18:55 ` /proc format (was Device Registry (DevReg) Patch 0.2.0) Tim Jansen
2001-04-25 19:19   ` Dan Kegel
2001-04-25 23:09     ` Tim Jansen
2001-04-25 19:37   ` Jesse Pollard
2001-04-25 20:08     ` Dan Kegel
2001-04-25 20:40     ` Tim Jansen
2001-04-25 21:16       ` Jesse Pollard
2001-04-25 21:50         ` J . A . Magallon
2001-04-25 21:58           ` Doug McNaught
2001-04-25 22:03             ` J . A . Magallon
2001-04-25 22:24               ` Marko Kreen
2001-04-25 22:42               ` Alexander Viro
2001-04-25 22:24             ` Mark Hahn
2001-04-26 14:06               ` Tim Jansen
2001-04-25 22:46         ` Tim Jansen
     [not found] <200104252056.PAA44995@tomcat.admin.navo.hpc.mil>
2001-04-25 21:10 ` Dan Kegel
  -- strict thread matches above, loose matches on Subject: below --
2001-04-26  1:09 Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox