Home | History | Annotate | Download | only in envstat
History log of /src/usr.sbin/envstat/envstat.c
RevisionDateAuthorComments
 1.105  01-Apr-2025  brad New features for envstat(8).

o The usual output of envstat(8) is meant for human consumption and it
is harder than it needs to be to extract the data and process it with
or for other systems or programs. There is a '-x' flag to output the
raw XML from the envsys(4) framework, but that doesn't run the data
though the conversions that envstat(8) does in the human output case.
So, provide a '-j' flag that outputs in JSON. Each execution of
envstat(8) will produce consistent JSON that can be piped directly
into the 'jq' command, for example. When used with the interval flag,
'-i', each interval will be consistent JSON with a separator string to
make it easier to split the input.

(as an aside, there is a '-n' option too, that just extracts the
current value from each sensor, but that is a little too terse for the
cases where a device provides multiple sensors or if you ask for
multiple devices, as you lose the ability to know what each value is
associated with)

o Provide a '-t' flag that will time stamp the output with the time
that the extraction was executed. This is only provided for the human
output, or JSON output. In the human output case, the first line is a
human readable date and time. In the JSON case, an object is included
in the output that contains the human readable date and time, and
another object that contains the Unix epoch version of the same. This
makes it possible to extract the data and have the data tell you when
it was executed.


I have been using this for a little while and it seems to work quite
well when one needs to pull a lot of sensors from the envsys(4)
framework at one time. It has ended up being much faster and less
error prone in a lot of cases then parsing the human output of
envstat(8) with regexs.
 1.104  19-Jun-2023  rin branches: 1.104.2;
Silence wrong maybe-uninitialized raised by GCC/x86_64 10.4.0 -Os.
 1.103  21-Nov-2022  brad branches: 1.103.2;


A driver for the Bosch BMP280 / BME280 temperature, humidity and
atmospheric pressure sensor. This is an inexpensive to moderately
expensive chip available from a large number of places. The driver
supports all aspects of the two chips, except for the repeating read
mode which would allow for sub-second queries, such as fall detection
or perhaps even as an altimeter. This driver also only supports the
I2C interface and not the SPI interface.

The BME280, the one with humidity, is not fully tested at this point,
awaiting upon a breakout board and may not show proper humidity.
 1.102  28-May-2022  andvar fix various typos, mainly in comments.
 1.101  27-Nov-2021  rillig usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it

Since 2021-01-31, lint no longer requires a CONSTCOND comment in a
do-while-0 statement since this is a common code pattern, especially in
statement-like macros.

sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch]
 1.100  14-Nov-2020  mlelstv Add option -n to print only the value of a sensor.
If statistics are selected with -T, then also display max, min and average.
The empty line between each display is skipped when one or more sensors are
selected with -s.
 1.99  14-Nov-2020  mlelstv Allow to select raw output for a single device or a list of sensors.
 1.98  14-Nov-2020  mlelstv For raw output (-x) allow to extract individual properties like drvctl -p.
E.g.

# envstat -x /vcmbox0/0/cur-value
328150000
 1.97  07-Jun-2020  thorpej Update for proplib(3) API changes.
 1.96  27-May-2018  thorpej Add support for light sensors that report Illuminance in lux.
 1.95  18-May-2014  kardel branches: 1.95.22;
add HYT-221/271/939 humidity/temperature I2C sensor
extend envsys(4) framework by %rH (relative humidity)
 1.94  14-Dec-2012  pgoyette branches: 1.94.6;
Since we're no longer making a copy of the option args, we shouldn't
attempt to free it.
 1.93  13-Dec-2012  christos - no point in allocating memory to hold command line arguments.
- allocate memory inside the function used.
 1.92  13-Dec-2012  christos PR/47316: Henning Petersen: Memory leak in envstat with config file.
 1.91  11-May-2012  njoly branches: 1.91.2;
Fix alignment display for temperature, fans and integer units.
 1.90  09-Feb-2012  riz Various English usage, spelling and markup fixes for envstat(4)-related
things, from Snader_LB.
 1.89  04-Dec-2011  jmcneill change printed indicator and battery charge strings from ON and OFF to TRUE
and FALSE, because messages like "battery present: ON" are difficult for my
brain to parse.
 1.88  07-Jun-2011  pgoyette branches: 1.88.2;
