Gathering kernel counters and statistics with kstat(1m)


The Solaris kstat(1m) utility can be used to display a variety of counters and statistics that are maintained by the kernel. These values range from IP datagrams received to the number of interrupts handled to values related to random number generation. To display all statistics maintained by the kernel, the kstat(1m) utility can be executed with no option:

$ kstat |more

module: audiots instance: 0
name: audiots class: controller
crtime 67.00041102
hard 0
multiple_service 0
snaptime 7152574.24162951
soft 0
spurious 0
watchdog 0

module: chip instance: 0
name: chip0 class: misc
chip_id 0
chip_idleness 0
chip_rechoose_interval 3
crtime 49.090863407
logical_cpus 1
snaptime 7152574.2441863

[ ..... ]

To get kstat statistics for a specific kernel module and an instance of that module, kstat(1m) can be executed with the “-m” (module name) and “-i” (instance name) options:

$ kstat -m qfe -i 1

I constantly find myself using kstat(1m) to analyze and debug the Solaris systems I support.

This article was posted by Matty on 2005-10-12 19:26:00 -0400 -0400