Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h
Show All 18 Lines | |||||
* for more details. | * for more details. | ||||
* | * | ||||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU General Public License along | ||||
* with the SPL. If not, see <http://www.gnu.org/licenses/>. | * with the SPL. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef _SPL_KSTAT_H | #ifndef _SPL_KSTAT_H | ||||
#define _SPL_KSTAT_H | #define _SPL_KSTAT_H | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#ifndef _STANDALONE | |||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#endif | |||||
struct list_head {}; | struct list_head {}; | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#define KSTAT_STRLEN 255 | #define KSTAT_STRLEN 255 | ||||
#define KSTAT_RAW_MAX (128*1024) | #define KSTAT_RAW_MAX (128*1024) | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | struct kstat_s { | ||||
void *ks_private1; /* private data */ | void *ks_private1; /* private data */ | ||||
kmutex_t ks_private_lock; /* kstat private data lock */ | kmutex_t ks_private_lock; /* kstat private data lock */ | ||||
kmutex_t *ks_lock; /* kstat data lock */ | kmutex_t *ks_lock; /* kstat data lock */ | ||||
struct list_head ks_list; /* kstat linkage */ | struct list_head ks_list; /* kstat linkage */ | ||||
kstat_module_t *ks_owner; /* kstat module linkage */ | kstat_module_t *ks_owner; /* kstat module linkage */ | ||||
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */ | kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */ | ||||
char *ks_raw_buf; /* buf used for raw ops */ | char *ks_raw_buf; /* buf used for raw ops */ | ||||
size_t ks_raw_bufsize; /* size of raw ops buffer */ | size_t ks_raw_bufsize; /* size of raw ops buffer */ | ||||
#ifndef _STANDALONE | |||||
struct sysctl_ctx_list ks_sysctl_ctx; | struct sysctl_ctx_list ks_sysctl_ctx; | ||||
struct sysctl_oid *ks_sysctl_root; | struct sysctl_oid *ks_sysctl_root; | ||||
#endif /* _STANDALONE */ | |||||
}; | }; | ||||
typedef struct kstat_named_s { | typedef struct kstat_named_s { | ||||
char name[KSTAT_STRLEN]; /* name of counter */ | char name[KSTAT_STRLEN]; /* name of counter */ | ||||
uchar_t data_type; /* data type */ | uchar_t data_type; /* data type */ | ||||
union { | union { | ||||
char c[16]; /* 128-bit int */ | char c[16]; /* 128-bit int */ | ||||
int32_t i32; /* 32-bit signed int */ | int32_t i32; /* 32-bit signed int */ | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
extern void kstat_waitq_exit(kstat_io_t *); | extern void kstat_waitq_exit(kstat_io_t *); | ||||
extern void kstat_runq_enter(kstat_io_t *); | extern void kstat_runq_enter(kstat_io_t *); | ||||
extern void kstat_runq_exit(kstat_io_t *); | extern void kstat_runq_exit(kstat_io_t *); | ||||
#define kstat_set_seq_raw_ops(k, h, d, a) \ | #define kstat_set_seq_raw_ops(k, h, d, a) \ | ||||
__kstat_set_seq_raw_ops(k, h, d, a) | __kstat_set_seq_raw_ops(k, h, d, a) | ||||
#define kstat_set_raw_ops(k, h, d, a) \ | #define kstat_set_raw_ops(k, h, d, a) \ | ||||
__kstat_set_raw_ops(k, h, d, a) | __kstat_set_raw_ops(k, h, d, a) | ||||
#ifndef _STANDALONE | |||||
#define kstat_create(m, i, n, c, t, s, f) \ | #define kstat_create(m, i, n, c, t, s, f) \ | ||||
__kstat_create(m, i, n, c, t, s, f) | __kstat_create(m, i, n, c, t, s, f) | ||||
#define kstat_install(k) __kstat_install(k) | #define kstat_install(k) __kstat_install(k) | ||||
#define kstat_delete(k) __kstat_delete(k) | #define kstat_delete(k) __kstat_delete(k) | ||||
#else | |||||
#define kstat_create(m, i, n, c, t, s, f) ((kstat_t *)0) | |||||
#define kstat_install(k) | |||||
#define kstat_delete(k) | |||||
#endif | |||||
#endif /* _SPL_KSTAT_H */ | #endif /* _SPL_KSTAT_H */ |