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
|
* When dealing with nvlists, verify() is extremely useful
|
||||||
*/
|
*/
|
||||||
|
#ifndef verify
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#define verify(EX) ((void)(EX))
|
#define verify(EX) ((void)(EX))
|
||||||
#else
|
#else
|
||||||
#define verify(EX) assert(EX)
|
#define verify(EX) assert(EX)
|
||||||
#endif
|
#endif /* NDEBUG */
|
||||||
|
#endif /* verify */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utility function to convert a number to a human-readable form.
|
* Utility function to convert a number to a human-readable form.
|
||||||
|
|
|
@ -57,11 +57,16 @@ extern int zfs_flags;
|
||||||
#define ZFS_DEBUG_MODIFY 0x0010
|
#define ZFS_DEBUG_MODIFY 0x0010
|
||||||
|
|
||||||
#ifdef ZFS_DEBUG
|
#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,
|
extern void __dprintf(const char *file, const char *func,
|
||||||
int line, const char *fmt, ...);
|
int line, const char *fmt, ...);
|
||||||
#define dprintf(...) \
|
#define dprintf(...) \
|
||||||
if (zfs_flags & ZFS_DEBUG_DPRINTF) \
|
if (zfs_flags & ZFS_DEBUG_DPRINTF) \
|
||||||
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
|
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
|
||||||
|
#endif /* _KERNEL && HAVE_SPL */
|
||||||
#else
|
#else
|
||||||
#define dprintf(...) ((void)0)
|
#define dprintf(...) ((void)0)
|
||||||
#endif /* ZFS_DEBUG */
|
#endif /* ZFS_DEBUG */
|
||||||
|
|
|
@ -233,8 +233,13 @@ kmem_cache_t *spa_buffer_pool;
|
||||||
int spa_mode;
|
int spa_mode;
|
||||||
|
|
||||||
#ifdef ZFS_DEBUG
|
#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 */
|
/* Everything except dprintf is on by default in debug builds */
|
||||||
int zfs_flags = ~ZFS_DEBUG_DPRINTF;
|
int zfs_flags = ~ZFS_DEBUG_DPRINTF;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
int zfs_flags = 0;
|
int zfs_flags = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue