X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=debug.h;h=160f48c3b75a9bcfc62eb0ce614181f5daa5a088;hp=22577a8a8afccee744c55c8ec8c4879659208093;hb=5921e80c5dfc9f96d2f21da6ae58f2b5d3a0b373;hpb=cd991b9e36b18903f1564a4bfafdc83a9f165219 diff --git a/debug.h b/debug.h index 22577a8a..160f48c3 100644 --- a/debug.h +++ b/debug.h @@ -14,6 +14,7 @@ enum { FD_RANDOM, FD_PARSE, FD_DISKUTIL, + FD_JOB, FD_DEBUG_MAX, }; @@ -21,17 +22,24 @@ enum { struct debug_level { const char *name; unsigned long shift; + unsigned int jobno; }; extern struct debug_level debug_levels[]; extern unsigned long fio_debug; +extern unsigned int fio_debug_jobno, *fio_debug_jobp; #define dprint(type, str, args...) \ do { \ + pid_t pid = getpid(); \ assert(type < FD_DEBUG_MAX); \ if ((((1 << type)) & fio_debug) == 0) \ break; \ + if (fio_debug_jobp && *fio_debug_jobp != -1U \ + && pid != *fio_debug_jobp) \ + break; \ log_info("%-8s ", debug_levels[(type)].name); \ + log_info("%-5u ", (int) pid); \ log_info(str, ##args); \ } while (0)