diff options
Diffstat (limited to 'ioshark')
-rw-r--r-- | ioshark/README | 2 | ||||
-rw-r--r-- | ioshark/ioshark_bench.c | 8 | ||||
-rw-r--r-- | ioshark/ioshark_bench_subr.c | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/ioshark/README b/ioshark/README index 0c50fec3..f71a2600 100644 --- a/ioshark/README +++ b/ioshark/README @@ -19,6 +19,8 @@ files into a wl.tar file. device (on /data/local/tmp say). Explode the tarfile. - Run the tester. "ioshark_bench *.wl" runs the test with default options. Supported ioshark_bench options : +-b : Explicitly specify a blockdev (to get IO stats from from +/proc/diskstats). -d : Preserve the delays between successive filesystem syscalls as seen in the original straces. -n <N> : Run for N iterations diff --git a/ioshark/ioshark_bench.c b/ioshark/ioshark_bench.c index f44e73e4..7593394e 100644 --- a/ioshark/ioshark_bench.c +++ b/ioshark/ioshark_bench.c @@ -68,6 +68,7 @@ int do_delay = 0; int verbose = 0; int summary_mode = 0; int quick_mode = 0; +char *blockdev_name = NULL; /* if user would like to specify blockdev */ #if 0 static long gettid() @@ -78,7 +79,7 @@ static long gettid() void usage() { - fprintf(stderr, "%s [-d preserve_delays] [-n num_iterations] [-t num_threads] -q -v | -s <list of parsed input files>\n", + fprintf(stderr, "%s [-b blockdev_name] [-d preserve_delays] [-n num_iterations] [-t num_threads] -q -v | -s <list of parsed input files>\n", progname); fprintf(stderr, "%s -s, -v are mutually exclusive\n", progname); @@ -661,8 +662,11 @@ main(int argc, char **argv) struct thread_state_s *state; progname = argv[0]; - while ((c = getopt(argc, argv, "dn:st:qv")) != EOF) { + while ((c = getopt(argc, argv, "b:dn:st:qv")) != EOF) { switch (c) { + case 'b': + blockdev_name = strdup(optarg); + break; case 'd': do_delay = 1; break; diff --git a/ioshark/ioshark_bench_subr.c b/ioshark/ioshark_bench_subr.c index 4280a5a4..e8e93c9c 100644 --- a/ioshark/ioshark_bench_subr.c +++ b/ioshark/ioshark_bench_subr.c @@ -375,6 +375,8 @@ get_cores(void) } #endif +extern char *blockdev_name; + static void get_blockdev_name(char *bdev) { @@ -402,9 +404,11 @@ get_blockdev_name(char *bdev) } else if (strncmp(dev_name, "marlin", strlen("marlin")) == 0 || strncmp(dev_name, "sailfish", strlen("sailfish")) == 0) { strcpy(bdev, "sda"); + } else if (blockdev_name != NULL) { + strcpy(bdev, blockdev_name); } else { fprintf(stderr, - "%s: Unknown device %s\n", + "%s: Unknown device %s, please specify block device name with -b\n", progname, dev_name); exit(1); } |