Add some new code comments on the log compress/decompress
[fio.git] / debug.c
CommitLineData
bf84eacb
JA
1#include <stdarg.h>
2#include <sys/types.h>
3#include <unistd.h>
4#include "debug.h"
5
2d5c40e7 6#ifdef FIO_INC_DEBUG
bf84eacb
JA
7void __dprint(int type, const char *str, ...)
8{
9 va_list args;
10 pid_t pid;
11
12 assert(type < FD_DEBUG_MAX);
13
517a1a48 14 pid = getpid();
bf84eacb 15 if (fio_debug_jobp && *fio_debug_jobp != -1U
517a1a48 16 && pid != *fio_debug_jobp)
bf84eacb
JA
17 return;
18
03a08252
JA
19 log_info("%-8s ", debug_levels[type].name);
20 log_info("%-5u ", (int) pid);
bf84eacb
JA
21
22 va_start(args, str);
d048ba60 23 log_valist(str, args);
bf84eacb
JA
24 va_end(args);
25}
2d5c40e7 26#endif