Zero is a valid value for some sensors so update statistics code to
handle that.
 1.87  06-Jun-2011  pgoyette 1. Don't print blank for Integer sensors with value of zero
2. Properly print percentages in -T statistics mode
3. Always set Sensor Type (units) to a non-NULL value
4. Enable printing of percentages for Integer sensors
 1.86  04-Jun-2011  pgoyette Since there is no longer a value-avg property, remove the code that
extracts it.
 1.85  16-Dec-2010  pgoyette branches: 1.85.4;
When skipping output for a temperature of absolute zero, don't forget to
skip past the display columns that the value would otherwise occupy.

Fixes display issue when swsensor(4) is used and it has a value of 0K,
as reported by njoly@
 1.84  14-Dec-2010  pooka Use a consistent approach for rump kernel calls made by libs.
Should investigate a dynamic approach in the future.
 1.83  13-Dec-2010  pooka RUMP_ACTION -> RUMPPRG
 1.82  05-Nov-2010  pooka adapt to new rumpclient_init() signature
 1.81  05-Nov-2010  pooka support rump client mode
 1.80  05-Oct-2010  pgoyette Some Integer-type sensors can have limits, so allow them to be displayed.
 1.79  26-Aug-2010  jruoho Use <paths.h>. Remove trailing white space.
 1.78  01-Aug-2010  mlelstv Print the correct value for critmin of a fan sensor.
 1.77  15-Feb-2010  pgoyette Update userland envstat(8) to handle new {high,maximum}-capacity limits.
 1.76  12-Feb-2010  njoly Fix double free, when requesting an invalid sensor.
 1.75  12-Feb-2010  cnst remove the fourth (empty) column from the -T printouts; ok pgoyette
 1.74  09-Feb-2010  cnst fix a typo resulting in warn-max being shown in two columns (one time instead of crit-min); ok pgoyette
 1.73  30-Jan-2010  pgoyette Since we never have both a limit value and a limit %capacity value,
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.
 1.72  04-Apr-2009  christos fix pasto: don't print the critcap when the warncap was asked. Also off by
one in length. From Anon-Ymous.
XXX: Should pull up to 5.0
 1.71  14-Feb-2009  ahoka Add support for showing temperatures in Kelvin.
 1.70  22-Aug-2008  pgoyette branches: 1.70.4; 1.70.6;
1. provide for warning-min and warning-max alarm levels in addition to
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@
 1.69  09-Aug-2008  christos simplify the code, from xtraeme.
 1.68  25-May-2008  christos remove printf when the sensor has no statistics; requested by xtraeme.
 1.67  24-May-2008  christos Don't code using side-effects (eliminate queue variable). Unconfuses Coverity
CID 5031.
 1.66  24-May-2008  christos Coverity CID 5034: Use after free. Restructure the code to simplify it and
print the error.
 1.65  29-Apr-2008  xtraeme branches: 1.65.2;
Don't show statistics in sensors that will provide a percentage.
 1.64  26-Apr-2008  xtraeme Add missing cast, noticed by Paul Goyette in current-users@.
 1.63  26-Apr-2008  xtraeme Cur -> Current for the header.
 1.62  26-Apr-2008  xtraeme In default display mode, fix up the indentation for the critical
limits so that they appear in the correct column.
 1.61  26-Apr-2008  xtraeme * Improve default display output by adding a header that will match
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.
 1.60  17-Apr-2008  xtraeme branches: 1.60.2;
Remove the 'dvnprinted' bool member of sensor_t, it's unused.
 1.59  17-Apr-2008  xtraeme * Add support to show output from specified sensors in multiple devices
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.
 1.58  16-Nov-2007  xtraeme Implement the 'refresh-timeout' property in device blocks for the
configuration files. This sets the timeout value that will be used
to check for critical limits.

The value can be viewed by the 'envstat -D' command.
 1.57  03-Nov-2007  xtraeme - Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
If the acadapter is not ready, trust the state returned by the battery
device.

Based on suggestion from joerg@.
 1.56  07-Oct-2007  xtraeme New configuration file format for the envsys framework:

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.
 1.55  25-Sep-2007  xtraeme - Simplify find_sensors().
- Remove a block that is not used anymore in check_sensors().
 1.54  25-Sep-2007  xtraeme Merge a patch from Iain Hibbert (plunky@):

