zfs/cmd
Brian Behlendorf 3b36f8319d Add dbgmsg kstat
Internally ZFS keeps a small log to facilitate debugging.  By default
the log is disabled, to enable it set zfs_dbgmsg_enable=1.  The contents
of the log can be accessed by reading the /proc/spl/kstat/zfs/dbgmsg file.
Writing 0 to this proc file clears the log.

$ echo 1 >/sys/module/zfs/parameters/zfs_dbgmsg_enable
$ echo 0 >/proc/spl/kstat/zfs/dbgmsg
$ zpool import tank
$ cat /proc/spl/kstat/zfs/dbgmsg
1 0 0x01 -1 0 2492357525542 2525836565501
timestamp    message
1441141408   spa=tank async request task=1
1441141408   txg 70 open pool version 5000; software version 5000/5; ...
1441141409   spa=tank async request task=32
1441141409   txg 72 import pool version 5000; software version 5000/5; ...
1441141414   command: lt-zpool import tank

Note the zfs_dbgmsg() and dprintf() functions are both now mapped to
the same log.  As mentioned above the kernel debug log can be accessed
though the /proc/spl/kstat/zfs/dbgmsg kstat.  For user space consumers
log messages are immediately written to stdout after applying the
ZFS_DEBUG environment variable.

$ ZFS_DEBUG=on ./cmd/ztest/ztest -V

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #3728
2015-09-04 16:08:14 -07:00
..
arc_summary Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
arcstat Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
dbufstat Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
fsck_zfs Add /sbin/fsck.zfs helper 2013-01-09 16:54:58 -08:00
mount_zfs Add temporary mount options 2015-09-03 14:14:55 -07:00
vdev_id Add extra keyword 'slot' to vdev_id.conf 2015-08-30 10:03:56 -07:00
zdb Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zed Rework zed_notify_email for configurable PROG/OPTS 2015-07-30 11:52:56 -07:00
zfs Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zhack Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zinject Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zpios Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zpool Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zstreamdump Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
ztest Add dbgmsg kstat 2015-09-04 16:08:14 -07:00
zvol_id Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
Makefile.am Install arc_summary.py 2015-03-03 13:38:17 -08:00