KSTAT(1) - General Commands Manual # KSTAT(1) - General Commands Manual
NAME # kstat - display kernel statistics
SYNOPSIS # kstat [-w wait] [name | provider:instance:name:unit] …
DESCRIPTION # The kstat utility displays statistics collected by the kernel. By default, all available data is displayed. If at least one argument is given, the display is restricted to data that matches at least one of the arguments.
The options are as follows:
...
KSTAT(4) - Device Drivers Manual # KSTAT(4) - Device Drivers Manual
NAME # kstat - kernel statistics
SYNOPSIS # pseudo-device kstat
DESCRIPTION # The /dev/kstat device exposes kernel statistics (kstats) to userland.
IOCTLS # The kstat ioctl(2) calls are provided in <sys/kstat.h>.
With the exception of KSTATIOC_VERSION, the kstat ioctl(2) calls use the kstat_req structure to request or enumerate kernel statistic data from the kernel:
struct kstat_req { unsigned int ks_rflags; #define KSTATIOC_F_IGNVER (1 << 0) /* the current version of the kstat subsystem */ unsigned int ks_version; uint64_t ks_id; char ks_provider[KSTAT_STRLEN]; unsigned int ks_instance; char ks_name[KSTAT_STRLEN]; unsigned int ks_unit; struct timespec ks_created; struct timespec ks_updated; struct timespec ks_interval; unsigned int ks_type; unsigned int ks_state; void *ks_data; size_t ks_datalen; unsigned int ks_dataver; }; The kstat subsystem increments a version number when a kstat is added to or removed from the subsystem so changes to the set of kstats can be detected.
...