diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/format/format.i')
-rw-r--r-- | src/third_party/wiredtiger/test/format/format.i | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/test/format/format.i b/src/third_party/wiredtiger/test/format/format.i index 43055bb2809..97e95c97f0c 100644 --- a/src/third_party/wiredtiger/test/format/format.i +++ b/src/third_party/wiredtiger/test/format/format.i @@ -231,7 +231,8 @@ lock_writeunlock(WT_SESSION *session, RWLOCK *lock) testutil_check(pthread_rwlock_unlock(&lock->l.pthread)); } } -#define tracemsg(fmt, ...) \ + +#define trace_msg(fmt, ...) \ do { \ if (g.trace) { \ struct timespec __ts; \ @@ -242,7 +243,7 @@ lock_writeunlock(WT_SESSION *session, RWLOCK *lock) (uintmax_t)__ts.tv_nsec / WT_THOUSAND, g.tidbuf, __VA_ARGS__)); \ } \ } while (0) -#define traceop(tinfo, fmt, ...) \ +#define trace_op(tinfo, fmt, ...) \ do { \ if (g.trace) { \ struct timespec __ts; \ @@ -253,3 +254,16 @@ lock_writeunlock(WT_SESSION *session, RWLOCK *lock) (uintmax_t)__ts.tv_nsec / WT_THOUSAND, tinfo->tidbuf, __VA_ARGS__)); \ } \ } while (0) + +/* + * trace_bytes -- + * Return a byte string formatted for display. + */ +static inline const char * +trace_bytes(TINFO *tinfo, const uint8_t *data, size_t size) +{ + testutil_check( + __wt_raw_to_esc_hex((WT_SESSION_IMPL *)tinfo->session, data, size, &tinfo->vprint)); + return (tinfo->vprint.mem); +} +#define trace_item(tinfo, buf) trace_bytes(tinfo, (buf)->data, (buf)->size) |