X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gfio.c;h=bbeb229996272aa079c11d26856fda7f78600588;hp=9837c1c8d3f2d79e7e209032bee69bea43f7bb6e;hb=f0602d785d18498ff7c432c6d2c45fbcda329c84;hpb=781ccba635f4709bb580b3fac3b28c52a157275c diff --git a/gfio.c b/gfio.c index 9837c1c8..bbeb2299 100644 --- a/gfio.c +++ b/gfio.c @@ -52,16 +52,16 @@ static void send_clicked(GtkWidget *widget, gpointer data); static struct button_spec { const char *buttontext; clickfunction f; - const char *tooltiptext; - const int start_insensitive; + const char *tooltiptext[2]; + const int start_sensitive; } buttonspeclist[] = { #define CONNECT_BUTTON 0 #define SEND_BUTTON 1 #define START_JOB_BUTTON 2 - { "Connect", connect_clicked, "Connect to host", 0 }, - { "Send", send_clicked, "Send job description to host", 1 }, + { "Connect", connect_clicked, { "Disconnect from host", "Connect to host" }, 1 }, + { "Send", send_clicked, { "Send job description to host", NULL }, 0 }, { "Start Job", start_job_clicked, - "Start the current job on the server", 1 }, + { "Start the current job on the server", NULL }, 0 }, }; struct probe_widget { @@ -157,11 +157,11 @@ struct gui_entry { GtkWidget *notebook; GtkWidget *error_info_bar; GtkWidget *error_label; - GtkWidget *results_notebook; GtkWidget *results_window; + GtkWidget *results_notebook; GtkUIManager *results_uimanager; - GtkWidget *results_vbox; GtkWidget *results_menu; + GtkWidget *disk_util_vbox; GtkListStore *log_model; GtkWidget *log_tree; GtkWidget *log_view; @@ -172,10 +172,12 @@ struct gui_entry { gint page_num; unsigned int state; + struct graph *clat_graph; + struct graph *lat_bucket_graph; + struct gfio_client *client; int nr_job_files; char **job_files; - struct graph *clat_graph; }; struct end_results { @@ -186,14 +188,14 @@ struct end_results { struct gfio_client { struct gui_entry *ge; struct fio_client *client; - GtkWidget *results_widget; - GtkWidget *disk_util_frame; GtkWidget *err_entry; - unsigned int job_added; struct thread_options o; struct end_results *results; unsigned int nr_results; + + struct cmd_du_pdu *du; + unsigned int nr_du; }; static void gfio_update_thread_status(struct gui_entry *ge, char *status_message, double perc); @@ -430,6 +432,39 @@ static void set_view_results_visible(struct gui *ui, int visible) set_menu_entry_visible(ui, "/MainMenu/ViewMenu/Results", visible); } +static const char *get_button_tooltip(struct button_spec *s, int sensitive) +{ + if (s->tooltiptext[sensitive]) + return s->tooltiptext[sensitive]; + + return s->tooltiptext[0]; +} + +static GtkWidget *add_button(GtkWidget *buttonbox, + struct button_spec *buttonspec, gpointer data) +{ + GtkWidget *button = gtk_button_new_with_label(buttonspec->buttontext); + gboolean sens = buttonspec->start_sensitive; + + g_signal_connect(button, "clicked", G_CALLBACK(buttonspec->f), data); + gtk_box_pack_start(GTK_BOX(buttonbox), button, FALSE, FALSE, 3); + + sens = buttonspec->start_sensitive; + gtk_widget_set_tooltip_text(button, get_button_tooltip(buttonspec, sens)); + gtk_widget_set_sensitive(button, sens); + + return button; +} + +static void add_buttons(struct gui_entry *ge, struct button_spec *buttonlist, + int nbuttons) +{ + int i; + + for (i = 0; i < nbuttons; i++) + ge->button[i] = add_button(ge->buttonbox, &buttonlist[i], ge); +} + /* * Update sensitivity of job buttons and job menu items, based on the * state of the client. @@ -496,6 +531,7 @@ static void update_button_states(struct gui *ui, struct gui_entry *ge) gtk_widget_set_sensitive(ge->button[SEND_BUTTON], send_state); gtk_widget_set_sensitive(ge->button[START_JOB_BUTTON], start_state); gtk_button_set_label(GTK_BUTTON(ge->button[CONNECT_BUTTON]), connect_str); + gtk_widget_set_tooltip_text(ge->button[CONNECT_BUTTON], get_button_tooltip(&buttonspeclist[CONNECT_BUTTON], connect_state)); set_menu_entry_visible(ui, "/MainMenu/JobMenu/Connect", connect_state); set_menu_entry_text(ui, "/MainMenu/JobMenu/Connect", connect_str); @@ -654,7 +690,7 @@ static GtkWidget *gfio_output_clat_percentiles(unsigned int *ovals, return tree_view; } -static int on_expose_clat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p) +static int on_expose_lat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p) { struct graph *g = p; cairo_t *cr; @@ -673,8 +709,8 @@ static int on_expose_clat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p return FALSE; } -static gint on_config_clat_drawing_area(GtkWidget *w, GdkEventConfigure *event, - gpointer data) +static gint on_config_lat_drawing_area(GtkWidget *w, GdkEventConfigure *event, + gpointer data) { struct graph *g = data; @@ -694,6 +730,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc, unsigned int *ovals, len, minv, maxv, scale_down; const char *base; GtkWidget *tree_view, *frame, *hbox, *drawing_area, *completion_vbox; + struct gui_entry *ge = gc->ge; char tmp[64]; len = calc_clat_percentiles(io_u_plat, nr, plist, &ovals, &maxv, &minv); @@ -714,7 +751,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc, sprintf(tmp, "Completion percentiles (%s)", base); tree_view = gfio_output_clat_percentiles(ovals, plist, len, base, scale_down); - gc->ge->clat_graph = setup_clat_graph(tmp, ovals, plist, len, 700.0, 300.0); + ge->clat_graph = setup_clat_graph(tmp, ovals, plist, len, 700.0, 300.0); frame = gtk_frame_new(tmp); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5); @@ -727,10 +764,8 @@ 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, &white); gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area); - g_signal_connect(G_OBJECT(drawing_area), "expose_event", - G_CALLBACK(on_expose_clat_drawing_area), gc->ge->clat_graph); - g_signal_connect(G_OBJECT(drawing_area), "configure_event", - G_CALLBACK(on_config_clat_drawing_area), gc->ge->clat_graph); + 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), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->clat_graph); gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3); out: @@ -892,31 +927,40 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox, if (ts->clat_percentiles) gfio_show_clat_percentiles(gc, main_vbox, ts, ddir); - free(io_p); free(bw_p); free(iops_p); } -static GtkWidget *gfio_output_lat_buckets(double *lat, unsigned int num, - const char **labels) +static struct graph *setup_lat_bucket_graph(const char *title, double *lat, + const char **labels, + unsigned int len, + double xdim, double ydim) +{ + struct graph *g; + int i; + + g = graph_new(xdim, ydim, gfio_graph_font); + graph_title(g, title); + graph_x_title(g, "Buckets"); + + for (i = 0; i < len; i++) { + graph_add_label(g, labels[i]); + graph_add_data(g, labels[i], lat[i]); + } + + return g; +} + +static GtkWidget *gfio_output_lat_buckets(double *lat, const char **labels, + int num) { GtkWidget *tree_view; GtkTreeSelection *selection; GtkListStore *model; GtkTreeIter iter; GType *types; - int i, skipped; - - /* - * Check if all are empty, in which case don't bother - */ - for (i = 0, skipped = 0; i < num; i++) - if (lat[i] <= 0.0) - skipped++; - - if (skipped == num) - return NULL; + int i; types = malloc(num * sizeof(GType)); @@ -955,39 +999,60 @@ static GtkWidget *gfio_output_lat_buckets(double *lat, unsigned int num, return tree_view; } -static void gfio_show_latency_buckets(GtkWidget *vbox, struct thread_stat *ts) +static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox, + struct thread_stat *ts) { - GtkWidget *box, *frame, *tree_view; - double io_u_lat_u[FIO_IO_U_LAT_U_NR]; - double io_u_lat_m[FIO_IO_U_LAT_M_NR]; - const char *uranges[] = { "2", "4", "10", "20", "50", "100", - "250", "500", "750", "1000", }; - const char *mranges[] = { "2", "4", "10", "20", "50", "100", - "250", "500", "750", "1000", "2000", - ">= 2000", }; + double io_u_lat[FIO_IO_U_LAT_U_NR + FIO_IO_U_LAT_M_NR]; + const char *ranges[] = { "2u", "4u", "10u", "20u", "50u", "100u", + "250u", "500u", "750u", "1m", "2m", + "4m", "10m", "20m", "50m", "100m", + "250m", "500m", "750m", "1s", "2s", ">= 2s" }; + int start, end, i; + const int total = FIO_IO_U_LAT_U_NR + FIO_IO_U_LAT_M_NR; + GtkWidget *frame, *tree_view, *hbox, *completion_vbox, *drawing_area; + struct gui_entry *ge = gc->ge; - stat_calc_lat_u(ts, io_u_lat_u); - stat_calc_lat_m(ts, io_u_lat_m); + stat_calc_lat_u(ts, io_u_lat); + stat_calc_lat_m(ts, &io_u_lat[FIO_IO_U_LAT_U_NR]); - tree_view = gfio_output_lat_buckets(io_u_lat_u, FIO_IO_U_LAT_U_NR, uranges); - if (tree_view) { - frame = gtk_frame_new("Latency buckets (usec)"); - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5); + /* + * Found out which first bucket has entries, and which last bucket + */ + start = end = -1U; + for (i = 0; i < total; i++) { + if (io_u_lat[i] == 0.00) + continue; - box = gtk_hbox_new(FALSE, 3); - gtk_container_add(GTK_CONTAINER(frame), box); - gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, FALSE, 3); + if (start == -1U) + start = i; + end = i; } - tree_view = gfio_output_lat_buckets(io_u_lat_m, FIO_IO_U_LAT_M_NR, mranges); - if (tree_view) { - frame = gtk_frame_new("Latency buckets (msec)"); - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5); + /* + * No entries... + */ + 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); - box = gtk_hbox_new(FALSE, 3); - gtk_container_add(GTK_CONTAINER(frame), box); - gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, FALSE, 3); - } + frame = gtk_frame_new("Latency buckets"); + gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5); + + completion_vbox = gtk_vbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(frame), completion_vbox); + hbox = gtk_hbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(completion_vbox), hbox); + + drawing_area = gtk_drawing_area_new(); + gtk_widget_set_size_request(GTK_WIDGET(drawing_area), 700, 300); + gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &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); + + gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, FALSE, 3); } static void gfio_show_cpu_usage(GtkWidget *vbox, struct thread_stat *ts) @@ -1216,6 +1281,136 @@ static GtkWidget *get_results_window(struct gui_entry *ge) return ge->results_notebook; } +static void disk_util_destroy(GtkWidget *w, gpointer data) +{ + struct gui_entry *ge = (struct gui_entry *) data; + + ge->disk_util_vbox = NULL; + gtk_widget_destroy(w); +} + +static GtkWidget *get_scrolled_window(gint border_width) +{ + GtkWidget *scroll; + + scroll = gtk_scrolled_window_new(NULL, NULL); + gtk_container_set_border_width(GTK_CONTAINER(scroll), border_width); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + return scroll; +} + +static GtkWidget *gfio_disk_util_get_vbox(struct gui_entry *ge) +{ + GtkWidget *vbox, *box, *scroll, *res_notebook; + + if (ge->disk_util_vbox) + return ge->disk_util_vbox; + + scroll = get_scrolled_window(5); + vbox = gtk_vbox_new(FALSE, 3); + box = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), box, TRUE, FALSE, 5); + + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), vbox); + res_notebook = get_results_window(ge); + + gtk_notebook_append_page(GTK_NOTEBOOK(res_notebook), scroll, gtk_label_new("Disk utilization")); + ge->disk_util_vbox = box; + g_signal_connect(vbox, "destroy", G_CALLBACK(disk_util_destroy), ge); + + return ge->disk_util_vbox; +} + +static int __gfio_disk_util_show(GtkWidget *res_notebook, + struct gfio_client *gc, struct cmd_du_pdu *p) +{ + GtkWidget *box, *frame, *entry, *vbox, *util_vbox; + struct gui_entry *ge = gc->ge; + double util; + char tmp[16]; + + util_vbox = gfio_disk_util_get_vbox(ge); + + vbox = gtk_vbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(util_vbox), vbox); + + frame = gtk_frame_new((char *) p->dus.name); + gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 2); + + box = gtk_vbox_new(FALSE, 3); + gtk_container_add(GTK_CONTAINER(frame), box); + + frame = gtk_frame_new("Read"); + 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[0]); + entry = new_info_entry_in_frame(vbox, "Merges"); + entry_set_int_value(entry, p->dus.merges[0]); + entry = new_info_entry_in_frame(vbox, "Sectors"); + entry_set_int_value(entry, p->dus.sectors[0]); + entry = new_info_entry_in_frame(vbox, "Ticks"); + entry_set_int_value(entry, p->dus.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 = new_info_entry_in_frame(vbox, "Merges"); + entry_set_int_value(entry, p->dus.merges[1]); + entry = new_info_entry_in_frame(vbox, "Sectors"); + entry_set_int_value(entry, p->dus.sectors[1]); + entry = new_info_entry_in_frame(vbox, "Ticks"); + entry_set_int_value(entry, p->dus.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 = new_info_entry_in_frame(vbox, "Time in queue"); + entry_set_int_value(entry, p->dus.time_in_queue); + + util = 0.0; + if (p->dus.msec) + util = (double) 100 * p->dus.io_ticks / (double) p->dus.msec; + if (util > 100.0) + util = 100.0; + + sprintf(tmp, "%3.2f%%", util); + entry = new_info_entry_in_frame(vbox, "Disk utilization"); + gtk_entry_set_text(GTK_ENTRY(entry), tmp); + + gtk_widget_show_all(ge->results_window); + return 0; +} + +static int gfio_disk_util_show(struct gfio_client *gc) +{ + struct gui_entry *ge = gc->ge; + GtkWidget *res_notebook; + int i; + + if (!gc->nr_du) + return 1; + + res_notebook = get_results_window(ge); + + for (i = 0; i < gc->nr_du; i++) { + struct cmd_du_pdu *p = &gc->du[i]; + + __gfio_disk_util_show(res_notebook, gc, p); + } + + gtk_widget_show_all(ge->results_window); + return 0; +} + static void gfio_add_end_results(struct gfio_client *gc, struct thread_stat *ts, struct group_run_stats *rs) { @@ -1246,8 +1441,6 @@ static void __gfio_display_end_results(GtkWidget *win, struct gfio_client *gc, gtk_notebook_append_page(GTK_NOTEBOOK(win), scroll, gtk_label_new(ts->name)); - gc->results_widget = vbox; - entry = new_info_entry_in_frame(box, "Name"); gtk_entry_set_text(GTK_ENTRY(entry), ts->name); if (strlen(ts->description)) { @@ -1268,36 +1461,42 @@ static void __gfio_display_end_results(GtkWidget *win, struct gfio_client *gc, if (ts->io_bytes[DDIR_WRITE]) gfio_show_ddir_status(gc, vbox, rs, ts, DDIR_WRITE); - gfio_show_latency_buckets(vbox, ts); + gfio_show_latency_buckets(gc, vbox, ts); gfio_show_cpu_usage(vbox, ts); gfio_show_io_depths(vbox, ts); } static void gfio_display_end_results(struct gfio_client *gc) { - GtkWidget *res_win; + struct gui_entry *ge = gc->ge; + GtkWidget *res_notebook; int i; - res_win = get_results_window(gc->ge); + res_notebook = get_results_window(ge); for (i = 0; i < gc->nr_results; i++) { struct end_results *e = &gc->results[i]; - __gfio_display_end_results(res_win, gc, &e->ts, &e->gs); + __gfio_display_end_results(res_notebook, gc, &e->ts, &e->gs); } - gtk_widget_show_all(gc->ge->results_window); + if (gfio_disk_util_show(gc)) + gtk_widget_show_all(ge->results_window); } static void gfio_display_ts(struct fio_client *client, struct thread_stat *ts, struct group_run_stats *rs) { struct gfio_client *gc = client->client_data; + struct gui_entry *ge = gc->ge; gfio_add_end_results(gc, ts, rs); gdk_threads_enter(); - gfio_display_end_results(gc); + if (ge->results_window) + __gfio_display_end_results(ge->results_notebook, gc, ts, rs); + else + gfio_display_end_results(gc); gdk_threads_leave(); } @@ -1333,76 +1532,18 @@ static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd { struct cmd_du_pdu *p = (struct cmd_du_pdu *) cmd->payload; struct gfio_client *gc = client->client_data; - GtkWidget *box, *frame, *entry, *vbox; - double util; - char tmp[16]; - - gdk_threads_enter(); - - if (!gc->results_widget) - goto out; - - if (!gc->disk_util_frame) { - gc->disk_util_frame = gtk_frame_new("Disk utilization"); - gtk_box_pack_start(GTK_BOX(gc->results_widget), gc->disk_util_frame, FALSE, FALSE, 5); - } - - vbox = gtk_vbox_new(FALSE, 3); - gtk_container_add(GTK_CONTAINER(gc->disk_util_frame), vbox); - - frame = gtk_frame_new((char *) p->dus.name); - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 2); - - box = gtk_vbox_new(FALSE, 3); - gtk_container_add(GTK_CONTAINER(frame), box); - - frame = gtk_frame_new("Read"); - 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[0]); - entry = new_info_entry_in_frame(vbox, "Merges"); - entry_set_int_value(entry, p->dus.merges[0]); - entry = new_info_entry_in_frame(vbox, "Sectors"); - entry_set_int_value(entry, p->dus.sectors[0]); - entry = new_info_entry_in_frame(vbox, "Ticks"); - entry_set_int_value(entry, p->dus.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 = new_info_entry_in_frame(vbox, "Merges"); - entry_set_int_value(entry, p->dus.merges[1]); - entry = new_info_entry_in_frame(vbox, "Sectors"); - entry_set_int_value(entry, p->dus.sectors[1]); - entry = new_info_entry_in_frame(vbox, "Ticks"); - entry_set_int_value(entry, p->dus.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 = new_info_entry_in_frame(vbox, "Time in queue"); - entry_set_int_value(entry, p->dus.time_in_queue); - - util = 0.0; - if (p->dus.msec) - util = (double) 100 * p->dus.io_ticks / (double) p->dus.msec; - if (util > 100.0) - util = 100.0; + struct gui_entry *ge = gc->ge; + unsigned int nr = gc->nr_du; - sprintf(tmp, "%3.2f%%", util); - entry = new_info_entry_in_frame(vbox, "Disk utilization"); - gtk_entry_set_text(GTK_ENTRY(entry), tmp); + gc->du = realloc(gc->du, (nr + 1) * sizeof(struct cmd_du_pdu)); + memcpy(&gc->du[nr], p, sizeof(*p)); + gc->nr_du++; - gtk_widget_show_all(gc->results_widget); -out: + gdk_threads_enter(); + if (ge->results_window) + __gfio_disk_util_show(ge->results_notebook, gc, p); + else + gfio_disk_util_show(gc); gdk_threads_leave(); } @@ -1426,6 +1567,7 @@ static void gfio_thread_status_op(struct fio_client *client, sum_group_stats(&client_gs, &p->rs); client_ts.members++; + client_ts.thread_number = p->ts.thread_number; client_ts.groupid = p->ts.groupid; if (++sum_stat_nr == sum_stat_clients) { @@ -1753,6 +1895,8 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd) struct gui_entry *ge = gc->ge; char tmp[8]; + p->thread_number = le32_to_cpu(p->thread_number); + p->groupid = le32_to_cpu(p->groupid); convert_thread_options_to_cpu(o, &p->top); gdk_threads_enter(); @@ -1772,8 +1916,6 @@ static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd) multitext_set_entry(&ge->eta.ioengine, 0); multitext_set_entry(&ge->eta.iodepth, 0); - gc->job_added++; - gfio_set_state(ge, GE_STATE_JOB_SENT); gdk_threads_leave(); @@ -1980,6 +2122,8 @@ static void connect_clicked(GtkWidget *widget, gpointer data) if (!ge->nr_job_files) return; + gc = ge->client; + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ge->thread_status_pb), "No jobs running"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ge->thread_status_pb), 0.0); ret = fio_client_connect(gc->client); @@ -2016,28 +2160,6 @@ static void send_clicked(GtkWidget *widget, gpointer data) } } -static GtkWidget *add_button(GtkWidget *buttonbox, - struct button_spec *buttonspec, gpointer data) -{ - GtkWidget *button = gtk_button_new_with_label(buttonspec->buttontext); - - g_signal_connect(button, "clicked", G_CALLBACK(buttonspec->f), data); - gtk_box_pack_start(GTK_BOX(buttonbox), button, FALSE, FALSE, 3); - gtk_widget_set_tooltip_text(button, buttonspec->tooltiptext); - gtk_widget_set_sensitive(button, !buttonspec->start_insensitive); - - return button; -} - -static void add_buttons(struct gui_entry *ge, struct button_spec *buttonlist, - int nbuttons) -{ - int i; - - for (i = 0; i < nbuttons; i++) - ge->button[i] = add_button(ge->buttonbox, &buttonlist[i], ge); -} - static void on_info_bar_response(GtkWidget *widget, gint response, gpointer data) { @@ -2594,7 +2716,6 @@ static void view_results(GtkWidget *w, gpointer data) gfio_display_end_results(gc); } - static void __update_graph_limits(struct gfio_graphs *g) { line_graph_set_data_count_limit(g->iops_graph, gfio_graph_limit); @@ -2771,9 +2892,9 @@ static const gchar *ui_string = " \ \ \ \ + \ \ \ - \ \ \ \