xref: /titanic_53/usr/src/common/zev/zev.h (revision 205a9bc9923894a217a2d0059577e6956a93acba)
12bb8e5e2SAndreas Jaekel #ifndef __ZEV_H__
22bb8e5e2SAndreas Jaekel #define __ZEV_H__
32bb8e5e2SAndreas Jaekel 
42bb8e5e2SAndreas Jaekel #include <sys/types.h>
52bb8e5e2SAndreas Jaekel 
62bb8e5e2SAndreas Jaekel #ifdef _KERNEL
72bb8e5e2SAndreas Jaekel #include <sys/dmu_objset.h>
82bb8e5e2SAndreas Jaekel #include <sys/dsl_dataset.h>
92bb8e5e2SAndreas Jaekel #include <sys/zfs_vfsops.h>
102bb8e5e2SAndreas Jaekel #include <sys/dsl_dir.h>
112bb8e5e2SAndreas Jaekel #include <sys/spa_impl.h>
122bb8e5e2SAndreas Jaekel #endif
132bb8e5e2SAndreas Jaekel 
142bb8e5e2SAndreas Jaekel #define ZEVIOC				  ('z' << 8)
152bb8e5e2SAndreas Jaekel #define ZEV_IOC_GET_STATISTICS		  (ZEVIOC | 1)	/* get zev statistics */
16*205a9bc9SAndreas Jaekel #define ZEV_IOC_MUTE_POOL		  (ZEVIOC | 2)	/* no events for pool */
17*205a9bc9SAndreas Jaekel #define ZEV_IOC_UNMUTE_POOL		  (ZEVIOC | 3)	/* send pool events */
18*205a9bc9SAndreas Jaekel #define ZEV_IOC_SET_MAX_QUEUE_LEN	  (ZEVIOC | 4)	/* when to block ops */
19*205a9bc9SAndreas Jaekel #define ZEV_IOC_SET_POLL_WAKEUP_QUEUE_LEN (ZEVIOC | 5)	/* poll throttle */
202bb8e5e2SAndreas Jaekel 
212bb8e5e2SAndreas Jaekel #define ZEV_OP_MIN			 1
222bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZFS_MOUNT		 1
232bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZFS_UMOUNT		 2
242bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZVOL_WRITE		 3
252bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZVOL_TRUNCATE		 4
262bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_CLOSE_AFTER_UPDATE	 5
272bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_CREATE		 6
282bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_REMOVE		 7
292bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_LINK		 8
302bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_SYMLINK		 9
312bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_RENAME		10
322bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_WRITE		11
332bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_TRUNCATE		12
342bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_SETATTR		13
352bb8e5e2SAndreas Jaekel #define	ZEV_OP_ZNODE_ACL		14
362bb8e5e2SAndreas Jaekel #define	ZEV_OP_MAX			14
372bb8e5e2SAndreas Jaekel 
382bb8e5e2SAndreas Jaekel typedef struct zev_statistics_t {
392bb8e5e2SAndreas Jaekel 	uint64_t	zev_queue_len;
402bb8e5e2SAndreas Jaekel 	uint64_t	zev_bytes_read;
41*205a9bc9SAndreas Jaekel 	/* runtime settings */
42*205a9bc9SAndreas Jaekel 	uint64_t	zev_max_queue_len;
43*205a9bc9SAndreas Jaekel 	uint64_t	zev_poll_wakeup_queue_len;
442bb8e5e2SAndreas Jaekel 	/* counters */
452bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_total_events;
462bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_errors;
472bb8e5e2SAndreas Jaekel 	/* zfsvfs ops */
482bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_zfs_mount;
492bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_zfs_umount;
502bb8e5e2SAndreas Jaekel 	/* zvol ops */
512bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_zvol_write;
522bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_zvol_truncate;
532bb8e5e2SAndreas Jaekel 	/* znode ops */
542bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_close_after_update;
552bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_create;
562bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_remove;
572bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_link;
582bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_symlink;
592bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_rename;
602bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_write;
612bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_truncate;
622bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_setattr;
632bb8e5e2SAndreas Jaekel 	uint64_t	zev_cnt_znode_acl;
642bb8e5e2SAndreas Jaekel } zev_statistics_t;
652bb8e5e2SAndreas Jaekel 
662bb8e5e2SAndreas Jaekel typedef struct zev_ioctl_poolarg {
672bb8e5e2SAndreas Jaekel 	uint64_t	zev_poolname_len;
682bb8e5e2SAndreas Jaekel 	char		zev_poolname[MAXPATHLEN];
692bb8e5e2SAndreas Jaekel } zev_ioctl_poolarg_t;
702bb8e5e2SAndreas Jaekel 
712bb8e5e2SAndreas Jaekel #ifdef _KERNEL
722bb8e5e2SAndreas Jaekel void zev_mq_printf(int op, int error, char *fmt, ...);
732bb8e5e2SAndreas Jaekel int zev_skip_pool(objset_t *os);
742bb8e5e2SAndreas Jaekel #endif
752bb8e5e2SAndreas Jaekel 
762bb8e5e2SAndreas Jaekel #endif /* __ZEV_H__ */
772bb8e5e2SAndreas Jaekel 
78