summaryrefslogtreecommitdiff
path: root/debug.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-05-23 11:55:53 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-05-23 11:55:53 +0200
commit5e1d306e4f9a6337d07cc2d536d77c53e083226f (patch)
tree801ad4becc3f79a884134b500d0883bd3d8ca2a1 /debug.h
parent868eb3cc388f4f34a68a633a1cf8b036c4dcc47a (diff)
downloadfio-5e1d306e4f9a6337d07cc2d536d77c53e083226f.tar.gz
fio-5e1d306e4f9a6337d07cc2d536d77c53e083226f.tar.bz2
Add job number specific dumping and fix atexit() error
The threads/process jobs should use _exit() so they don't run the main atexit() function. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'debug.h')
-rw-r--r--debug.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/debug.h b/debug.h
index 22577a8a..883628da 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 ", pid); \
log_info(str, ##args); \
} while (0)