From 9ebc27e1352b905fe3396ce2350a7765fe9c57b8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 12 Jun 2006 10:21:50 +0200 Subject: [PATCH] [PATCH] Remove the old job command line options It's all possible to specify in the job file. --- README | 9 +++------ fio.h | 1 + init.c | 47 ++++++++++++----------------------------------- 3 files changed, 16 insertions(+), 41 deletions(-) diff --git a/README b/README index 79d71f9a..c951504e 100644 --- a/README +++ b/README @@ -43,16 +43,11 @@ Command line ------------ $ fio - -s IO is sequential - -b block size in KiB for each io -t Runtime in seconds - -r For random io, sequence must be repeatable - -R If one thread fails to meet rate, quit all - -o Use direct IO is 1, buffered if 0 -l Generate per-job latency logs -w Generate per-job bandwidth logs -f Read for job descriptions - -O Log output to file + -o Log output to file -h Print help info -v Print version information and exit @@ -82,6 +77,8 @@ The job file parameters are: be used if they don't add up to 100%. rwmixwrite=x 'x' percentage of rw mix ios will be writes. See rwmixread. + rand_repeatable=x The sequence of random io blocks can be repeatable + across runs, if 'x' is 1. size=x Set file size to x bytes (x string can include k/m/g) ioengine=x 'x' may be: aio/libaio/linuxaio for Linux aio, posixaio for POSIX aio, sync for regular read/write io, diff --git a/fio.h b/fio.h index 49603ebc..cc686034 100644 --- a/fio.h +++ b/fio.h @@ -169,6 +169,7 @@ struct thread_data { unsigned char use_thread; unsigned char do_disk_util; unsigned char override_sync; + unsigned char rand_repeatable; unsigned int bs; unsigned int min_bs; diff --git a/init.c b/init.c index 570095a1..b437f40c 100644 --- a/init.c +++ b/init.c @@ -40,11 +40,7 @@ #define DEF_RWMIX_READ (50) #define DEF_NICE (0) -static int def_sequential = DEF_SEQUENTIAL; -static int def_bs = DEF_BS; static int def_timeout = DEF_TIMEOUT; -static int def_repeatable = DEF_RAND_REPEAT; -static int def_odirect = DEF_ODIRECT; static char fio_version_string[] = "fio 1.4"; @@ -232,7 +228,7 @@ int init_random_state(struct thread_data *td) if (td->sequential) return 0; - if (def_repeatable) + if (td->rand_repeatable) seeds[3] = DEF_RANDSEED; blocks = (td->io_size + td->min_bs - 1) / td->min_bs; @@ -655,6 +651,11 @@ int parse_jobs_ini(char *file) fgetpos(f, &off); continue; } + if (!check_int(p, "rand_repeatable", &il)) { + td->rand_repeatable = il; + fgetpos(f, &off); + continue; + } if (!check_int(p, "rate", &td->rate)) { fgetpos(f, &off); continue; @@ -924,14 +925,14 @@ static int fill_def_thread(void) */ def_thread.ddir = DDIR_READ; def_thread.iomix = 0; - def_thread.bs = def_bs; + def_thread.bs = DEF_BS; def_thread.min_bs = -1; def_thread.max_bs = -1; def_thread.io_engine = DEF_IO_ENGINE; strcpy(def_thread.io_engine_name, DEF_IO_ENGINE_NAME); - def_thread.odirect = def_odirect; + def_thread.odirect = DEF_ODIRECT; def_thread.ratecycle = DEF_RATE_CYCLE; - def_thread.sequential = def_sequential; + def_thread.sequential = DEF_SEQUENTIAL; def_thread.timeout = def_timeout; def_thread.create_file = DEF_CREATE; def_thread.overwrite = DEF_OVERWRITE; @@ -949,6 +950,7 @@ static int fill_def_thread(void) def_thread.rwmixcycle = DEF_RWMIX_CYCLE; def_thread.rwmixread = DEF_RWMIX_READ; def_thread.nice = DEF_NICE; + def_thread.rand_repeatable = DEF_RAND_REPEAT; #ifdef FIO_HAVE_DISK_UTIL def_thread.do_disk_util = 1; #endif @@ -974,37 +976,12 @@ static int parse_cmd_line(int argc, char *argv[]) { int c, idx = 1, ini_idx = 0; - while ((c = getopt(argc, argv, "s:b:t:r:R:o:f:lwvhO:")) != EOF) { + while ((c = getopt(argc, argv, "t:o:f:lwvh")) != EOF) { switch (c) { - case 's': - def_sequential = !!atoi(optarg); - idx++; - break; - case 'b': - def_bs = atoi(optarg); - def_bs <<= 10; - if (!def_bs) { - printf("bad block size\n"); - def_bs = DEF_BS; - } - idx++; - break; case 't': def_timeout = atoi(optarg); idx++; break; - case 'r': - def_repeatable = !!atoi(optarg); - idx++; - break; - case 'R': - rate_quit = !!atoi(optarg); - idx++; - break; - case 'o': - def_odirect = !!atoi(optarg); - idx++; - break; case 'f': ini_idx++; ini_file = realloc(ini_file, ini_idx * sizeof(char *)); @@ -1019,7 +996,7 @@ static int parse_cmd_line(int argc, char *argv[]) write_bw_log = 1; idx++; break; - case 'O': + case 'o': f_out = fopen(optarg, "w+"); if (!f_out) { perror("fopen output"); -- 2.25.1