- 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
$
 1.53  20-Sep-2007  plunky sort options
 1.52  10-Sep-2007  xtraeme Another typo in a comment.
 1.51  10-Sep-2007  xtraeme Fix a comment.
 1.50  10-Sep-2007  xtraeme Check argc before calling open(2), and use the out label in another
error case.
 1.49  10-Sep-2007  xtraeme Fix a lint(1) warning and remove oldsize in print_sensors(), it's
not used.
 1.48  10-Sep-2007  xtraeme Don't forget to check if -s was specified without -d, and add a macro
to check it in two places.
 1.47  10-Sep-2007  xtraeme Redo how the arguments are processed, so that arguments not allowed
will call usage(). Also remove an extra free().
 1.46  04-Sep-2007  xtraeme Update to match current kernel code.
 1.45  02-Sep-2007  xtraeme Add the -I flag that skips sensors with invalid state. They are shown
by default, but this is for users that don't want to print them.
 1.44  02-Sep-2007  xtraeme Add a new sensor type to sysmon_envsys(9): ENVSYS_GSTRING.

ENVSYS_GSTRING (aka Generic String) uses the genstr member in
the envsys_data_t struct to add a generic string that envstat(8)
will show as value or state.

It's like the ENVSYS_DRIVER, but doesn't use value_cur. Below
is the dictionary created on these sensors:

<dict>
<key>description</key>
<string>acpibat0 charge state</string>
<key>generic-state-string</key>
<string>NORMAL</string>
<key>monitoring-supported</key>
<false/>
<key>state</key>
<string>valid</string>
<key>type</key>
<string>Generic string</string>
</dict>

Note that it's limited to 32 chars, but we can grow it if needed.

envstat(8) will print ENVSYS_GSTRING sensors as:

$ envstat -dacpibat0 -s"acpibat0 charge state"
acpibat0 charge state: NORMAL
$
 1.43  29-Aug-2007  xtraeme In temperature sensors, do not convert to degC or degF if there's
no value returned.
 1.42  26-Aug-2007  xtraeme branches: 1.42.2;
Check if the dictionary is empty and print a message if it's true.
 1.41  05-Aug-2007  xtraeme branches: 1.41.2;
The caller of prop_dictionary_externalize is responsible to free the
returned buffer... make it so. Reminded by prop_dictionary(3).
 1.40  21-Jul-2007  xtraeme Erm... fix previous.
 1.39  21-Jul-2007  xtraeme Fix a logic bug: report a message and error if -s or -m is being used
without -d.
 1.38  17-Jul-2007  xtraeme Return the value returned by prop_dictionary_recv_ioctl() if the -x flag
is specified too.
 1.37  17-Jul-2007  xtraeme - Return the value returned by prop_dictionary_{recv,send}_ioctl
in all cases.
- Skip sensors that do not have a description object in its dictionary.
 1.36  17-Jul-2007  xtraeme Only allow to use ENVSYS_SETDICTIONARY if the user has write permission
in the /dev/sysmon device.

Use O_RDONLY for ENVSYS_GETDICTIONARY and O_RDWR for ENVSYS_SETDICTIONARY
in envstat(8).

Fixes PR kern/36661 by YAMAMOTO Takashi.
 1.35  17-Jul-2007  xtraeme Add the -r flag, which is a dummy flag... only added for compatibility
reasons.
 1.34  13-Jul-2007  xtraeme Define a set of macros to avoid writting same code many times.
 1.33  12-Jul-2007  xtraeme Add a missing printf in parse_dictionary() and simplify this part to
avoid code duplication in two places.
 1.32  12-Jul-2007  xtraeme Remove a comment that is not valid anymore.
 1.31  12-Jul-2007  xtraeme - Do not refrence memory already freed, thanks to Geoff C. Wing for
the analysis. Closes PR bin/36636.
- Also use the longest string for the column alignment counting all
sensors available from all devices, not per-device.

Thanks to rmind@ for help.
 1.30  05-Jul-2007  xtraeme Align drive state string like other sensor types.
 1.29  05-Jul-2007  xtraeme Before checking sensor type:

- check if if its state is invalid
- print the 'N/A' string and continue

This avoids code duplication.
 1.28  05-Jul-2007  xtraeme Print invalid state with 'N/A' for Indicators, like any other sensors.

We follow the following scheme now:

