target: fixes latency-probe
authorJens Axboe <axboe@kernel.dk>
Wed, 24 Oct 2018 21:43:29 +0000 (15:43 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Oct 2018 21:43:29 +0000 (15:43 -0600)
1) Use parent for should_account(), if we have a parent
2) Only sum step stats if src has them, to prevent
   overwriting destination stats in the parent.
3) Pretty up the normal output a bit

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

diff --git a/io_u.c b/io_u.c
index e1ac2097b051a1f658b692f8aaf40d38928e0919..0c5bbad889b4a79cee78a30b9a6c63962c242fbf 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1752,6 +1752,9 @@ static void file_log_write_comp(const struct thread_data *td, struct fio_file *f
 
 static bool should_account(struct thread_data *td)
 {
+       if (td->parent)
+               td = td->parent;
+
        return lat_step_account(td) && ramp_time_over(td) &&
                (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING);
 }
diff --git a/stat.c b/stat.c
index 26125fad6908b5d5291c239a6daed84d3ae9bbf6..13e7ff2519c6c700d80d4cd07ff43b5fc082c623 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1717,8 +1717,11 @@ void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src,
        dst->total_complete += src->total_complete;
        dst->nr_zone_resets += src->nr_zone_resets;
 
-       for (l = 0; l < ARRAY_SIZE(dst->step_stats); l++)
+       for (l = 0; l < ARRAY_SIZE(dst->step_stats); l++) {
+               if (!__lat_ts_has_stats(src, l))
+                       continue;
                sum_lat_step_stats(&dst->step_stats[l], &src->step_stats[l], first);
+       }
 }
 
 void init_group_run_stat(struct group_run_stats *gs)
index d372ff1b91bd1668a6bd2f3b30f53255029e20d2..bc153008b2569e9de5320d493269535cb701eb87 100644 (file)
--- a/target.c
+++ b/target.c
@@ -296,7 +296,12 @@ void lat_step_report(struct thread_stat *ts, struct buf_output *out)
                        if (!ls->iops[j])
                                continue;
 
-                       __log_buf(out, "    %s: iops=%llu, lat=%.1f nsec\n",
+                       if (!j)
+                               __log_buf(out, "    [%2d] ", i);
+                       else
+                               __log_buf(out, "         ");
+
+                       __log_buf(out, "%5s: iops=%llu, lat=%.1f nsec\n",
                                        io_ddir_name(j),
                                        (unsigned long long) ls->iops[j],
                                        ls->avg[j].u.f);