mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-13 03:30:34 +03:00
Add ASSERT3B/VERIFY3B/USEC2NSEC/NSEC2USEC macros
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Prakash Surya <prakash.surya@delphix.com> Closes #627
This commit is contained in:
parent
7a35f2b495
commit
dfbd813ec7
@ -31,11 +31,13 @@
|
|||||||
* PANIC() - Panic the node and print message.
|
* PANIC() - Panic the node and print message.
|
||||||
* ASSERT() - Assert X is true, if not panic.
|
* ASSERT() - Assert X is true, if not panic.
|
||||||
* ASSERTV() - Wraps a variable declaration which is only used by ASSERT().
|
* ASSERTV() - Wraps a variable declaration which is only used by ASSERT().
|
||||||
|
* ASSERT3B() - Assert boolean X OP Y is true, if not panic.
|
||||||
* ASSERT3S() - Assert signed X OP Y is true, if not panic.
|
* ASSERT3S() - Assert signed X OP Y is true, if not panic.
|
||||||
* ASSERT3U() - Assert unsigned X OP Y is true, if not panic.
|
* ASSERT3U() - Assert unsigned X OP Y is true, if not panic.
|
||||||
* ASSERT3P() - Assert pointer X OP Y is true, if not panic.
|
* ASSERT3P() - Assert pointer X OP Y is true, if not panic.
|
||||||
* ASSERT0() - Assert value is zero, if not panic.
|
* ASSERT0() - Assert value is zero, if not panic.
|
||||||
* VERIFY() - Verify X is true, if not panic.
|
* VERIFY() - Verify X is true, if not panic.
|
||||||
|
* VERIFY3B() - Verify boolean X OP Y is true, if not panic.
|
||||||
* VERIFY3S() - Verify signed X OP Y is true, if not panic.
|
* VERIFY3S() - Verify signed X OP Y is true, if not panic.
|
||||||
* VERIFY3U() - Verify unsigned X OP Y is true, if not panic.
|
* VERIFY3U() - Verify unsigned X OP Y is true, if not panic.
|
||||||
* VERIFY3P() - Verify pointer X OP Y is true, if not panic.
|
* VERIFY3P() - Verify pointer X OP Y is true, if not panic.
|
||||||
@ -67,6 +69,7 @@ void spl_dumpstack(void);
|
|||||||
"failed (" FMT " " #OP " " FMT ")\n", \
|
"failed (" FMT " " #OP " " FMT ")\n", \
|
||||||
CAST (LEFT), CAST (RIGHT)))
|
CAST (LEFT), CAST (RIGHT)))
|
||||||
|
|
||||||
|
#define VERIFY3B(x,y,z) VERIFY3_IMPL(x, y, z, boolean_t, "%d", (boolean_t))
|
||||||
#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long))
|
#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long))
|
||||||
#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \
|
#define VERIFY3U(x,y,z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \
|
||||||
(unsigned long long))
|
(unsigned long long))
|
||||||
@ -88,6 +91,7 @@ void spl_dumpstack(void);
|
|||||||
#define SPL_DEBUG_STR ""
|
#define SPL_DEBUG_STR ""
|
||||||
#define ASSERT(x) ((void)0)
|
#define ASSERT(x) ((void)0)
|
||||||
#define ASSERTV(x)
|
#define ASSERTV(x)
|
||||||
|
#define ASSERT3B(x,y,z) ((void)0)
|
||||||
#define ASSERT3S(x,y,z) ((void)0)
|
#define ASSERT3S(x,y,z) ((void)0)
|
||||||
#define ASSERT3U(x,y,z) ((void)0)
|
#define ASSERT3U(x,y,z) ((void)0)
|
||||||
#define ASSERT3P(x,y,z) ((void)0)
|
#define ASSERT3P(x,y,z) ((void)0)
|
||||||
@ -103,6 +107,7 @@ void spl_dumpstack(void);
|
|||||||
#define SPL_DEBUG_STR " (DEBUG mode)"
|
#define SPL_DEBUG_STR " (DEBUG mode)"
|
||||||
#define ASSERT(cond) VERIFY(cond)
|
#define ASSERT(cond) VERIFY(cond)
|
||||||
#define ASSERTV(x) x
|
#define ASSERTV(x) x
|
||||||
|
#define ASSERT3B(x,y,z) VERIFY3B(x, y, z)
|
||||||
#define ASSERT3S(x,y,z) VERIFY3S(x, y, z)
|
#define ASSERT3S(x,y,z) VERIFY3S(x, y, z)
|
||||||
#define ASSERT3U(x,y,z) VERIFY3U(x, y, z)
|
#define ASSERT3U(x,y,z) VERIFY3U(x, y, z)
|
||||||
#define ASSERT3P(x,y,z) VERIFY3P(x, y, z)
|
#define ASSERT3P(x,y,z) VERIFY3P(x, y, z)
|
||||||
|
@ -46,6 +46,9 @@
|
|||||||
#define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC))
|
#define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC))
|
||||||
#define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC))
|
#define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC))
|
||||||
|
|
||||||
|
#define USEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MICROSEC))
|
||||||
|
#define NSEC2USEC(n) ((n) / (NANOSEC / MICROSEC))
|
||||||
|
|
||||||
#define NSEC2SEC(n) ((n) / (NANOSEC / SEC))
|
#define NSEC2SEC(n) ((n) / (NANOSEC / SEC))
|
||||||
#define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC))
|
#define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user