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
..
2015-05-11 12:23:16 -07:00
2015-07-10 11:58:37 -07:00
2014-08-01 14:28:05 -07:00
2014-01-07 10:33:11 -08:00
2014-08-01 14:28:05 -07:00
2015-06-09 13:48:02 -07:00
2014-03-04 12:22:24 -08:00
2013-12-10 10:09:27 -08:00
2015-09-04 15:30:24 -04:00
2014-07-29 10:55:29 -07:00
2014-07-29 10:55:29 -07:00
2013-11-04 11:18:14 -08:00
2013-09-04 16:01:24 -07:00
2013-11-04 11:17:48 -08:00
2015-09-03 14:14:55 -07:00
2015-09-03 14:14:55 -07:00
2014-08-13 10:35:00 -07:00
2014-07-30 09:20:35 -07:00
2013-09-04 16:01:24 -07:00
2015-05-11 12:23:16 -07:00
2015-09-04 16:08:14 -07:00
2015-01-06 16:53:24 -08:00
2011-02-10 09:21:43 -08:00
2013-11-04 10:55:25 -08:00
2013-12-18 16:46:35 -08:00
2015-06-25 08:58:16 -07:00
2015-06-09 13:48:02 -07:00
2011-03-02 11:43:50 -08:00
2015-05-04 09:41:09 -07:00
2014-07-28 14:29:58 -07:00
2013-11-04 10:55:25 -08:00
2015-09-04 16:08:14 -07:00
2013-12-18 16:46:35 -08:00
2011-02-10 09:27:21 -08:00
2013-11-04 10:55:25 -08:00
2015-09-03 14:14:55 -07:00
2014-08-11 16:11:43 -07:00
2015-06-09 13:48:02 -07:00
2013-11-04 10:55:25 -08:00
2013-11-05 12:14:56 -08:00
2015-09-03 14:14:55 -07:00