Add log_valist()
[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
6void __dprint(int type, const char *str, ...)
7{
8 va_list args;
9 pid_t pid;
10
11 assert(type < FD_DEBUG_MAX);
12
13 if ((((1 << type)) & fio_debug) == 0)
14 return;
15
16 pid = getpid();
17 if (fio_debug_jobp && *fio_debug_jobp != -1U
18 && pid != *fio_debug_jobp)
19 return;
20
21 log_info("%-8s ", debug_levels[(type)].name);
22 log_info("%-5u ", (int) pid);
23
24 va_start(args, str);
d048ba60 25 log_valist(str, args);
bf84eacb
JA
26 va_end(args);
27}