File: debug.c

package info (click to toggle)
fio 2.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,640 kB
  • sloc: ansic: 26,696; makefile: 180; sh: 124
file content (26 lines) | stat: -rw-r--r-- 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdarg.h>
#include <sys/types.h>
#include <unistd.h>
#include "debug.h"

#ifdef FIO_INC_DEBUG
void __dprint(int type, const char *str, ...)
{
	va_list args;
	pid_t pid;

	assert(type < FD_DEBUG_MAX);

	pid = getpid();
	if (fio_debug_jobp && *fio_debug_jobp != -1U
	    && pid != *fio_debug_jobp)
		return;

	log_local("%-8s ", debug_levels[type].name);
	log_local("%-5u ", (int) pid);

	va_start(args, str);
	log_valist(str, args);
	va_end(args);
}
#endif