Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: loading new envstat properties reboots system



On Thu, 16 Dec 2010, Nicolas Joly wrote:

On Wed, Dec 15, 2010 at 05:14:31PM -0800, Paul Goyette wrote:
On Thu, 16 Dec 2010, Nicolas Joly wrote:

root@petaure [~]# envstat -S
root@petaure [~]# envstat
                Current  CritMax  WarnMax  WarnMin  CritMin Unit
[amdtemp0]
CPU0 Sensor0:    51.250          -273.117                   degC
CPU0 Sensor1:    41.000          -273.117                   degC
CPU1 Sensor0:    51.500          -273.117                   degC
CPU1 Sensor1:    49.250          -273.117                   degC

The -273.117 values looks ... wrong.

Definitely wrong.  :)  But most likely an error in amdtemp(4) driver.

Does not seems amdtemp related. I can reproduce it using swsensor.

njoly@lanfeust [~]# modstat -n swsensor
NAME             CLASS      SOURCE     REFS  SIZE     REQUIRES
root@lanfeust [~]# modload -i type=0 swsensor
root@lanfeust [~]# modstat -n swsensor
NAME             CLASS      SOURCE     REFS  SIZE     REQUIRES
swsensor         driver     filesys    0     1805     -

root@lanfeust [~]# envstat -d swsensor
         Current  CritMax  WarnMax  WarnMin  CritMin Unit
sensor:
root@lanfeust [~]# cat swsensor.conf
swsensor {
 sensor0 { critical-min = 85C; critical-max = 92C; }
}
root@lanfeust [~]# envstat -c swsensor.conf
root@lanfeust [~]# envstat -d swsensor
         Current  CritMax  WarnMax  WarnMin  CritMin Unit
sensor:  92.000                     85.000
root@lanfeust [~]# envstat -d swsensor
         Current  CritMax  WarnMax  WarnMin  CritMin Unit
sensor:         -273.117

Comparing `envstat -x' output from a freshly loaded sensor, and after
cleanup show that some limits remains :

root@lanfeust [NetBSD/envstat]# diff init.xml clean.xml
3a4,5
                        <key>critical-min</key>
                        <integer>0</integer>
15a18,19
                        <key>warning-max</key>
                        <integer>32640</integer>

Hmm ... Where does the WarnMax limit comes from ? It should not
exists.

Looking at it now...


NB: envstat output looks bad when Temp value is 0uK, correct
otherwise.

I just never expected the current value to be zero. Zero's are deliberately printed as a blank field. Following patch fixes.

Index: envstat.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/envstat/envstat.c,v
retrieving revision 1.84
diff -u -p -r1.84 envstat.c
--- envstat.c   14 Dec 2010 08:04:14 -0000      1.84
+++ envstat.c   16 Dec 2010 12:38:34 -0000
@@ -852,7 +852,6 @@ do {                                                       \
                        PRINTTEMP(sensor->cur_value);
                        stype = degrees;

-                       ilen = 8;
                        if (statistics) {
                                /* show statistics if flag set */
                                PRINTTEMP(stats->max);


NB2: What about adding ability to set an inital value when loading the
module; something like `modload -i type=0 -i value=273150000 swsensor' ?

I was lazy.  :)

And besides, there's already a perfectly good way to set the value, with sysctl(8).

Seriously, it would be trivial, and I think I will do this today.


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index