All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Kegel <dank@kegel.com>
To: Jesse Pollard <pollard@tomcat.admin.navo.hpc.mil>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: /proc format (was Device Registry (DevReg) Patch 0.2.0)
Date: Wed, 25 Apr 2001 14:10:27 -0700	[thread overview]
Message-ID: <3AE73D43.9DEAE608@kegel.com> (raw)
In-Reply-To: <200104252056.PAA44995@tomcat.admin.navo.hpc.mil>

Jesse Pollard wrote:
> > But one thing XML provides (potentially) is a DTD that defines meanings and formats.
> > IMHO the kernel needs something like this for /proc (though not in DTD format!).
> >
> > Has anyone ever tried to write a formal syntax for all the entries
> > in /proc?   We have bits and pieces of /proc documentation in
> > /usr/src/linux/Documentation, but nothing you could feed directly
> > into a parser generator.  It'd be neat to have a good definition for /proc
> > in the LSB, and have an LSB conformance test that could look in
> > /proc and say "Yup, all the entries there conform to the spec and can
> > be parsed properly."...
> 
> From one point of view (that of the /proc entries...) each file
> is by definition in the proper format. That format is specified
> (in the /proc interface to the driver). Using "proc_printf" is a
> specification for the output.

When two different distributions ship different forks of
the kernel source, which differ in the arguments passed to proc_printf,
which one is right?  
There's no way to tell.  That's why saying "the source is the spec" doesn't cut it.

Also, the source is not a specification a parser generator can use.

A formal spec for /proc entries maintained by e.g. the LSB is needed;
it has to be separate from the source code (to avoid forking problems),
and it should be machine-readable (so we can build parsers from it).

> That DOES NOT mean that no improvements are possible. If the formats
> used by the various modules/drivers has some variation in format from
> access to acess, then the determination of that format must also be
> included. From what I've seen (via "cat /proc/....") the files all
> have a fixed format. Sometimes the number of entries varies, but then
> the count should ALSO be included in the file (in a known place of
> course). The multi-entry files I've looked at (/proc/net) reach the
> EOF to end the list. This is not unreasonable.

Yeah, there's a general style that seems to work; it just needs to be
formalized.
 
> I'm not sure of the usefullness of the title lines that are printed. If
> looked at in raw form, yes the titles are nice. But the utilities
> that are aimed at examining the values should not have to discard them, nor
> should the drivers have to generate them.

I think they're good; they're a little bit like the XML tags you're proposing.
 
> I can live with them anyway, since they are already there.....
> 
> The biggest problem I know of is being able to retrieve structure
> in an atomic manner. Not easy (in any system, not just Linux).

Something SNMP doesn't deal well with, either.  People seem to cope,
though.

- Dan

       reply	other threads:[~2001-04-25 21:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200104252056.PAA44995@tomcat.admin.navo.hpc.mil>
2001-04-25 21:10 ` Dan Kegel [this message]
2001-04-26  1:09 /proc format (was Device Registry (DevReg) Patch 0.2.0) Dan Kegel
  -- strict thread matches above, loose matches on Subject: below --
2001-04-25 17:10 Device Registry (DevReg) Patch 0.2.0 Dan Kegel
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AE73D43.9DEAE608@kegel.com \
    --to=dank@kegel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pollard@tomcat.admin.navo.hpc.mil \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.