remove the Capacity column.
Reduce inter-column spacing, and display all four limits on one page,
rather than using the -W command line option to switch between critical
and warning limits. (The -W option is still permitted, but has no
effect.)
%capacity limits are displayed in the WarnMin and CritMin columns, but
have a trailing % sign.
critical-min and critical-max; also, a battery warning-capacity is
added in addition to a critical-capacity.
2. usr.sbin/envstat is modified to introduce a -W command line switch to
display the warning-* values instead of the critical-* values, and
envstat(8) and envsys.conf(5) man pages are updated appropriately.
3. Treat user-defined limits as a single continuum and generate a single
event regardless of how many boundaries a change in sensor value
crosses; ditto for driver-defined limits.
Fixes my PR/39021
Fixes my PR/39022
OK'd by christos@ bouyer@ cube@
current value as well as critical limits set and sensor unit.
* Add a new flag: -T. When it's enabled statistics will be created for
the sensors. Max, min and average statistics as well as sensor unit
will be displayed. Must be used with an interval.
You can see the new code in action here:
http://www.netbsd.org/~xtraeme/envstat_stats.txt
Thanks to jmcneill@ for comments and ideas.
Changes beyond OpenBSD's driver:
- Improved support for AMD K8
- Added support for AMD Barcelona, AMD Phenom and AMD Griffin
Tested on various single and multi-socket machines.
Review and OK xtreame
via the -s flag (the requirement for -d is not there anymore). [1]
You can do something like the following now:
$ envstat -s "acpibat0:charge,acpibat0:charge state,acpitz0:temperature"
[acpibat0]
charge: 3.015 Ah (79.70%)
charge state: NORMAL
[acpitz0]
temperature: 54.000 degC
$
* As bonus, the code has been modified to use a simple queue for
the sensors, and this has simplified and improved some parts of the
code as well.
[1] Item requested by joerg@ yesterday.
foo0 {
#
# CPU Temperature
#
sensor0 {
critical-max = 70C;
critical-min = 20C;
}
...
}
...
Removed the -m flag that was previously used to set properties for
sensors. Now the -c flag will process all properties specified in
the file (accepted as argument).
To remove all properties that were set, the new -S flag can be used.
This will restore default values for all devices.
- some unclear language cleaned up
- inconsistent usage of 'device' and 'driver' to refer to the same thing
- difficult error handling
And print the device name if -d flag is not specified for any driver
registered, e.g:
$ envstat
[aiboost0]
CPU Temperature: 36.000 degC max: 70.000 degC min: 15.000 degC
MB Temperature: 38.000 degC max: 50.000 degC min: 15.000 degC
Vcore Voltage: 1.232 V max: 1.350 V min: 1.150 V
+3.3 Voltage: 3.264 V max: 3.500 V min: 3.000 V
+5 Voltage: 5.017 V max: 5.600 V min: 4.500 V
+12 Voltage: 11.932 V max: 13.500 V min: 11.200 V
CPU FAN Speed: 1268 RPM
$
(Part 3: userland)
* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.
Tested by:
blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).