'new_group' option
authorJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:23:26 +0000 (14:23 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 20 Mar 2007 13:23:26 +0000 (14:23 +0100)
By default, jobs in a file are part of the same reporting group
unless seperated by a stone wall or if they define a group by
themselves (numjobs=x is used). Inserting a 'new_group' parameter
in a job description, will mark the start of a new reporting group.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
HOWTO
fio.h
init.c
options.c

diff --git a/HOWTO b/HOWTO
index 8e873ea5117628b18089f86cfa0e38fbeb2a0ccd..d8c09d07aa40ddb4829c79a0a30b60a4f0c4b1f7 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -539,7 +539,13 @@ verify=str If writing to a file, fio can verify the file contents
 
 stonewall      Wait for preceeding jobs in the job file to exit, before
                starting this one. Can be used to insert serialization
-               points in the job file.
+               points in the job file. A stone wall also implies starting
+               a new reporting group.
+
+new_group      Start a new reporting group. If this option isn't given,
+               jobs in a file will be part of the same reporting group
+               unless seperated by a stone wall (or if it's a group
+               by itself, with the numjobs option).
 
 numjobs=int    Create the specified number of clones of this job. May be
                used to setup a larger number of threads/processes doing
diff --git a/fio.h b/fio.h
index bd78e85b6365702a293b40205139aeeff8ca5209..a2be6d578037b88c62b706aa4284630ef8b0821f 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -368,6 +368,7 @@ struct thread_options {
        enum fio_memtype mem_type;
 
        unsigned int stonewall;
+       unsigned int new_group;
        unsigned int numjobs;
        os_cpu_mask_t cpumask;
        unsigned int iolog;
diff --git a/init.c b/init.c
index 23fe8dc69e2bfb820e9de322919bd315eac9249a..b4b4abe2a8d3119edd30de60b7ab15c57ffe2a7c 100644 (file)
--- a/init.c
+++ b/init.c
@@ -425,7 +425,8 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
        td->ts.slat_stat[0].min_val = td->ts.slat_stat[1].min_val = ULONG_MAX;
        td->ts.bw_stat[0].min_val = td->ts.bw_stat[1].min_val = ULONG_MAX;
 
-       if ((td->o.stonewall || td->o.numjobs > 1) && prev_group_jobs) {
+       if ((td->o.stonewall || td->o.numjobs > 1 || td->o.new_group)
+            && prev_group_jobs) {
                prev_group_jobs = 0;
                groupid++;
        }
@@ -498,11 +499,6 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
                        goto err;
        }
 
-       if (td->o.numjobs > 1) {
-               groupid++;
-               prev_group_jobs = 0;
-       }
-
        return 0;
 err:
        put_job(td);
index e7356f65206ffbd0fd8cb491703b2c748b698c9f..242a110720e9586b9a86840988a6ed4182387d16 100644 (file)
--- a/options.c
+++ b/options.c
@@ -752,6 +752,12 @@ static struct fio_option options[] = {
                .off1   = td_var_offset(stonewall),
                .help   = "Insert a hard barrier between this job and previous",
        },
+       {
+               .name   = "new_group",
+               .type   = FIO_OPT_STR_SET,
+               .off1   = td_var_offset(new_group),
+               .help   = "Mark the start of a new group (for reporting)",
+       },
        {
                .name   = "thread",
                .type   = FIO_OPT_STR_SET,