From: Jens Axboe Date: Mon, 5 Jan 2009 18:06:39 +0000 (+0100) Subject: Add --debug=mutex X-Git-Tag: fio-1.24~16 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=29adda3ce304f16036cafee6c099aa08444a7db1 Add --debug=mutex Signed-off-by: Jens Axboe --- diff --git a/README b/README index c5598109..dd3bab11 100644 --- a/README +++ b/README @@ -126,6 +126,7 @@ options in fio. Currently the options are: parse Dump info related to option matching and parsing diskutil Dump info related to disk utilization updates job:x Dump info only related to job number x + mutex Dump info only related to mutex up/down ops ? or help Show available debug options. You can specify as many as you want, eg --debug=file,mem will enable diff --git a/debug.h b/debug.h index a9e9e935..1a2b79ab 100644 --- a/debug.h +++ b/debug.h @@ -15,6 +15,7 @@ enum { FD_PARSE, FD_DISKUTIL, FD_JOB, + FD_MUTEX, FD_DEBUG_MAX, }; diff --git a/fio.c b/fio.c index 30b40cc7..5a40004f 100644 --- a/fio.c +++ b/fio.c @@ -941,8 +941,11 @@ static void *thread_main(void *data) td->io_hist_tree = RB_ROOT; td_set_runstate(td, TD_INITIALIZED); + dprint(FD_MUTEX, "up startup_mutex\n"); fio_mutex_up(startup_mutex); + dprint(FD_MUTEX, "wait on td->mutex\n"); fio_mutex_down(td->mutex); + dprint(FD_MUTEX, "done waiting on td->mutex\n"); /* * the ->mutex mutex is now no longer used, close it to avoid @@ -1280,7 +1283,9 @@ static int fio_start_gtod_thread(void) return 1; } + dprint(FD_MUTEX, "wait on startup_mutex\n"); fio_mutex_down(startup_mutex); + dprint(FD_MUTEX, "done waiting on startup_mutex\n"); return 0; } @@ -1422,7 +1427,9 @@ static void run_threads(void) } else if (i == fio_debug_jobno) *fio_debug_jobp = pid; } + dprint(FD_MUTEX, "wait on startup_mutex\n"); fio_mutex_down(startup_mutex); + dprint(FD_MUTEX, "done waiting on startup_mutex\n"); } /* diff --git a/init.c b/init.c index 3142d8ca..1adc004b 100644 --- a/init.c +++ b/init.c @@ -895,6 +895,7 @@ struct debug_level debug_levels[] = { { .name = "parse", .shift = FD_PARSE }, { .name = "diskutil", .shift = FD_DISKUTIL }, { .name = "job", .shift = FD_JOB }, + { .name = "mutex", .shift = FD_MUTEX }, { .name = NULL, }, };