lm sensors sysfs file structure

Greg KH greg at kroah.com
Tue Apr 1 08:44:39 CEST 2003


On Sun, Mar 30, 2003 at 09:23:12PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > >	       	Floating point values XXX.X or XXX.XX in degrees Celcius.
> > > 
> > > If we're restructuring it, I think we should also agree on _one_ common 
> > > denominator for all values ie. mVolt and milli-Degree Celsius, so that 
> > > no userspace program ever again has know how to convert them to 
> > > user-readable values and every user can just cat the values and doesn't 
> > > have to wonder if it's centi-Volt, milli-Volt, centi-Degree, dezi-Degree 
> > > or whatever.
> > 
> > Um, that's what my proposal stated.  Do you not agree with it?  (You're
> > quoting the existing document above, not my proposed changes.)
> 
> Well, you had cV for PSU voltages and
> mV for cpu core voltage. I guess mV
> and mili-deg-C everywhere would be
> nicer. 

I was trying to keep consistant with what the old /proc values were
reported as.  I'll go fix that up.

As for why no floating point, it's a pain in the but to both output a
fixed point number from the kernel into floating point, and to parse a
floating point number from userspace within the kernel, turning it into
a fixed point number.  With the proposal I wrote up, none of that is
needed, and all userspace has to do is divide by a factor of 10 to get
the proper value.

It's much simpler and easier to validate we got it right code.  If
you're still not convinced take a look at the code in
drivers/i2c/i2c-proc.c::i2c_parse_reals() for an example of some hairy
code...

thanks,

greg k-h



More information about the lm-sensors mailing list