]> git.proxmox.com Git - mirror_zfs.git/commit
Add callbacks for displaying KSTAT_TYPE_RAW kstats
authorPrakash Surya <surya1@llnl.gov>
Thu, 12 Sep 2013 23:14:51 +0000 (16:14 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 16 Oct 2013 21:48:35 +0000 (14:48 -0700)
commit56d40a686b0504042a088943154ba7b0dde36d51
tree5d6d397d8e310874592909a7c17b453bb375b52c
parent4768c0d0a61497f2f3a52678154f2742a355618f
Add callbacks for displaying KSTAT_TYPE_RAW kstats

The current implementation for displaying kstats of type KSTAT_TYPE_RAW
is rather crude. This patch attempts to enhance this handling by
allowing a kstat user to register formatting callbacks which can
optionally be used.

The callbacks allow the user to implement functions for interpreting
their data and transposing it into a character buffer. This buffer,
containing a string representation of the raw data, is then be displayed
through the current /proc textual interface.

Additionally the kstats are made writable because it's now possible
to provide a useful handler via the existing ks_update() interface.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #296
include/sys/kstat.h
module/spl/spl-kstat.c