Include 'numjobs' in global options output
authorJens Axboe <axboe@kernel.dk>
Thu, 8 Feb 2018 22:46:46 +0000 (15:46 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Feb 2018 22:46:46 +0000 (15:46 -0700)
Fixes: https://github.com/axboe/fio/issues/237
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index a980a1d2819b356647e8ae6bb131e17f92940339..bd2c27d0ec75abfa0de5e1b017ec9aa7fe68d23e 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1226,7 +1226,7 @@ static void show_thread_status_terse_all(struct thread_stat *ts,
 }
 
 static void json_add_job_opts(struct json_object *root, const char *name,
-                             struct flist_head *opt_list, bool num_jobs)
+                             struct flist_head *opt_list)
 {
        struct json_object *dir_object;
        struct flist_head *entry;
@@ -1242,8 +1242,6 @@ static void json_add_job_opts(struct json_object *root, const char *name,
                const char *pos = "";
 
                p = flist_entry(entry, struct print_option, list);
-               if (!num_jobs && !strcmp(p->name, "numjobs"))
-                       continue;
                if (p->value)
                        pos = p->value;
                json_object_add_value_string(dir_object, p->name, pos);
@@ -1277,7 +1275,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
        }
 
        if (opt_list)
-               json_add_job_opts(root, "job options", opt_list, true);
+               json_add_job_opts(root, "job options", opt_list);
 
        add_ddir_status_json(ts, rs, DDIR_READ, root);
        add_ddir_status_json(ts, rs, DDIR_WRITE, root);
@@ -1878,7 +1876,7 @@ void __show_run_stats(void)
                json_object_add_value_int(root, "timestamp_ms", ms_since_epoch);
                json_object_add_value_string(root, "time", time_buf);
                global = get_global_options();
-               json_add_job_opts(root, "global options", &global->opt_list, false);
+               json_add_job_opts(root, "global options", &global->opt_list);
                array = json_create_array();
                json_object_add_value_array(root, "jobs", array);
        }