gfio: display slat, clat, and lat percentiles
authorVincent Fu <vincent.fu@wdc.com>
Tue, 21 Jan 2020 22:00:39 +0000 (17:00 -0500)
committerVincent Fu <vincent.fu@wdc.com>
Tue, 4 Feb 2020 15:14:04 +0000 (10:14 -0500)
Display in the results window slat, clat, and lat percentiles if they
were requested by the user.

Signed-off-by: Vincent Fu <vincent.fu@wdc.com>
gclient.c

index d8dc62d28aca8f6645953ef06b146cccbe995287..d2044f323f1b03703397bbe066eb36dd04ab1bca 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -1097,10 +1097,9 @@ static struct graph *setup_clat_graph(char *title, unsigned long long *ovals,
 
 static void gfio_show_clat_percentiles(struct gfio_client *gc,
                                       GtkWidget *vbox, struct thread_stat *ts,
-                                      int ddir)
+                                      int ddir, uint64_t *io_u_plat,
+                                      unsigned long long nr, const char *type)
 {
-       uint64_t *io_u_plat = ts->io_u_plat[ddir];
-       unsigned long long nr = ts->clat_stat[ddir].samples;
        fio_fp64_t *plist = ts->percentile_list;
        unsigned int len, scale_down;
        unsigned long long *ovals, minv, maxv;
@@ -1128,10 +1127,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc,
                base = "nsec";
         }
 
-       if (ts->clat_percentiles)
-               sprintf(tmp, "Completion percentiles (%s)", base);
-       else
-               sprintf(tmp, "Latency percentiles (%s)", base);
+       sprintf(tmp, "%s latency percentiles (%s)", type, base);
 
        tree_view = gfio_output_clat_percentiles(ovals, plist, len, base, scale_down);
        ge->clat_graph = setup_clat_graph(tmp, ovals, plist, len, 700.0, 300.0);
@@ -1285,8 +1281,21 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
                        gfio_show_lat(vbox, "Total latency", min[2], max[2], mean[2], dev[2]);
        }
 
-       if (ts->clat_percentiles)
-               gfio_show_clat_percentiles(gc, main_vbox, ts, ddir);
+       if (ts->slat_percentiles && flags & GFIO_SLAT)
+               gfio_show_clat_percentiles(gc, main_vbox, ts, ddir,
+                               ts->io_u_plat[FIO_SLAT][ddir],
+                               ts->slat_stat[ddir].samples,
+                               "Submission");
+       if (ts->clat_percentiles && flags & GFIO_CLAT)
+               gfio_show_clat_percentiles(gc, main_vbox, ts, ddir,
+                               ts->io_u_plat[FIO_CLAT][ddir],
+                               ts->clat_stat[ddir].samples,
+                               "Completion");
+       if (ts->lat_percentiles && flags & GFIO_LAT)
+               gfio_show_clat_percentiles(gc, main_vbox, ts, ddir,
+                               ts->io_u_plat[FIO_LAT][ddir],
+                               ts->lat_stat[ddir].samples,
+                               "Total");
 
        free(io_p);
        free(bw_p);