aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/kstat.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-01-30 12:15:31 -0800
committerBrian Behlendorf <[email protected]>2012-02-02 11:28:00 -0800
commit9a8b7a7458a3d76d35b26e7f2b737abd9ab4c6ef (patch)
treed18ccbb60e2a38087166dcfb92e6d843841808f4 /include/sys/kstat.h
parent4b2220f0b937018b79154ac368c845e6176a8a66 (diff)
Add basic dynamic kstat support
Add the bare minimum functionality to support dynamic kstats. A complete kstat implementation should be done as part of issue #84. Signed-off-by: Brian Behlendorf <[email protected]> Issue #84
Diffstat (limited to 'include/sys/kstat.h')
-rw-r--r--include/sys/kstat.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sys/kstat.h b/include/sys/kstat.h
index 3c2ad4c5b..e4c88c82b 100644
--- a/include/sys/kstat.h
+++ b/include/sys/kstat.h
@@ -72,7 +72,14 @@
#define KS_MAGIC 0x9d9d9d9d
-typedef int kid_t; /* unique kstat id */
+/* Dynamic updates */
+#define KSTAT_READ 0
+#define KSTAT_WRITE 1
+
+struct kstat_s;
+
+typedef int kid_t; /* unique kstat id */
+typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
typedef struct kstat_s {
int ks_magic; /* magic value */
@@ -89,6 +96,8 @@ typedef struct kstat_s {
uint_t ks_ndata; /* # of type-specific data records */
size_t ks_data_size; /* size of kstat data section */
struct proc_dir_entry *ks_proc; /* proc linkage */
+ kstat_update_t *ks_update; /* dynamic updates */
+ void *ks_private; /* private data */
spinlock_t ks_lock; /* kstat data lock */
struct list_head ks_list; /* kstat linkage */
} kstat_t;