From b3d62a759a58bfce1822787874ea6ec8d2a0cb7f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 20 Mar 2007 14:23:26 +0100 Subject: [PATCH 1/1] 'new_group' option 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 --- HOWTO | 8 +++++++- fio.h | 1 + init.c | 8 ++------ options.c | 6 ++++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/HOWTO b/HOWTO index 8e873ea5..d8c09d07 100644 --- 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 bd78e85b..a2be6d57 100644 --- 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 23fe8dc6..b4b4abe2 100644 --- 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); diff --git a/options.c b/options.c index e7356f65..242a1107 100644 --- 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, -- 2.25.1