Add start of client, start of real protocol
[fio.git] / debug.h
... / ...
CommitLineData
1#ifndef FIO_DEBUG_H
2#define FIO_DEBUG_H
3
4#include <assert.h>
5#include "log.h"
6
7enum {
8 FD_PROCESS = 0,
9 FD_FILE,
10 FD_IO,
11 FD_MEM,
12 FD_BLKTRACE,
13 FD_VERIFY,
14 FD_RANDOM,
15 FD_PARSE,
16 FD_DISKUTIL,
17 FD_JOB,
18 FD_MUTEX,
19 FD_PROFILE,
20 FD_TIME,
21 FD_DEBUG_MAX,
22};
23
24extern unsigned int fio_debug_jobno, *fio_debug_jobp;
25
26#ifdef FIO_INC_DEBUG
27struct debug_level {
28 const char *name;
29 unsigned long shift;
30 unsigned int jobno;
31};
32extern struct debug_level debug_levels[];
33
34extern unsigned long fio_debug;
35
36void __dprint(int type, const char *str, ...);
37
38#define dprint(type, str, args...) \
39 do { \
40 if ((((1 << type)) & fio_debug) == 0) \
41 break; \
42 __dprint((type), (str), ##args); \
43 } while (0) \
44
45#else
46
47static inline void dprint(int type, const char *str, ...)
48{
49}
50#endif
51
52#endif