X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gclient.c;h=d8dc62d28aca8f6645953ef06b146cccbe995287;hp=fe83382f32a7566f8e6199e010eae48390b09830;hb=refs%2Fheads%2Fmaster;hpb=1b5e13beb3acc2a08321ce687727e2cbbb3b954f diff --git a/gclient.c b/gclient.c index fe83382f..73f64b3b 100644 --- a/gclient.c +++ b/gclient.c @@ -48,7 +48,7 @@ static GtkActionEntry results_menu_items[] = { { "PrintFile", GTK_STOCK_PRINT, "Print", "P", NULL, G_CALLBACK(results_print) }, { "CloseFile", GTK_STOCK_CLOSE, "Close", "W", NULL, G_CALLBACK(results_close) }, }; -static gint results_nmenu_items = ARRAY_SIZE(results_menu_items); +static gint results_nmenu_items = FIO_ARRAY_SIZE(results_menu_items); static const gchar *results_ui_string = " \ \ @@ -292,7 +292,7 @@ static void gfio_thread_status_op(struct fio_client *client, if (sum_stat_clients == 1) return; - sum_thread_stats(&client_ts, &p->ts, sum_stat_nr == 1); + sum_thread_stats(&client_ts, &p->ts); sum_group_stats(&client_gs, &p->rs); client_ts.members++; @@ -553,12 +553,15 @@ static void gfio_quit_op(struct fio_client *client, struct fio_net_cmd *cmd) } static struct thread_options *gfio_client_add_job(struct gfio_client *gc, - struct thread_options_pack *top) + struct thread_options_pack *top, size_t top_sz) { struct gfio_client_options *gco; gco = calloc(1, sizeof(*gco)); - convert_thread_options_to_cpu(&gco->o, top); + if (convert_thread_options_to_cpu(&gco->o, top, top_sz)) { + dprint(FD_NET, "client: failed parsing add_job command\n"); + return NULL; + } INIT_FLIST_HEAD(&gco->list); flist_add_tail(&gco->list, &gc->o_list); gc->o_list_nr = 1; @@ -577,7 +580,10 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd) p->thread_number = le32_to_cpu(p->thread_number); p->groupid = le32_to_cpu(p->groupid); - o = gfio_client_add_job(gc, &p->top); + o = gfio_client_add_job(gc, &p->top, + cmd->pdu_len - offsetof(struct cmd_add_job_pdu, top)); + if (o == NULL) + return; gdk_threads_enter(); @@ -755,7 +761,7 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts) GtkListStore *model; int i; const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" }; - const int nr_labels = ARRAY_SIZE(labels); + const int nr_labels = FIO_ARRAY_SIZE(labels); GType types[nr_labels]; frame = gtk_frame_new("IO depths"); @@ -1155,21 +1161,18 @@ out: #define GFIO_CLAT 1 #define GFIO_SLAT 2 #define GFIO_LAT 4 -#define GFIO_HILAT 8 -#define GFIO_LOLAT 16 static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, struct group_run_stats *rs, struct thread_stat *ts, int ddir) { const char *ddir_label[3] = { "Read", "Write", "Trim" }; - const char *hilat, *lolat; GtkWidget *frame, *label, *box, *vbox, *main_vbox; - unsigned long long min[5], max[5]; + unsigned long long min[3], max[3]; unsigned long runt; unsigned long long bw, iops; unsigned int flags = 0; - double mean[5], dev[5]; + double mean[3], dev[3]; char *io_p, *io_palt, *bw_p, *bw_palt, *iops_p; char tmp[128]; int i2p; @@ -1268,14 +1271,6 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, flags |= GFIO_CLAT; if (calc_lat(&ts->lat_stat[ddir], &min[2], &max[2], &mean[2], &dev[2])) flags |= GFIO_LAT; - if (calc_lat(&ts->clat_high_prio_stat[ddir], &min[3], &max[3], &mean[3], &dev[3])) { - flags |= GFIO_HILAT; - if (calc_lat(&ts->clat_low_prio_stat[ddir], &min[4], &max[4], &mean[4], &dev[4])) - flags |= GFIO_LOLAT; - /* we only want to print low priority statistics if other IOs were - * submitted with the priority bit set - */ - } if (flags) { frame = gtk_frame_new("Latency"); @@ -1284,24 +1279,12 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, vbox = gtk_vbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(frame), vbox); - if (ts->lat_percentiles) { - hilat = "High priority total latency"; - lolat = "Low priority total latency"; - } else { - hilat = "High priority completion latency"; - lolat = "Low priority completion latency"; - } - if (flags & GFIO_SLAT) gfio_show_lat(vbox, "Submission latency", min[0], max[0], mean[0], dev[0]); if (flags & GFIO_CLAT) gfio_show_lat(vbox, "Completion latency", min[1], max[1], mean[1], dev[1]); if (flags & GFIO_LAT) gfio_show_lat(vbox, "Total latency", min[2], max[2], mean[2], dev[2]); - if (flags & GFIO_HILAT) - gfio_show_lat(vbox, hilat, min[3], max[3], mean[3], dev[3]); - if (flags & GFIO_LOLAT) - gfio_show_lat(vbox, lolat, min[4], max[4], mean[4], dev[4]); } if (ts->slat_percentiles && flags & GFIO_SLAT) @@ -1309,40 +1292,16 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, ts->io_u_plat[FIO_SLAT][ddir], ts->slat_stat[ddir].samples, "Submission"); - if (ts->clat_percentiles && flags & GFIO_CLAT) { + 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) { - if (flags & GFIO_HILAT) - gfio_show_clat_percentiles(gc, main_vbox, ts, ddir, - ts->io_u_plat_high_prio[ddir], - ts->clat_high_prio_stat[ddir].samples, - "High priority completion"); - if (flags & GFIO_LOLAT) - gfio_show_clat_percentiles(gc, main_vbox, ts, ddir, - ts->io_u_plat_low_prio[ddir], - ts->clat_low_prio_stat[ddir].samples, - "Low priority completion"); - } - } - if (ts->lat_percentiles && flags & GFIO_LAT) { + 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"); - if (flags & GFIO_HILAT) - gfio_show_clat_percentiles(gc, main_vbox, ts, ddir, - ts->io_u_plat_high_prio[ddir], - ts->clat_high_prio_stat[ddir].samples, - "High priority total"); - if (flags & GFIO_LOLAT) - gfio_show_clat_percentiles(gc, main_vbox, ts, ddir, - ts->io_u_plat_low_prio[ddir], - ts->clat_low_prio_stat[ddir].samples, - "Low priority total"); - } free(io_p); free(bw_p);