'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 <jens.axboe@oracle.com>
diff --git a/HOWTO b/HOWTO
index 8e873ea..d8c09d0 100644
--- a/HOWTO
+++ b/HOWTO
@@ -539,7 +539,13 @@
 
 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 bd78e85..a2be6d5 100644
--- a/fio.h
+++ b/fio.h
@@ -368,6 +368,7 @@
 	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 23fe8dc..b4b4abe 100644
--- a/init.c
+++ b/init.c
@@ -425,7 +425,8 @@
 	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 @@
 			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 e7356f6..242a110 100644
--- a/options.c
+++ b/options.c
@@ -753,6 +753,12 @@
 		.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,
 		.off1	= td_var_offset(use_thread),