summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sys/spa.h21
-rw-r--r--include/sys/spa_impl.h2
-rw-r--r--include/sys/zfs_context.h5
-rw-r--r--include/sys/zio.h6
4 files changed, 32 insertions, 2 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index 401ae8343..a4a717ac0 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -51,6 +51,8 @@ typedef struct zilog zilog_t;
typedef struct spa_aux_vdev spa_aux_vdev_t;
typedef struct ddt ddt_t;
typedef struct ddt_entry ddt_entry_t;
+typedef struct zbookmark zbookmark_t;
+
struct dsl_pool;
struct dsl_dataset;
@@ -534,6 +536,25 @@ extern boolean_t spa_refcount_zero(spa_t *spa);
#define SCL_ALL ((1 << SCL_LOCKS) - 1)
#define SCL_STATE_ALL (SCL_STATE | SCL_L2ARC | SCL_ZIO)
+/* Historical pool statistics */
+typedef struct spa_stats_history {
+ kmutex_t lock;
+ uint64_t count;
+ uint64_t size;
+ kstat_t *kstat;
+ void *private;
+ list_t list;
+} spa_stats_history_t;
+
+typedef struct spa_stats {
+ spa_stats_history_t read_history;
+} spa_stats_t;
+
+extern void spa_stats_init(spa_t *spa);
+extern void spa_stats_destroy(spa_t *spa);
+extern void spa_read_history_add(spa_t *spa, const zbookmark_t *zb,
+ uint32_t aflags);
+
/* Pool configuration locks */
extern int spa_config_tryenter(spa_t *spa, int locks, void *tag, krw_t rw);
extern void spa_config_enter(spa_t *spa, int locks, void *tag, krw_t rw);
diff --git a/include/sys/spa_impl.h b/include/sys/spa_impl.h
index 47dfe432e..107d14a76 100644
--- a/include/sys/spa_impl.h
+++ b/include/sys/spa_impl.h
@@ -236,6 +236,8 @@ struct spa {
uint64_t spa_deadman_calls; /* number of deadman calls */
uint64_t spa_sync_starttime; /* starting time fo spa_sync */
uint64_t spa_deadman_synctime; /* deadman expiration timer */
+ spa_stats_t spa_stats; /* assorted spa statistics */
+
/*
* spa_refcnt & spa_config_lock must be the last elements
* because refcount_t changes size based on compilation options.
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index a126c058e..dfd11d9f1 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -210,6 +210,7 @@ typedef struct kthread {
} kthread_t;
#define curthread zk_thread_current()
+#define getcomm() "unknown"
#define thread_exit zk_thread_exit
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
zk_thread_create(stk, stksize, (thread_func_t)func, arg, \
@@ -347,6 +348,10 @@ extern kstat_t *kstat_create(char *, int,
char *, char *, uchar_t, ulong_t, uchar_t);
extern void kstat_install(kstat_t *);
extern void kstat_delete(kstat_t *);
+extern void kstat_set_raw_ops(kstat_t *ksp,
+ int (*headers)(char *buf, size_t size),
+ int (*data)(char *buf, size_t size, void *data),
+ void *(*addr)(kstat_t *ksp, loff_t index));
/*
* Kernel memory
diff --git a/include/sys/zio.h b/include/sys/zio.h
index 189966bef..f5a128e0b 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -256,12 +256,13 @@ extern char *zio_type_name[ZIO_TYPES];
* Therefore it must not change size or alignment between 32/64 bit
* compilation options.
*/
-typedef struct zbookmark {
+struct zbookmark {
uint64_t zb_objset;
uint64_t zb_object;
int64_t zb_level;
uint64_t zb_blkid;
-} zbookmark_t;
+ char * zb_func;
+};
#define SET_BOOKMARK(zb, objset, object, level, blkid) \
{ \
@@ -269,6 +270,7 @@ typedef struct zbookmark {
(zb)->zb_object = object; \
(zb)->zb_level = level; \
(zb)->zb_blkid = blkid; \
+ (zb)->zb_func = FTAG; \
}
#define ZB_DESTROYED_OBJSET (-1ULL)