Re: What /proc should contain [was: /proc/driver/microcode]

From: Helge Hafting (helgehaf@idb.hist.no)
Date: Tue Feb 29 2000 - 02:59:41 EST


> Regarding parsing /proc files, has anyone thought of a file format which
> contains a parsing specification ? For example a scanf format string.
>
> Eg:
>
> $ cat /proc/somefile
> %d %d %f %s
> 12 45 8.4 Some String

That solves part of the problem of changing formats, but not all.
You can now catch the case of parameters moving a bit back and forth.

It don't really help for anything else. What if two columns are
swapped?
No change if they are the same datatype, and programs get confused.
Swapping
different types will show up, but the program don't have enough info to
know
what really happened. How about a new field? The parse spec says how
to read the info, but nothing about how to *interpret* it. Or an
obsolete
field disappearing: Which of the two ints went if I change your spec
to %d %f %s and remove one number? What should a program do that
usually
did computations with both values?

You might as well include a version number - programs may then
quit cleanly if the /proc file they use have a too high version. Maybe
the file
date could be used for that, unless it is used already?

Helge Hafting

-
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 : Tue Feb 29 2000 - 21:00:22 EST