Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 1 | #include <stdarg.h> |
2 | #include <sys/types.h> | ||||
3 | #include <unistd.h> | ||||
4 | #include "debug.h" | ||||
5 | |||||
Jens Axboe | 2d5c40e | 2010-03-19 19:09:37 +0100 | [diff] [blame] | 6 | #ifdef FIO_INC_DEBUG |
Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 7 | void __dprint(int type, const char *str, ...) |
8 | { | ||||
9 | va_list args; | ||||
10 | pid_t pid; | ||||
11 | |||||
12 | assert(type < FD_DEBUG_MAX); | ||||
13 | |||||
Jens Axboe | 517a1a4 | 2013-02-27 12:32:43 +0100 | [diff] [blame] | 14 | pid = getpid(); |
Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 15 | if (fio_debug_jobp && *fio_debug_jobp != -1U |
Jens Axboe | 517a1a4 | 2013-02-27 12:32:43 +0100 | [diff] [blame] | 16 | && pid != *fio_debug_jobp) |
Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 17 | return; |
18 | |||||
Jens Axboe | 03a0825 | 2013-09-11 08:23:45 -0600 | [diff] [blame^] | 19 | log_info("%-8s ", debug_levels[type].name); |
20 | log_info("%-5u ", (int) pid); | ||||
Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 21 | |
22 | va_start(args, str); | ||||
Jens Axboe | d048ba6 | 2010-03-19 16:50:37 +0100 | [diff] [blame] | 23 | log_valist(str, args); |
Jens Axboe | bf84eac | 2010-03-19 16:41:52 +0100 | [diff] [blame] | 24 | va_end(args); |
25 | } | ||||
Jens Axboe | 2d5c40e | 2010-03-19 19:09:37 +0100 | [diff] [blame] | 26 | #endif |