[PATCH] Remove the old job command line options
authorJens Axboe <axboe@suse.de>
Mon, 12 Jun 2006 08:21:50 +0000 (10:21 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 12 Jun 2006 08:21:50 +0000 (10:21 +0200)
It's all possible to specify in the job file.

README
fio.h
init.c

diff --git a/README b/README
index 79d71f9a8bab641ee8952a060c152478aae947e5..c951504eb52925c46678195d1783abd219ebf01f 100644 (file)
--- a/README
+++ b/README
@@ -43,16 +43,11 @@ Command line
 ------------
 
 $ fio
 ------------
 
 $ fio
-       -s IO is sequential
-       -b block size in KiB for each io
        -t <sec> Runtime in seconds
        -t <sec> Runtime in seconds
-       -r For random io, sequence must be repeatable
-       -R <on> If one thread fails to meet rate, quit all
-       -o <on> Use direct IO is 1, buffered if 0
        -l Generate per-job latency logs
        -w Generate per-job bandwidth logs
        -f <file> Read <file> for job descriptions
        -l Generate per-job latency logs
        -w Generate per-job bandwidth logs
        -f <file> Read <file> for job descriptions
-       -O <file> Log output to file
+       -o <file> Log output to file
        -h Print help info
        -v Print version information and exit
 
        -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.
                         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,
        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 49603ebc70f1cbbda6db2cf7ee15c39c93c97f14..cc68603499759b369f25b1038e30a07036074874 100644 (file)
--- 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 use_thread;
        unsigned char do_disk_util;
        unsigned char override_sync;
+       unsigned char rand_repeatable;
 
        unsigned int bs;
        unsigned int min_bs;
 
        unsigned int bs;
        unsigned int min_bs;
diff --git a/init.c b/init.c
index 570095a119dd7ed6154d4252054b54eabf8a3298..b437f40c2be463e461abd94c2a1c4723af7ed2c2 100644 (file)
--- a/init.c
+++ b/init.c
 #define DEF_RWMIX_READ         (50)
 #define DEF_NICE               (0)
 
 #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_timeout = DEF_TIMEOUT;
-static int def_repeatable = DEF_RAND_REPEAT;
-static int def_odirect = DEF_ODIRECT;
 
 static char fio_version_string[] = "fio 1.4";
 
 
 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 (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;
                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;
                        }
                                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;
                        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.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.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.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;
        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.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
 #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;
 
 {
        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) {
                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 '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 *));
                        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;
                                write_bw_log = 1;
                                idx++;
                                break;
-                       case 'O':
+                       case 'o':
                                f_out = fopen(optarg, "w+");
                                if (!f_out) {
                                        perror("fopen output");
                                f_out = fopen(optarg, "w+");
                                if (!f_out) {
                                        perror("fopen output");