value_cur set => ON
value_cur not set => OFF
invalid state => N/A
 1.27  05-Jul-2007  xtraeme Print 'N/A' for invalid sensors rather than an asterisk, with the
exception of Indicator sensors.

Indicator sensors now will print "ON" if they are in valid state, or
"OFF" if they are in invalid state.
 1.26  04-Jul-2007  xtraeme By popular demand, do not skip sensors with invalid state. Print them
with an asterisk, as was suggested by Greg. A. Woods.

Example:

$ ./envstat -dlm0 -s "CPU Fan,System Fan,Aux Fan"
System Fan: *
CPU Fan: 1308 RPM
Aux Fan: *
$

Except Integer and Driver sensors, which shouldn't need that.
 1.25  01-Jul-2007  xtraeme Imported envsys 2, a brief description of the new features:
(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).
 1.24  01-May-2007  bouyer Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
 1.23  31-Aug-2006  gson branches: 1.23.2;
In -i mode, flush standard output after each line. This is needed to
make the output appear in a timely fashion when redirected to a file
or pipe.
 1.22  03-Jun-2004  wiz branches: 1.22.2;
One r in the option string is enough; from Jeff Ito.
 1.21  03-Jun-2004  wiz Remove unhandled option letter c from option string, noted by Jeff Ito.
 1.20  03-Jun-2004  wiz Sync usage with man page.
From Kouichirou Hiratsuka in PR 25798.
 1.19  25-Mar-2004  mrg - move the row printing code into it's own function.
- pay attention to interval processing with row printing (-r -iN).

the latter fixes PR#24522.
 1.18  21-Mar-2004  mrg in -r mode, if given "-s sensor_list", only list the given sensors instead
of always listing them all
 1.17  02-Feb-2004  soren As pointed out by Dave Huang, revert back to using 273.15 rather than 273.16
when converting between kelvin and celsius.
 1.16  02-Feb-2004  soren C = K + 273.16.
 1.15  05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.14  31-Oct-2003  mycroft Don't display data for sensors with ENVSYS_FCURVALID not set.
Clean up a little.
 1.13  21-Feb-2003  martin Not all size_t's are equal to int...
 1.12  20-Feb-2003  christos - pass lint
- use size_t where appropriate
- use err/warn instead of printf, and don't hide the error messages from ioctl.
- keep units in sync (someone added integer in the header file and forgot
to update envsys.c)
 1.11  11-Jan-2003  christos fix usage [add -r]
 1.10  05-Jan-2003  christos exit 0 when -r
 1.9  05-Jan-2003  chris Update -r option to display data in correct units, IE temperature in degC or
