X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gclient.c;h=451d81c05a2a8829aa20ba28a520798e9e8542c0;hp=e2fbfac42873c50ea12d95c7d9b156faef8f9a7a;hb=0fcf445c034a8b4ad0f4181870283e6e11825160;hpb=fff30f40227716f2390ccac9010d9913e14fdca0 diff --git a/gclient.c b/gclient.c index e2fbfac4..451d81c0 100644 --- a/gclient.c +++ b/gclient.c @@ -12,6 +12,8 @@ #include "gerror.h" #include "graph.h" #include "gclient.h" +#include "printing.h" +#include "lib/pow2.h" static void gfio_display_ts(struct fio_client *client, struct thread_stat *ts, struct group_run_stats *rs); @@ -33,9 +35,17 @@ static void results_close(GtkWidget *w, gpointer *data) gtk_widget_destroy(ge->results_window); } +static void results_print(GtkWidget *w, gpointer *data) +{ + struct gui_entry *ge = (struct gui_entry *) data; + + gfio_print_results(ge); +} + static GtkActionEntry results_menu_items[] = { { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL}, { "GraphMenuAction", GTK_STOCK_FILE, "Graph", NULL, NULL, NULL}, + { "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 = sizeof(results_menu_items) / sizeof(results_menu_items[0]); @@ -44,6 +54,7 @@ static const gchar *results_ui_string = " \ \ \ \ + \ \ \ \ @@ -122,7 +133,7 @@ static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd) gtk_list_store_append(ui->log_model, &iter); gtk_list_store_set(ui->log_model, &iter, 0, timebuf, -1); gtk_list_store_set(ui->log_model, &iter, 1, client->hostname, -1); - gtk_list_store_set(ui->log_model, &iter, 2, p->level, -1); + gtk_list_store_set(ui->log_model, &iter, 2, log_get_level(p->level), -1); gtk_list_store_set(ui->log_model, &iter, 3, p->buf, -1); if (p->level == FIO_LOG_ERR) @@ -185,39 +196,39 @@ static int __gfio_disk_util_show(GtkWidget *res_notebook, vbox = gtk_hbox_new(TRUE, 3); gtk_container_add(GTK_CONTAINER(frame), vbox); entry = new_info_entry_in_frame(vbox, "IOs"); - entry_set_int_value(entry, p->dus.ios[0]); + entry_set_int_value(entry, p->dus.s.ios[0]); entry = new_info_entry_in_frame(vbox, "Merges"); - entry_set_int_value(entry, p->dus.merges[0]); + entry_set_int_value(entry, p->dus.s.merges[0]); entry = new_info_entry_in_frame(vbox, "Sectors"); - entry_set_int_value(entry, p->dus.sectors[0]); + entry_set_int_value(entry, p->dus.s.sectors[0]); entry = new_info_entry_in_frame(vbox, "Ticks"); - entry_set_int_value(entry, p->dus.ticks[0]); + entry_set_int_value(entry, p->dus.s.ticks[0]); frame = gtk_frame_new("Write"); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 2); vbox = gtk_hbox_new(TRUE, 3); gtk_container_add(GTK_CONTAINER(frame), vbox); entry = new_info_entry_in_frame(vbox, "IOs"); - entry_set_int_value(entry, p->dus.ios[1]); + entry_set_int_value(entry, p->dus.s.ios[1]); entry = new_info_entry_in_frame(vbox, "Merges"); - entry_set_int_value(entry, p->dus.merges[1]); + entry_set_int_value(entry, p->dus.s.merges[1]); entry = new_info_entry_in_frame(vbox, "Sectors"); - entry_set_int_value(entry, p->dus.sectors[1]); + entry_set_int_value(entry, p->dus.s.sectors[1]); entry = new_info_entry_in_frame(vbox, "Ticks"); - entry_set_int_value(entry, p->dus.ticks[1]); + entry_set_int_value(entry, p->dus.s.ticks[1]); frame = gtk_frame_new("Shared"); gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 2); vbox = gtk_hbox_new(TRUE, 3); gtk_container_add(GTK_CONTAINER(frame), vbox); entry = new_info_entry_in_frame(vbox, "IO ticks"); - entry_set_int_value(entry, p->dus.io_ticks); + entry_set_int_value(entry, p->dus.s.io_ticks); entry = new_info_entry_in_frame(vbox, "Time in queue"); - entry_set_int_value(entry, p->dus.time_in_queue); + entry_set_int_value(entry, p->dus.s.time_in_queue); util = 0.0; - if (p->dus.msec) - util = (double) 100 * p->dus.io_ticks / (double) p->dus.msec; + if (p->dus.s.msec) + util = (double) 100 * p->dus.s.io_ticks / (double) p->dus.s.msec; if (util > 100.0) util = 100.0; @@ -269,10 +280,6 @@ static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd gdk_threads_leave(); } -extern int sum_stat_clients; -extern struct thread_stat client_ts; -extern struct group_run_stats client_gs; - static int sum_stat_nr; static void gfio_thread_status_op(struct fio_client *client, @@ -285,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); + sum_thread_stats(&client_ts, &p->ts, sum_stat_nr == 1); sum_group_stats(&client_gs, &p->rs); client_ts.members++; @@ -357,29 +364,10 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j sprintf(tmp, "%u", je->files_open); gtk_entry_set_text(GTK_ENTRY(ge->eta.files), tmp); -#if 0 - if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) { - if (je->m_rate || je->t_rate) { - char *tr, *mr; - - mr = num2str(je->m_rate, 4, 0, i2p); - tr = num2str(je->t_rate, 4, 0, i2p); - gtk_entry_set_text(GTK_ENTRY(ge->eta); - p += sprintf(p, ", CR=%s/%s KB/s", tr, mr); - free(tr); - free(mr); - } else if (je->m_iops || je->t_iops) - p += sprintf(p, ", CR=%d/%d IOPS", je->t_iops, je->m_iops); - - gtk_entry_set_text(GTK_ENTRY(ge->eta.cr_bw), "---"); - gtk_entry_set_text(GTK_ENTRY(ge->eta.cr_iops), "---"); - gtk_entry_set_text(GTK_ENTRY(ge->eta.cw_bw), "---"); - gtk_entry_set_text(GTK_ENTRY(ge->eta.cw_iops), "---"); -#endif - if (je->eta_sec != INT_MAX && je->nr_running) { - char *iops_str[2]; - char *rate_str[2]; + char *iops_str[DDIR_RWDIR_CNT]; + char *rate_str[DDIR_RWDIR_CNT]; + int i; if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running) strcpy(output, "-.-% done"); @@ -389,26 +377,32 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j sprintf(output, "%3.1f%% done", perc); } - rate_str[0] = num2str(je->rate[0], 5, 10, i2p); - rate_str[1] = num2str(je->rate[1], 5, 10, i2p); + rate_str[0] = num2str(je->rate[0], 5, 10, i2p, 0); + rate_str[1] = num2str(je->rate[1], 5, 10, i2p, 0); + rate_str[2] = num2str(je->rate[2], 5, 10, i2p, 0); - iops_str[0] = num2str(je->iops[0], 4, 1, 0); - iops_str[1] = num2str(je->iops[1], 4, 1, 0); + iops_str[0] = num2str(je->iops[0], 4, 1, 0, 0); + iops_str[1] = num2str(je->iops[1], 4, 1, 0, 0); + iops_str[2] = num2str(je->iops[2], 4, 1, 0, 0); gtk_entry_set_text(GTK_ENTRY(ge->eta.read_bw), rate_str[0]); gtk_entry_set_text(GTK_ENTRY(ge->eta.read_iops), iops_str[0]); gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), rate_str[1]); gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), iops_str[1]); - - graph_add_xy_data(ge->graphs.iops_graph, "Read IOPS", je->elapsed_sec, je->iops[0], iops_str[0]); - graph_add_xy_data(ge->graphs.iops_graph, "Write IOPS", je->elapsed_sec, je->iops[1], iops_str[1]); - graph_add_xy_data(ge->graphs.bandwidth_graph, "Read Bandwidth", je->elapsed_sec, je->rate[0], rate_str[0]); - graph_add_xy_data(ge->graphs.bandwidth_graph, "Write Bandwidth", je->elapsed_sec, je->rate[1], rate_str[1]); - - free(rate_str[0]); - free(rate_str[1]); - free(iops_str[0]); - free(iops_str[1]); + gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_bw), rate_str[2]); + gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_iops), iops_str[2]); + + graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]); + graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]); + graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.trim_iops, je->elapsed_sec, je->iops[2], iops_str[2]); + graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]); + graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]); + graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.trim_bw, je->elapsed_sec, je->rate[2], rate_str[2]); + + for (i = 0; i < DDIR_RWDIR_CNT; i++) { + free(rate_str[i]); + free(iops_str[i]); + } } if (eta_str[0]) { @@ -416,7 +410,7 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j sprintf(dst, " - %s", eta_str); } - + gfio_update_thread_status(ge, output, perc); gdk_threads_leave(); } @@ -431,7 +425,7 @@ static void gfio_update_all_eta(struct jobs_eta *je) char eta_str[128]; char output[256]; double perc = 0.0; - int i2p = 0; + int i, i2p = 0; gdk_threads_enter(); @@ -443,31 +437,11 @@ static void gfio_update_all_eta(struct jobs_eta *je) eta_to_str(eta_str, je->eta_sec); } -#if 0 - if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) { - if (je->m_rate || je->t_rate) { - char *tr, *mr; - - mr = num2str(je->m_rate, 4, 0, i2p); - tr = num2str(je->t_rate, 4, 0, i2p); - gtk_entry_set_text(GTK_ENTRY(ui->eta); - p += sprintf(p, ", CR=%s/%s KB/s", tr, mr); - free(tr); - free(mr); - } else if (je->m_iops || je->t_iops) - p += sprintf(p, ", CR=%d/%d IOPS", je->t_iops, je->m_iops); - - gtk_entry_set_text(GTK_ENTRY(ui->eta.cr_bw), "---"); - gtk_entry_set_text(GTK_ENTRY(ui->eta.cr_iops), "---"); - gtk_entry_set_text(GTK_ENTRY(ui->eta.cw_bw), "---"); - gtk_entry_set_text(GTK_ENTRY(ui->eta.cw_iops), "---"); -#endif - entry_set_int_value(ui->eta.jobs, je->nr_running); if (je->eta_sec != INT_MAX && je->nr_running) { - char *iops_str[2]; - char *rate_str[2]; + char *iops_str[3]; + char *rate_str[3]; if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running) strcpy(output, "-.-% done"); @@ -477,26 +451,32 @@ static void gfio_update_all_eta(struct jobs_eta *je) sprintf(output, "%3.1f%% done", perc); } - rate_str[0] = num2str(je->rate[0], 5, 10, i2p); - rate_str[1] = num2str(je->rate[1], 5, 10, i2p); + rate_str[0] = num2str(je->rate[0], 5, 10, i2p, 0); + rate_str[1] = num2str(je->rate[1], 5, 10, i2p, 0); + rate_str[2] = num2str(je->rate[2], 5, 10, i2p, 0); - iops_str[0] = num2str(je->iops[0], 4, 1, 0); - iops_str[1] = num2str(je->iops[1], 4, 1, 0); + iops_str[0] = num2str(je->iops[0], 4, 1, 0, 0); + iops_str[1] = num2str(je->iops[1], 4, 1, 0, 0); + iops_str[2] = num2str(je->iops[2], 4, 1, 0, 0); gtk_entry_set_text(GTK_ENTRY(ui->eta.read_bw), rate_str[0]); gtk_entry_set_text(GTK_ENTRY(ui->eta.read_iops), iops_str[0]); gtk_entry_set_text(GTK_ENTRY(ui->eta.write_bw), rate_str[1]); gtk_entry_set_text(GTK_ENTRY(ui->eta.write_iops), iops_str[1]); - - graph_add_xy_data(ui->graphs.iops_graph, "Read IOPS", je->elapsed_sec, je->iops[0], iops_str[0]); - graph_add_xy_data(ui->graphs.iops_graph, "Write IOPS", je->elapsed_sec, je->iops[1], iops_str[1]); - graph_add_xy_data(ui->graphs.bandwidth_graph, "Read Bandwidth", je->elapsed_sec, je->rate[0], rate_str[0]); - graph_add_xy_data(ui->graphs.bandwidth_graph, "Write Bandwidth", je->elapsed_sec, je->rate[1], rate_str[1]); - - free(rate_str[0]); - free(rate_str[1]); - free(iops_str[0]); - free(iops_str[1]); + gtk_entry_set_text(GTK_ENTRY(ui->eta.trim_bw), rate_str[2]); + gtk_entry_set_text(GTK_ENTRY(ui->eta.trim_iops), iops_str[2]); + + graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]); + graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]); + graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.trim_iops, je->elapsed_sec, je->iops[2], iops_str[2]); + graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]); + graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]); + graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.trim_bw, je->elapsed_sec, je->rate[2], rate_str[2]); + + for (i = 0; i < DDIR_RWDIR_CNT; i++) { + free(rate_str[i]); + free(iops_str[i]); + } } if (eta_str[0]) { @@ -504,18 +484,17 @@ static void gfio_update_all_eta(struct jobs_eta *je) sprintf(dst, " - %s", eta_str); } - + gfio_update_thread_status_all(ui, output, perc); gdk_threads_leave(); } static void gfio_probe_op(struct fio_client *client, struct fio_net_cmd *cmd) { - struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload; + struct cmd_probe_reply_pdu *probe = (struct cmd_probe_reply_pdu *) cmd->payload; struct gfio_client *gc = client->client_data; struct gui_entry *ge = gc->ge; const char *os, *arch; - char buf[64]; os = fio_get_os_string(probe->os); if (!os) @@ -528,13 +507,15 @@ static void gfio_probe_op(struct fio_client *client, struct fio_net_cmd *cmd) if (!client->name) client->name = strdup((char *) probe->hostname); + gc->client_cpus = le32_to_cpu(probe->cpus); + gc->client_flags = le64_to_cpu(probe->flags); + gdk_threads_enter(); gtk_label_set_text(GTK_LABEL(ge->probe.hostname), (char *) probe->hostname); gtk_label_set_text(GTK_LABEL(ge->probe.os), os); gtk_label_set_text(GTK_LABEL(ge->probe.arch), arch); - sprintf(buf, "%u.%u.%u", probe->fio_major, probe->fio_minor, probe->fio_patch); - gtk_label_set_text(GTK_LABEL(ge->probe.fio_ver), buf); + gtk_label_set_text(GTK_LABEL(ge->probe.fio_ver), (char *) probe->fio_version); gfio_set_state(ge, GE_STATE_CONNECTED); @@ -550,22 +531,35 @@ static void gfio_quit_op(struct fio_client *client, struct fio_net_cmd *cmd) gdk_threads_leave(); } +static struct thread_options *gfio_client_add_job(struct gfio_client *gc, + struct thread_options_pack *top) +{ + struct gfio_client_options *gco; + + gco = calloc(1, sizeof(*gco)); + convert_thread_options_to_cpu(&gco->o, top); + INIT_FLIST_HEAD(&gco->list); + flist_add_tail(&gco->list, &gc->o_list); + gc->o_list_nr = 1; + return &gco->o; +} + static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd) { struct cmd_add_job_pdu *p = (struct cmd_add_job_pdu *) cmd->payload; struct gfio_client *gc = client->client_data; - struct thread_options *o = &gc->o; struct gui_entry *ge = gc->ge; + struct thread_options *o; char *c1, *c2, *c3, *c4; char tmp[80]; p->thread_number = le32_to_cpu(p->thread_number); p->groupid = le32_to_cpu(p->groupid); - convert_thread_options_to_cpu(o, &p->top); + o = gfio_client_add_job(gc, &p->top); gdk_threads_enter(); - gtk_combo_box_append_text(GTK_COMBO_BOX(ge->eta.names), (gchar *) o->name); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ge->eta.names), (gchar *) o->name); gtk_combo_box_set_active(GTK_COMBO_BOX(ge->eta.names), 0); sprintf(tmp, "%s %s", o->odirect ? "direct" : "buffered", ddir_str(o->td_ddir)); @@ -597,6 +591,16 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd) gdk_threads_leave(); } +static void gfio_update_job_op(struct fio_client *client, + struct fio_net_cmd *cmd) +{ + uint32_t *pdu_error = (uint32_t *) cmd->payload; + struct gfio_client *gc = client->client_data; + + gc->update_job_status = le32_to_cpu(*pdu_error); + gc->update_job_done = 1; +} + static void gfio_client_timed_out(struct fio_client *client) { struct gfio_client *gc = client->client_data; @@ -645,12 +649,6 @@ static void gfio_client_job_start(struct fio_client *client, struct fio_net_cmd gdk_threads_leave(); } -static void gfio_client_iolog(struct fio_client *client, struct cmd_iolog_pdu *pdu) -{ - printf("got iolog: name=%s, type=%u, entries=%u\n", pdu->name, pdu->log_type, pdu->nr_samples); - free(pdu); -} - static void gfio_add_total_depths_tree(GtkListStore *model, struct thread_stat *ts, unsigned int len) { @@ -660,7 +658,7 @@ static void gfio_add_total_depths_tree(GtkListStore *model, const int add_mask = 0x17e; int i, j; - stat_calc_dist(ts->io_u_map, ts_total_io_u(ts), io_u_dist); + stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist); gtk_list_store_append(model, &iter); @@ -763,7 +761,7 @@ static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts) gfio_add_sc_depths_tree(model, ts, nr_labels, 1); gfio_add_sc_depths_tree(model, ts, nr_labels, 0); - gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, FALSE, 3); + gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, TRUE, 3); } static void gfio_show_cpu_usage(GtkWidget *vbox, struct thread_stat *ts) @@ -865,8 +863,10 @@ static struct graph *setup_lat_bucket_graph(const char *title, double *lat, graph_y_title(g, "Percent"); for (i = 0; i < len; i++) { - graph_add_label(g, labels[i]); - graph_add_data(g, labels[i], lat[i]); + graph_label_t l; + + l = graph_add_label(g, labels[i]); + graph_add_data(g, l, lat[i]); } return g; @@ -877,7 +877,7 @@ static int on_expose_lat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p) struct graph *g = p; cairo_t *cr; - cr = gdk_cairo_create(w->window); + cr = gdk_cairo_create(gtk_widget_get_window(w)); #if 0 if (graph_has_tooltips(g)) { g_object_set(w, "has-tooltip", TRUE, NULL); @@ -894,10 +894,12 @@ static int on_expose_lat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p) static gint on_config_lat_drawing_area(GtkWidget *w, GdkEventConfigure *event, gpointer data) { + guint width = gtk_widget_get_allocated_width(w); + guint height = gtk_widget_get_allocated_height(w); struct graph *g = data; - graph_set_size(g, w->allocation.width, w->allocation.height); - graph_set_size(g, w->allocation.width, w->allocation.height); + graph_set_size(g, width, height); + graph_set_size(g, width, height); graph_set_position(g, 0, 0); return TRUE; } @@ -936,7 +938,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox, */ if (start == -1U) return; - + tree_view = gfio_output_lat_buckets(&io_u_lat[start], &ranges[start], end - start + 1); ge->lat_bucket_graph = setup_lat_bucket_graph("Latency Buckets", &io_u_lat[start], &ranges[start], end - start + 1, 700.0, 300.0); @@ -952,10 +954,10 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox, gtk_widget_set_size_request(GTK_WIDGET(drawing_area), 700, 300); gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white); gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area); - g_signal_connect(G_OBJECT(drawing_area), "expose_event", G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph); - g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph); + g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph); + g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph); - gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3); + gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3); } static void gfio_show_lat(GtkWidget *vbox, const char *name, unsigned long min, @@ -966,11 +968,11 @@ static void gfio_show_lat(GtkWidget *vbox, const char *name, unsigned long min, char *minp, *maxp; char tmp[64]; - if (!usec_to_msec(&min, &max, &mean, &dev)) + if (usec_to_msec(&min, &max, &mean, &dev)) base = "(msec)"; - minp = num2str(min, 6, 1, 0); - maxp = num2str(max, 6, 1, 0); + minp = num2str(min, 6, 1, 0, 0); + maxp = num2str(max, 6, 1, 0, 0); sprintf(tmp, "%s %s", name, base); frame = gtk_frame_new(tmp); @@ -1053,11 +1055,12 @@ static struct graph *setup_clat_graph(char *title, unsigned int *ovals, graph_y_title(g, "Time"); for (i = 0; i < len; i++) { + graph_label_t l; char fbuf[8]; sprintf(fbuf, "%2.2f%%", plist[i].u.f); - graph_add_label(g, fbuf); - graph_add_data(g, fbuf, (double) ovals[i]); + l = graph_add_label(g, fbuf); + graph_add_data(g, l, (double) ovals[i]); } return g; @@ -1107,10 +1110,10 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc, gtk_widget_set_size_request(GTK_WIDGET(drawing_area), 700, 300); gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white); gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area); - g_signal_connect(G_OBJECT(drawing_area), "expose_event", G_CALLBACK(on_expose_lat_drawing_area), ge->clat_graph); + g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->clat_graph); g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->clat_graph); - gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3); + gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3); out: if (ovals) free(ovals); @@ -1124,7 +1127,7 @@ 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[2] = { "Read", "Write" }; + const char *ddir_label[3] = { "Read", "Write", "Trim" }; GtkWidget *frame, *label, *box, *vbox, *main_vbox; unsigned long min[3], max[3], runt; unsigned long long bw, iops; @@ -1140,17 +1143,17 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, runt = ts->runtime[ddir]; bw = (1000 * ts->io_bytes[ddir]) / runt; - io_p = num2str(ts->io_bytes[ddir], 6, 1, i2p); - bw_p = num2str(bw, 6, 1, i2p); + io_p = num2str(ts->io_bytes[ddir], 6, 1, i2p, 8); + bw_p = num2str(bw, 6, 1, i2p, ts->unit_base); iops = (1000 * (uint64_t)ts->total_io_u[ddir]) / runt; - iops_p = num2str(iops, 6, 1, 0); + iops_p = num2str(iops, 6, 1, 0, 0); box = gtk_hbox_new(FALSE, 3); gtk_box_pack_start(GTK_BOX(mbox), box, TRUE, FALSE, 3); frame = gtk_frame_new(ddir_label[ddir]); - gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); + gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 5); main_vbox = gtk_vbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(frame), main_vbox); @@ -1243,6 +1246,7 @@ static void __gfio_display_end_results(GtkWidget *win, struct gfio_client *gc, struct group_run_stats *rs) { GtkWidget *box, *vbox, *entry, *scroll; + int i; scroll = gtk_scrolled_window_new(NULL, NULL); gtk_container_set_border_width(GTK_CONTAINER(scroll), 5); @@ -1272,10 +1276,10 @@ static void __gfio_display_end_results(GtkWidget *win, struct gfio_client *gc, entry = new_info_entry_in_frame(box, "PID"); entry_set_int_value(entry, ts->pid); - if (ts->io_bytes[DDIR_READ]) - gfio_show_ddir_status(gc, vbox, rs, ts, DDIR_READ); - if (ts->io_bytes[DDIR_WRITE]) - gfio_show_ddir_status(gc, vbox, rs, ts, DDIR_WRITE); + for (i = 0; i < DDIR_RWDIR_CNT; i++) { + if (ts->io_bytes[i]) + gfio_show_ddir_status(gc, vbox, rs, ts, i); + } gfio_show_latency_buckets(gc, vbox, ts); gfio_show_cpu_usage(vbox, ts); @@ -1335,11 +1339,11 @@ struct client_ops gfio_client_ops = { .probe = gfio_probe_op, .quit = gfio_quit_op, .add_job = gfio_add_job_op, + .update_job = gfio_update_job_op, .timed_out = gfio_client_timed_out, .stop = gfio_client_stop, .start = gfio_client_start, .job_start = gfio_client_job_start, - .iolog = gfio_client_iolog, .removed = gfio_client_removed, .eta_msec = FIO_CLIENT_DEF_ETA_MSEC, .stay_connected = 1,