]> git.proxmox.com Git - mirror_zfs.git/commit - man/man5/zfs-module-parameters.5
Add line info and SET_ERROR() to ZFS debug log
authorNed Bass <bass6@llnl.gov>
Wed, 26 Jul 2017 06:09:48 +0000 (23:09 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 26 Jul 2017 06:09:48 +0000 (23:09 -0700)
commit8740cf4a2f5f7ff7fb6c214e0baf06356b2870b8
treeb653cfe22dfd57e65f29206a0b73563811893414
parent9ff13dbe921c7177faee3f10c832e88bded39920
Add line info and SET_ERROR() to ZFS debug log

Redefine the SET_ERROR macro in terms of __dprintf() so the error
return codes get logged as both tracepoint events (if tracepoints are
enabled) and as ZFS debug log entries.  This also allows us to use
the same definition of SET_ERROR() in kernel and user space.

Define a new debug flag ZFS_DEBUG_SET_ERROR=512 that may be bitwise
or'd into zfs_flags. Setting this flag enables both dprintf() and
SET_ERROR() messages in the debug log. That is, setting
ZFS_DEBUG_SET_ERROR and ZFS_DEBUG_DPRINTF|ZFS_DEBUG_SET_ERROR are
equivalent (this was done for sake of simplicity). Leaving
ZFS_DEBUG_SET_ERROR unset suppresses the SET_ERROR() messages which
helps avoid cluttering up the logs.

To enable SET_ERROR() logging, run:

  echo 1 >   /sys/module/zfs/parameters/zfs_dbgmsg_enable
  echo 512 > /sys/module/zfs/parameters/zfs_flags

Remove the zfs_set_error_class tracepoints event class since
SET_ERROR() now uses __dprintf(). This sacrifices a bit of
granularity when selecting individual tracepoint events to enable but
it makes the code simpler.

Include file, function, and line number information in debug log
entries.  The information is now added to the message buffer in
__dprintf() and as a result the zfs_dprintf_class tracepoints event
class was changed from a 4 parameter interface to a single parameter.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #6400
include/sys/sdt.h
include/sys/trace_dbgmsg.h
include/sys/zfs_context.h
include/sys/zfs_debug.h
man/man5/zfs-module-parameters.5
module/zfs/zfs_debug.c