From: "Eric S. Raymond" <esr@thyrsus.com>
To: Erik Andersen <andersen@codepoet.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: LSB1.1: /proc/cpuinfo
Date: Fri, 4 Jan 2002 07:19:40 -0500 [thread overview]
Message-ID: <20020104071940.A10172@thyrsus.com> (raw)
In-Reply-To: <20020103190219.B27938@thyrsus.com> <Pine.GSO.4.21.0201031944320.23693-100000@weyl.math.psu.edu> <20020103195207.A31252@thyrsus.com> <20020104081802.GC5587@codepoet.org>
In-Reply-To: <20020104081802.GC5587@codepoet.org>; from andersen@codepoet.org on Fri, Jan 04, 2002 at 01:18:02AM -0700
Erik Andersen <andersen@codepoet.org>:
> I once wrote up /dev/ps and /dev/mounts drivers to eliminate proc
> for embedded systems (pointer available if you care). It was not
> warmly received, but I did form some opinions in the process.
Sure, I'd like to see this work.
> The main things to think about are
> 1) machine readability
> Generally speaking the kernel gods have decided that
> ASCII is good, binary structures and such are bad (think
> endiannes, nfs exports, and similar oddness).
I agree with this decision. Binary structures would be false economy,
trading away readability and flexibility for a marginal speed gain.
> 2) typing
> Right now, if some /proc file prints a number, user space
> has to go digging about in the kernel sources to find
> what type that thing is -- int, uint, long, long long, etc.
> Cant tell without digging in the source. And what if
> someone then changes the type next week -- userspace
> then overflows.
I'm not very worried about this. On modern machines int == long
and the only case that's a potential headache is long long. If
longer than int-size data is labeled, we'll be OK.
> 3) field length
> When coping a string from /proc (say /proc/mounts),
> userspace has to go digging in the kernel source to
> find the field length. So if I copy things into a
> static buffer, I may be fine.
I think the right answer to this is usually "don't use a language that
has static buffers". :-)
> So what is needed is a kernelfs virtual filesystem that provides
> kernel info to user space.
I don't care what it's called. I've seen `sys', 'system', and 'archfs'
thrown around.
> It needs a format that provides information as an organized
> directory hierarchy, which each directory and filename
> identifying the nature of the provided information. Files should
> provide information in ASCII with one value per file (to avoid
> all the tedious parsing), but also provides along with that bit
> of information type and or/length information.
>
> In some cases I guess we may also need more complex classes on
> information. (lists of key-value stuff for example).
One value per *file*? That seems excessively fine-grained. Sometimes
you want multiple values per file because the information is a functional
unit for reporting to humans.
--
<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>
Americans have the will to resist because you have weapons.
If you don't have a gun, freedom of speech has no power.
-- Yoshimi Ishikawa, Japanese author, in the LA Times 15 Oct 1992
next prev parent reply other threads:[~2002-01-04 12:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200201032355.g03Ntx911860@burner.fokus.gmd.de>
2002-01-04 0:02 ` LSB1.1: /proc/cpuinfo Eric S. Raymond
2002-01-04 0:56 ` Alexander Viro
2002-01-04 0:52 ` Eric S. Raymond
2002-01-04 8:18 ` Erik Andersen
2002-01-04 12:19 ` Eric S. Raymond [this message]
2002-01-04 13:11 ` Andreas Schwab
2002-01-04 13:03 ` Eric S. Raymond
2002-01-04 13:25 ` Andreas Schwab
2002-01-04 13:27 ` Andreas Jaeger
2002-01-04 13:36 ` Christoph Hellwig
2002-01-04 15:34 ` Luigi Genoni
2002-01-04 17:02 ` Alan Cox
2002-01-04 18:30 ` Eric S. Raymond
2002-01-04 21:44 ` Ville Herva
2002-01-04 22:19 ` H. Peter Anvin
2002-01-04 15:46 ` Jeff Garzik
2002-01-04 19:35 ` Erik Andersen
2002-01-04 1:56 ` Timothy Covell
2002-01-07 1:05 ` Rusty Russell
2002-01-04 0:35 ` Dan Kegel
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=20020104071940.A10172@thyrsus.com \
--to=esr@thyrsus.com \
--cc=andersen@codepoet.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox