summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-01-05 19:06:39 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-01-05 19:06:39 +0100
commit29adda3ce304f16036cafee6c099aa08444a7db1 (patch)
tree6740da9601eb9d801a487e781df177ffe0fec002
parent3c2d93ede7d03b3a6923edb55c7737fe014794cb (diff)
downloadfio-29adda3ce304f16036cafee6c099aa08444a7db1.tar.gz
fio-29adda3ce304f16036cafee6c099aa08444a7db1.tar.bz2
Add --debug=mutex
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--README1
-rw-r--r--debug.h1
-rw-r--r--fio.c7
-rw-r--r--init.c1
4 files changed, 10 insertions, 0 deletions
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, },
};