Re: PROPOSAL: dot-proc interface [was: /proc stuff]

Daniel Phillips (phillips@bonn-fries.net)
Mon, 5 Nov 2001 11:28:27 +0100


On November 5, 2001 12:06 pm, Martin Dalecki wrote:
> Alexander Viro wrote:
> > At the very least, use canonical bytesex and field sizes. Anything less
> > is just begging for trouble. And in case of procfs or its equivalents,
> > _use_ the_ _damn_ _ASCII_ _representations_. scanf(3) is there for
> > purpose.
>
> And the purpose of scanf in system level applications is to introduce
> nice opportunities for buffer overruns and string formatting bugs.

I've done quite a bit more kernel profiling and I've found that overhead for
converting numbers to ascii for transport to proc is significant, and there
are other overheads as well, such as the sprintf and proc file open. These
must be matched by corresponding overhead on the user space side, which I
have not profiled. I'll take some time and present these numbers properly at
some point.

Not that I think we are going to change this way of doing things any time
soon - Linus has spoken - but at least we should know what the overheads are.
Programmers should not labor under the misaprehension that this is an
efficient interface.

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/