degF, fan speed is now correct, and indicators will now show ON/OFF.
 1.8  01-Jan-2003  augustss Include <paths.h>
 1.7  01-Jan-2003  augustss ANSIfy.
 1.6  31-Dec-2002  explorer add ENVSYS_INDICATOR and ENVSYS_INTEGER types
 1.5  19-Feb-2001  cgd convert to use getprogname()
 1.4  02-Jul-2000  augustss Indicate that the device argument is not mandatory.
 1.3  24-Jun-2000  thorpej If the `device' argument is not specified, attempt to open /dev/sysmon.
 1.2  14-Apr-2000  simonb branches: 1.2.4;
Don't declare 'extern opt*' getopt variables.
 1.1  10-Mar-2000  groo Add envstat(8) for displaying sensor readings from any envsys(4)
compatible device.
 1.2.4.1  30-Jul-2000  bouyer Pull up (requested by thorpej):
envstat.8 1.1->1.2
envstat.c 1.2->1.3

If the `device' argument is not specified, attempt to open /dev/sysmon.
 1.22.2.1  15-Oct-2007  riz Pull up following revisions via patch (requested by bouyer in ticket #1838):
distrib/sets/lists/man/mi: revision 1.997
sbin/bioctl/strtonum.c: revision 1.1
sys/dev/Makefile: revision 1.25
sys/arch/amd64/conf/GENERIC: revision 1.139
sbin/bioctl/strtonum.h: revision 1.1
sys/dev/bio.c: revision 1.1
sbin/bioctl/bioctl.c: revision 1.1
share/man/man4/bio.4: revision 1.1
sbin/bioctl/bioctl.8: revision 1.1
sys/sys/envsys.h: revision 1.11
sbin/bioctl/bioctl.8: revision 1.3
sbin/bioctl/bioctl.8: revision 1.4
sys/arch/i386/conf/XEN2_DOM0: revision 1.25
distrib/sets/lists/base/mi: revision 1.704
sys/conf/majors: revision 1.34
share/man/man4/Makefile: revision 1.426
etc/MAKEDEV.tmpl: revision 1.86
sys/arch/i386/conf/GENERIC: revision 1.825
distrib/sets/lists/comp/mi: revision 1.1022
sys/conf/files: revision 1.839
usr.sbin/envstat/envstat.c: revision 1.24
sbin/Makefile: revision 1.105
sys/dev/ic/mfi.c: revision 1.4
sys/dev/biovar.h: revision 1.1
sys/dev/ic/mfivar.h: revision 1.4
sbin/bioctl/Makefile: revision 1.1
Fix typo.
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
Fix Dd argument (use full month names).
Use more markup.
Comment out references to safte(4) and softraid(4), which don't exist in
NetBSD.
Remove trailing whitespace.
Use macros instead of characters for HTML output (replace ">", "<"
with \*[Gt], \*[Lt]).
Sort sections.
Create /dev/bio
 1.23.2.1  08-May-2007  pavel Pull up following revision(s) (requested by bouyer in ticket #603):
distrib/sets/lists/base/mi: revision 1.704
distrib/sets/lists/comp/mi: revision 1.1022
distrib/sets/lists/man/mi: revision 1.997
doc/CHANGES: revision 1.839
sbin/Makefile: patch
sbin/bioctl/Makefile: revision 1.1
sbin/bioctl/bioctl.8: revision 1.1
sbin/bioctl/bioctl.c: revision 1.1
sbin/bioctl/strtonum.c: revision 1.1
sbin/bioctl/strtonum.h: revision 1.1
share/man/man4/Makefile: revision 1.426
share/man/man4/bio.4: revision 1.1
sys/arch/amd64/conf/GENERIC: revision 1.139
sys/arch/i386/conf/GENERIC: revision 1.825
sys/arch/i386/conf/XEN2_DOM0: revision 1.25
sys/conf/files: revision 1.839
sys/conf/majors: patch
sys/dev/Makefile: revision 1.25
sys/dev/bio.c: patch
sys/dev/biovar.h: patch
sys/dev/ic/mfi.c: revision 1.4-1.5
sys/dev/ic/mfivar.h: revision 1.4
sys/sys/envsys.h: revision 1.11
usr.sbin/envstat/envstat.c: revision 1.24
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.

note bio(4), envsys(4) DRIVE, and mfi(4) support for both.

tred->sensor is a u_int.
 1.41.2.2  05-Aug-2007  xtraeme The caller of prop_dictionary_externalize is responsible to free the
returned buffer... make it so. Reminded by prop_dictionary(3).
 1.41.2.1  05-Aug-2007  xtraeme file envstat.c was added on branch matt-mips64 on 2007-08-05 23:20:45 +0000
 1.42.2.2  09-Jan-2008  matt sync with HEAD
 1.42.2.1  06-Nov-2007  matt sync with HEAD
 1.60.2.2  04-Jun-2008  yamt sync with head
 1.60.2.1  18-May-2008  yamt sync with head.
 1.65.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.65.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.70.6.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.70.4.1  04-Apr-2009  snj Pull up following revision(s) (requested by christos in ticket #666):
usr.sbin/envstat/envstat.c: revision 1.72
fix pasto: don't print the critcap when the warncap was asked. Also off by
one in length. From Anon-Ymous.
XXX: Should pull up to 5.0
 1.85.4.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.88.2.3  23-Jan-2013  yamt sync with head
 1.88.2.2  23-May-2012  yamt sync with head.
 1.88.2.1  17-Apr-2012  yamt sync with head
 1.91.2.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.91.2.1  25-Feb-2013  tls resync with head
 1.94.6.1  10-Aug-2014  tls Rebase.
 1.95.22.1  25-Jun-2018  pgoyette Sync with HEAD
 1.103.2.1  03-Nov-2023  martin Pull up following revision(s) (requested by rin in ticket #450):

usr.sbin/envstat/envstat.c: revision 1.104

Silence wrong maybe-uninitialized raised by GCC/x86_64 10.4.0 -Os.
 1.104.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed