[PATCH] Add 'description' option
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 14:04:46 +0000 (15:04 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 14:04:46 +0000 (15:04 +0100)
Can help provide a textual description of a job, if it's submitted
to someone for run/review.

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

diff --git a/HOWTO b/HOWTO
index 198d70b5247229402e76c1d22d6b304b37cfffb5..f4ebac94348eef97b46b70b80dce8d1e3130dda4 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -193,6 +193,10 @@ name=str   ASCII name of the job. This may be used to override the
                special purpose of also signaling the start of a new
                job.
 
+description=str        Text description of the job. Doesn't do anything except
+               dump this text description when this job is run. It's
+               not parsed.
+
 directory=str  Prefix filenames with this directory. Used to places files
                in a different location than "./".
 
diff --git a/README b/README
index 2d5d499984db632eb4ab5e5b357418509c43bb29..be32af4ed76f08412fc83e2a0165b882020e8059 100644 (file)
--- a/README
+++ b/README
@@ -80,6 +80,7 @@ is in the ini style format, as it's easy to read and write for the user.
 The job file parameters are:
 
        name=x          Use 'x' as the identifier for this job.
+       description=x   'x' is a text description of the job.
        directory=x     Use 'x' as the top level directory for storing files
        filename=x      Force the use of 'x' as the filename for all files
                        in this thread. If not given, fio will make up
diff --git a/fio.h b/fio.h
index 6e0c5b18cb8fefef632396431164fc3633554491..c6fb6a11d70b8eb582b3f9ab0262bbe5829e6617 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -176,6 +176,7 @@ struct fio_file {
  * This describes a single thread/process executing a fio job.
  */
 struct thread_data {
+       char *description;
        char *name;
        char *directory;
        char *filename;
diff --git a/init.c b/init.c
index 365a8b2cc0a97651eaf5cad0fd6e7f5db089d43f..32e22dbe87470360b62b31220be87ccaad5b8f3a 100644 (file)
--- a/init.c
+++ b/init.c
@@ -41,6 +41,12 @@ static int str_cpumask_cb(void *, unsigned int *);
  * Map of job/command line options
  */
 static struct fio_option options[] = {
+       {
+               .name   = "description",
+               .type   = FIO_OPT_STR_STORE,
+               .off1   = td_var_offset(description),
+               .help   = "Text job description",
+       },
        {
                .name   = "name",
                .type   = FIO_OPT_STR_STORE,
diff --git a/stat.c b/stat.c
index 636955e25c7d6d175db84bfb5c0beae117aa82cd..8ea1b8ad7844c76ca822fd6bddef9753668ce717 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -409,6 +409,9 @@ static void show_thread_status(struct thread_data *td,
        }
 
        fprintf(f_out, "  IO depths    : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%, 16=%3.1f%%, 32=%3.1f%%, >=64=%3.1f%%\n", io_u_dist[0], io_u_dist[1], io_u_dist[2], io_u_dist[3], io_u_dist[4], io_u_dist[5], io_u_dist[6]);
+
+       if (td->description)
+               fprintf(f_out, "%s\n", td->description);
 }
 
 static void show_ddir_status_terse(struct thread_data *td,