Merge branch 'linux-have-spl-debug' into refs/top-bases/linux-zfs-branch
This commit is contained in:
commit
d6f7161332
|
@ -524,11 +524,13 @@ extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *,
|
|||
/*
|
||||
* When dealing with nvlists, verify() is extremely useful
|
||||
*/
|
||||
#ifndef verify
|
||||
#ifdef NDEBUG
|
||||
#define verify(EX) ((void)(EX))
|
||||
#define verify(EX) ((void)(EX))
|
||||
#else
|
||||
#define verify(EX) assert(EX)
|
||||
#endif
|
||||
#define verify(EX) assert(EX)
|
||||
#endif /* NDEBUG */
|
||||
#endif /* verify */
|
||||
|
||||
/*
|
||||
* Utility function to convert a number to a human-readable form.
|
||||
|
|
|
@ -57,11 +57,16 @@ extern int zfs_flags;
|
|||
#define ZFS_DEBUG_MODIFY 0x0010
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
#if defined(_KERNEL) && defined(HAVE_SPL)
|
||||
#include <sys/debug.h>
|
||||
#define dprintf(...) CDEBUG_LIMIT(D_DPRINTF, __VA_ARGS__)
|
||||
#else
|
||||
extern void __dprintf(const char *file, const char *func,
|
||||
int line, const char *fmt, ...);
|
||||
#define dprintf(...) \
|
||||
if (zfs_flags & ZFS_DEBUG_DPRINTF) \
|
||||
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
|
||||
#endif /* _KERNEL && HAVE_SPL */
|
||||
#else
|
||||
#define dprintf(...) ((void)0)
|
||||
#endif /* ZFS_DEBUG */
|
||||
|
|
|
@ -233,8 +233,13 @@ kmem_cache_t *spa_buffer_pool;
|
|||
int spa_mode;
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
#if defined(_KERNEL) && defined(HAVE_SPL)
|
||||
/* All filtering done by the SPL */
|
||||
int zfs_flags = ~0;
|
||||
#else
|
||||
/* Everything except dprintf is on by default in debug builds */
|
||||
int zfs_flags = ~ZFS_DEBUG_DPRINTF;
|
||||
#endif
|
||||
#else
|
||||
int zfs_flags = 0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue