Default to terse version 3
authorJens Axboe <axboe@kernel.dk>
Fri, 14 Sep 2012 21:35:08 +0000 (23:35 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 Sep 2012 21:35:08 +0000 (23:35 +0200)
4 will include the trim output, and we'll augment that with json output
as well. To avoid breaking anyone who's using the git pulls for their
testing, we'll default to version 3 for now.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
README
init.c
stat.c

diff --git a/README b/README
index c629e2d..a135017 100644 (file)
--- a/README
+++ b/README
@@ -126,7 +126,7 @@ $ fio
        --bandwidth-log         Generate per-job bandwidth logs
        --minimal               Minimal (terse) output
        --version               Print version info and exit
-       --terse-version=type    Terse version output format (default 3, or 2).
+       --terse-version=type    Terse version output format (default 3, or 2 or 4).
        --help                  Print this page
        --cmdhelp=cmd           Print command help, "all" for all of them
        --enghelp=engine        Print ioengine help, or list available ioengines
diff --git a/init.c b/init.c
index 1840c8f..54ee1db 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1440,7 +1440,8 @@ int parse_cmd_line(int argc, char *argv[])
                        break;
                case 'V':
                        terse_version = atoi(optarg);
-                       if (!(terse_version == 2 || terse_version == 3)) {
+                       if (!(terse_version == 2 || terse_version == 3) ||
+                            (terse_version == 4)) {
                                log_err("fio: bad terse version format\n");
                                exit_val = 1;
                                do_exit++;
diff --git a/stat.c b/stat.c
index e29bf0c..4e00177 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -738,10 +738,8 @@ static void show_thread_status_terse_v2(struct thread_stat *ts,
        log_info("\n");
 }
 
-#define FIO_TERSE_VERSION      "3"
-
-static void show_thread_status_terse_v3(struct thread_stat *ts,
-                                       struct group_run_stats *rs)
+static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
+                                          struct group_run_stats *rs, int ver)
 {
        double io_u_dist[FIO_IO_U_MAP_NR];
        double io_u_lat_u[FIO_IO_U_LAT_U_NR];
@@ -750,14 +748,15 @@ static void show_thread_status_terse_v3(struct thread_stat *ts,
        int i;
 
        /* General Info */
-       log_info("%s;%s;%s;%d;%d", FIO_TERSE_VERSION, fio_version_string,
+       log_info("%s;%s;%s;%d;%d", ver, fio_version_string,
                                        ts->name, ts->groupid, ts->error);
        /* Log Read Status */
        show_ddir_status_terse(ts, rs, DDIR_READ);
        /* Log Write Status */
        show_ddir_status_terse(ts, rs, DDIR_WRITE);
        /* Log Trim Status */
-       show_ddir_status_terse(ts, rs, DDIR_TRIM);
+       if (ver == 4)
+               show_ddir_status_terse(ts, rs, DDIR_TRIM);
 
        /* CPU Usage */
        if (ts->total_run_time) {
@@ -809,8 +808,8 @@ static void show_thread_status_terse(struct thread_stat *ts,
 {
        if (terse_version == 2)
                show_thread_status_terse_v2(ts, rs);
-       else if (terse_version == 3)
-               show_thread_status_terse_v3(ts, rs);
+       else if (terse_version == 3 || terse_version == 4)
+               show_thread_status_terse_v3_v4(ts, rs, terse_version);
        else
                log_err("fio: bad terse version!? %d\n", terse_version);
 }