17 static void gfio_display_ts(struct fio_client *client, struct thread_stat *ts,
18 struct group_run_stats *rs);
20 static gboolean results_window_delete(GtkWidget *w, gpointer data)
22 struct gui_entry *ge = (struct gui_entry *) data;
24 gtk_widget_destroy(w);
25 ge->results_window = NULL;
26 ge->results_notebook = NULL;
30 static void results_close(GtkWidget *w, gpointer *data)
32 struct gui_entry *ge = (struct gui_entry *) data;
34 gtk_widget_destroy(ge->results_window);
37 static void results_print(GtkWidget *w, gpointer *data)
39 struct gui_entry *ge = (struct gui_entry *) data;
41 gfio_print_results(ge);
44 static GtkActionEntry results_menu_items[] = {
45 { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL},
46 { "GraphMenuAction", GTK_STOCK_FILE, "Graph", NULL, NULL, NULL},
47 { "PrintFile", GTK_STOCK_PRINT, "Print", "<Control>P", NULL, G_CALLBACK(results_print) },
48 { "CloseFile", GTK_STOCK_CLOSE, "Close", "<Control>W", NULL, G_CALLBACK(results_close) },
50 static gint results_nmenu_items = sizeof(results_menu_items) / sizeof(results_menu_items[0]);
52 static const gchar *results_ui_string = " \
54 <menubar name=\"MainMenu\"> \
55 <menu name=\"FileMenu\" action=\"FileMenuAction\"> \
56 <menuitem name=\"Print\" action=\"PrintFile\" /> \
57 <menuitem name=\"Close\" action=\"CloseFile\" /> \
59 <menu name=\"GraphMenu\" action=\"GraphMenuAction\"> \
65 static GtkWidget *get_results_menubar(GtkWidget *window, struct gui_entry *ge)
67 GtkActionGroup *action_group;
71 ge->results_uimanager = gtk_ui_manager_new();
73 action_group = gtk_action_group_new("ResultsMenu");
74 gtk_action_group_add_actions(action_group, results_menu_items, results_nmenu_items, ge);
76 gtk_ui_manager_insert_action_group(ge->results_uimanager, action_group, 0);
77 gtk_ui_manager_add_ui_from_string(GTK_UI_MANAGER(ge->results_uimanager), results_ui_string, -1, &error);
79 gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(ge->results_uimanager));
81 widget = gtk_ui_manager_get_widget(ge->results_uimanager, "/MainMenu");
85 static GtkWidget *get_results_window(struct gui_entry *ge)
87 GtkWidget *win, *notebook, *vbox;
89 if (ge->results_window)
90 return ge->results_notebook;
92 win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
93 gtk_window_set_title(GTK_WINDOW(win), "Results");
94 gtk_window_set_default_size(GTK_WINDOW(win), 1024, 768);
95 g_signal_connect(win, "delete-event", G_CALLBACK(results_window_delete), ge);
96 g_signal_connect(win, "destroy", G_CALLBACK(results_window_delete), ge);
98 vbox = gtk_vbox_new(FALSE, 0);
99 gtk_container_add(GTK_CONTAINER(win), vbox);
101 ge->results_menu = get_results_menubar(win, ge);
102 gtk_box_pack_start(GTK_BOX(vbox), ge->results_menu, FALSE, FALSE, 0);
104 notebook = gtk_notebook_new();
105 gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), 1);
106 gtk_notebook_popup_enable(GTK_NOTEBOOK(notebook));
107 gtk_container_add(GTK_CONTAINER(vbox), notebook);
109 ge->results_window = win;
110 ge->results_notebook = notebook;
111 return ge->results_notebook;
114 static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd)
116 struct cmd_text_pdu *p = (struct cmd_text_pdu *) cmd->payload;
117 struct gfio_client *gc = client->client_data;
118 struct gui_entry *ge = gc->ge;
119 struct gui *ui = ge->ui;
123 char tmp[64], timebuf[80];
126 tm = localtime(&sec);
127 strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", tm);
128 sprintf(timebuf, "%s.%03ld", tmp, (long) p->log_usec / 1000);
132 gtk_list_store_append(ui->log_model, &iter);
133 gtk_list_store_set(ui->log_model, &iter, 0, timebuf, -1);
134 gtk_list_store_set(ui->log_model, &iter, 1, client->hostname, -1);
135 gtk_list_store_set(ui->log_model, &iter, 2, log_get_level(p->level), -1);
136 gtk_list_store_set(ui->log_model, &iter, 3, p->buf, -1);
138 if (p->level == FIO_LOG_ERR)
144 static void disk_util_destroy(GtkWidget *w, gpointer data)
146 struct gui_entry *ge = (struct gui_entry *) data;
148 ge->disk_util_vbox = NULL;
149 gtk_widget_destroy(w);
152 static GtkWidget *gfio_disk_util_get_vbox(struct gui_entry *ge)
154 GtkWidget *vbox, *box, *scroll, *res_notebook;
156 if (ge->disk_util_vbox)
157 return ge->disk_util_vbox;
159 scroll = get_scrolled_window(5);
160 vbox = gtk_vbox_new(FALSE, 3);
161 box = gtk_hbox_new(FALSE, 0);
162 gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 5);
164 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), vbox);
165 res_notebook = get_results_window(ge);
167 gtk_notebook_append_page(GTK_NOTEBOOK(res_notebook), scroll, gtk_label_new("Disk utilization"));
168 ge->disk_util_vbox = box;
169 g_signal_connect(vbox, "destroy", G_CALLBACK(disk_util_destroy), ge);
171 return ge->disk_util_vbox;
174 static int __gfio_disk_util_show(GtkWidget *res_notebook,
175 struct gfio_client *gc, struct cmd_du_pdu *p)
177 GtkWidget *box, *frame, *entry, *vbox, *util_vbox;
178 struct gui_entry *ge = gc->ge;
182 util_vbox = gfio_disk_util_get_vbox(ge);
184 vbox = gtk_vbox_new(FALSE, 3);
185 gtk_container_add(GTK_CONTAINER(util_vbox), vbox);
187 frame = gtk_frame_new((char *) p->dus.name);
188 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 2);
190 box = gtk_vbox_new(FALSE, 3);
191 gtk_container_add(GTK_CONTAINER(frame), box);
193 frame = gtk_frame_new("Read");
194 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 2);
195 vbox = gtk_hbox_new(TRUE, 3);
196 gtk_container_add(GTK_CONTAINER(frame), vbox);
197 entry = new_info_entry_in_frame(vbox, "IOs");
198 entry_set_int_value(entry, p->dus.ios[0]);
199 entry = new_info_entry_in_frame(vbox, "Merges");
200 entry_set_int_value(entry, p->dus.merges[0]);
201 entry = new_info_entry_in_frame(vbox, "Sectors");
202 entry_set_int_value(entry, p->dus.sectors[0]);
203 entry = new_info_entry_in_frame(vbox, "Ticks");
204 entry_set_int_value(entry, p->dus.ticks[0]);
206 frame = gtk_frame_new("Write");
207 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 2);
208 vbox = gtk_hbox_new(TRUE, 3);
209 gtk_container_add(GTK_CONTAINER(frame), vbox);
210 entry = new_info_entry_in_frame(vbox, "IOs");
211 entry_set_int_value(entry, p->dus.ios[1]);
212 entry = new_info_entry_in_frame(vbox, "Merges");
213 entry_set_int_value(entry, p->dus.merges[1]);
214 entry = new_info_entry_in_frame(vbox, "Sectors");
215 entry_set_int_value(entry, p->dus.sectors[1]);
216 entry = new_info_entry_in_frame(vbox, "Ticks");
217 entry_set_int_value(entry, p->dus.ticks[1]);
219 frame = gtk_frame_new("Shared");
220 gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 2);
221 vbox = gtk_hbox_new(TRUE, 3);
222 gtk_container_add(GTK_CONTAINER(frame), vbox);
223 entry = new_info_entry_in_frame(vbox, "IO ticks");
224 entry_set_int_value(entry, p->dus.io_ticks);
225 entry = new_info_entry_in_frame(vbox, "Time in queue");
226 entry_set_int_value(entry, p->dus.time_in_queue);
230 util = (double) 100 * p->dus.io_ticks / (double) p->dus.msec;
234 sprintf(tmp, "%3.2f%%", util);
235 entry = new_info_entry_in_frame(vbox, "Disk utilization");
236 gtk_entry_set_text(GTK_ENTRY(entry), tmp);
238 gtk_widget_show_all(ge->results_window);
242 static int gfio_disk_util_show(struct gfio_client *gc)
244 struct gui_entry *ge = gc->ge;
245 GtkWidget *res_notebook;
251 res_notebook = get_results_window(ge);
253 for (i = 0; i < gc->nr_du; i++) {
254 struct cmd_du_pdu *p = &gc->du[i];
256 __gfio_disk_util_show(res_notebook, gc, p);
259 gtk_widget_show_all(ge->results_window);
263 static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd)
265 struct cmd_du_pdu *p = (struct cmd_du_pdu *) cmd->payload;
266 struct gfio_client *gc = client->client_data;
267 struct gui_entry *ge = gc->ge;
268 unsigned int nr = gc->nr_du;
270 gc->du = realloc(gc->du, (nr + 1) * sizeof(struct cmd_du_pdu));
271 memcpy(&gc->du[nr], p, sizeof(*p));
275 if (ge->results_window)
276 __gfio_disk_util_show(ge->results_notebook, gc, p);
278 gfio_disk_util_show(gc);
282 extern int sum_stat_clients;
283 extern struct thread_stat client_ts;
284 extern struct group_run_stats client_gs;
286 static int sum_stat_nr;
288 static void gfio_thread_status_op(struct fio_client *client,
289 struct fio_net_cmd *cmd)
291 struct cmd_ts_pdu *p = (struct cmd_ts_pdu *) cmd->payload;
293 gfio_display_ts(client, &p->ts, &p->rs);
295 if (sum_stat_clients == 1)
298 sum_thread_stats(&client_ts, &p->ts, sum_stat_nr);
299 sum_group_stats(&client_gs, &p->rs);
302 client_ts.thread_number = p->ts.thread_number;
303 client_ts.groupid = p->ts.groupid;
305 if (++sum_stat_nr == sum_stat_clients) {
306 strcpy(client_ts.name, "All clients");
307 gfio_display_ts(client, &client_ts, &client_gs);
311 static void gfio_group_stats_op(struct fio_client *client,
312 struct fio_net_cmd *cmd)
314 /* We're ignoring group stats for now */
317 static void gfio_update_thread_status(struct gui_entry *ge,
318 char *status_message, double perc)
320 static char message[100];
321 const char *m = message;
323 strncpy(message, status_message, sizeof(message) - 1);
324 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ge->thread_status_pb), m);
325 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ge->thread_status_pb), perc / 100.0);
326 gtk_widget_queue_draw(ge->ui->window);
329 static void gfio_update_thread_status_all(struct gui *ui, char *status_message,
332 static char message[100];
333 const char *m = message;
335 strncpy(message, status_message, sizeof(message) - 1);
336 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), m);
337 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ui->thread_status_pb), perc / 100.0);
338 gtk_widget_queue_draw(ui->window);
342 * Client specific ETA
344 static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *je)
346 struct gfio_client *gc = client->client_data;
347 struct gui_entry *ge = gc->ge;
360 if (je->eta_sec != INT_MAX && je->elapsed_sec) {
361 perc = (double) je->elapsed_sec / (double) (je->elapsed_sec + je->eta_sec);
362 eta_to_str(eta_str, je->eta_sec);
365 sprintf(tmp, "%u", je->nr_running);
366 gtk_entry_set_text(GTK_ENTRY(ge->eta.jobs), tmp);
367 sprintf(tmp, "%u", je->files_open);
368 gtk_entry_set_text(GTK_ENTRY(ge->eta.files), tmp);
371 if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) {
372 if (je->m_rate || je->t_rate) {
375 mr = num2str(je->m_rate, 4, 0, i2p);
376 tr = num2str(je->t_rate, 4, 0, i2p);
377 gtk_entry_set_text(GTK_ENTRY(ge->eta);
378 p += sprintf(p, ", CR=%s/%s KB/s", tr, mr);
381 } else if (je->m_iops || je->t_iops)
382 p += sprintf(p, ", CR=%d/%d IOPS", je->t_iops, je->m_iops);
384 gtk_entry_set_text(GTK_ENTRY(ge->eta.cr_bw), "---");
385 gtk_entry_set_text(GTK_ENTRY(ge->eta.cr_iops), "---");
386 gtk_entry_set_text(GTK_ENTRY(ge->eta.cw_bw), "---");
387 gtk_entry_set_text(GTK_ENTRY(ge->eta.cw_iops), "---");
390 if (je->eta_sec != INT_MAX && je->nr_running) {
391 char *iops_str[DDIR_RWDIR_CNT];
392 char *rate_str[DDIR_RWDIR_CNT];
395 if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running)
396 strcpy(output, "-.-% done");
400 sprintf(output, "%3.1f%% done", perc);
403 rate_str[0] = num2str(je->rate[0], 5, 10, i2p);
404 rate_str[1] = num2str(je->rate[1], 5, 10, i2p);
405 rate_str[2] = num2str(je->rate[2], 5, 10, i2p);
407 iops_str[0] = num2str(je->iops[0], 4, 1, 0);
408 iops_str[1] = num2str(je->iops[1], 4, 1, 0);
409 iops_str[2] = num2str(je->iops[2], 4, 1, 0);
411 gtk_entry_set_text(GTK_ENTRY(ge->eta.read_bw), rate_str[0]);
412 gtk_entry_set_text(GTK_ENTRY(ge->eta.read_iops), iops_str[0]);
413 gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), rate_str[1]);
414 gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), iops_str[1]);
415 gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_bw), rate_str[2]);
416 gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_iops), iops_str[2]);
418 graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]);
419 graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]);
420 graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.trim_iops, je->elapsed_sec, je->iops[2], iops_str[2]);
421 graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]);
422 graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]);
423 graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.trim_bw, je->elapsed_sec, je->rate[2], rate_str[2]);
425 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
432 char *dst = output + strlen(output);
434 sprintf(dst, " - %s", eta_str);
437 gfio_update_thread_status(ge, output, perc);
442 * Update ETA in main window for all clients
444 static void gfio_update_all_eta(struct jobs_eta *je)
446 struct gui *ui = &main_ui;
458 if (je->eta_sec != INT_MAX && je->elapsed_sec) {
459 perc = (double) je->elapsed_sec / (double) (je->elapsed_sec + je->eta_sec);
460 eta_to_str(eta_str, je->eta_sec);
464 if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) {
465 if (je->m_rate || je->t_rate) {
468 mr = num2str(je->m_rate, 4, 0, i2p);
469 tr = num2str(je->t_rate, 4, 0, i2p);
470 gtk_entry_set_text(GTK_ENTRY(ui->eta);
471 p += sprintf(p, ", CR=%s/%s KB/s", tr, mr);
474 } else if (je->m_iops || je->t_iops)
475 p += sprintf(p, ", CR=%d/%d IOPS", je->t_iops, je->m_iops);
477 gtk_entry_set_text(GTK_ENTRY(ui->eta.cr_bw), "---");
478 gtk_entry_set_text(GTK_ENTRY(ui->eta.cr_iops), "---");
479 gtk_entry_set_text(GTK_ENTRY(ui->eta.cw_bw), "---");
480 gtk_entry_set_text(GTK_ENTRY(ui->eta.cw_iops), "---");
483 entry_set_int_value(ui->eta.jobs, je->nr_running);
485 if (je->eta_sec != INT_MAX && je->nr_running) {
489 if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running)
490 strcpy(output, "-.-% done");
494 sprintf(output, "%3.1f%% done", perc);
497 rate_str[0] = num2str(je->rate[0], 5, 10, i2p);
498 rate_str[1] = num2str(je->rate[1], 5, 10, i2p);
500 iops_str[0] = num2str(je->iops[0], 4, 1, 0);
501 iops_str[1] = num2str(je->iops[1], 4, 1, 0);
503 gtk_entry_set_text(GTK_ENTRY(ui->eta.read_bw), rate_str[0]);
504 gtk_entry_set_text(GTK_ENTRY(ui->eta.read_iops), iops_str[0]);
505 gtk_entry_set_text(GTK_ENTRY(ui->eta.write_bw), rate_str[1]);
506 gtk_entry_set_text(GTK_ENTRY(ui->eta.write_iops), iops_str[1]);
508 graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]);
509 graph_add_xy_data(ui->graphs.iops_graph, ui->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]);
510 graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]);
511 graph_add_xy_data(ui->graphs.bandwidth_graph, ui->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]);
520 char *dst = output + strlen(output);
522 sprintf(dst, " - %s", eta_str);
525 gfio_update_thread_status_all(ui, output, perc);
529 static void gfio_probe_op(struct fio_client *client, struct fio_net_cmd *cmd)
531 struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload;
532 struct gfio_client *gc = client->client_data;
533 struct gui_entry *ge = gc->ge;
534 const char *os, *arch;
536 os = fio_get_os_string(probe->os);
540 arch = fio_get_arch_string(probe->arch);
545 client->name = strdup((char *) probe->hostname);
547 gc->client_cpus = le32_to_cpu(probe->cpus);
548 gc->client_flags = le64_to_cpu(probe->flags);
552 gtk_label_set_text(GTK_LABEL(ge->probe.hostname), (char *) probe->hostname);
553 gtk_label_set_text(GTK_LABEL(ge->probe.os), os);
554 gtk_label_set_text(GTK_LABEL(ge->probe.arch), arch);
555 gtk_label_set_text(GTK_LABEL(ge->probe.fio_ver), (char *) probe->fio_version);
557 gfio_set_state(ge, GE_STATE_CONNECTED);
562 static void gfio_quit_op(struct fio_client *client, struct fio_net_cmd *cmd)
564 struct gfio_client *gc = client->client_data;
567 gfio_set_state(gc->ge, GE_STATE_NEW);
571 static struct thread_options *gfio_client_add_job(struct gfio_client *gc,
572 struct thread_options_pack *top)
574 struct gfio_client_options *gco;
576 gco = calloc(1, sizeof(*gco));
577 convert_thread_options_to_cpu(&gco->o, top);
578 INIT_FLIST_HEAD(&gco->list);
579 flist_add_tail(&gco->list, &gc->o_list);
584 static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
586 struct cmd_add_job_pdu *p = (struct cmd_add_job_pdu *) cmd->payload;
587 struct gfio_client *gc = client->client_data;
588 struct gui_entry *ge = gc->ge;
589 struct thread_options *o;
590 char *c1, *c2, *c3, *c4;
593 p->thread_number = le32_to_cpu(p->thread_number);
594 p->groupid = le32_to_cpu(p->groupid);
595 o = gfio_client_add_job(gc, &p->top);
599 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ge->eta.names), (gchar *) o->name);
600 gtk_combo_box_set_active(GTK_COMBO_BOX(ge->eta.names), 0);
602 sprintf(tmp, "%s %s", o->odirect ? "direct" : "buffered", ddir_str(o->td_ddir));
603 multitext_add_entry(&ge->eta.iotype, tmp);
605 c1 = fio_uint_to_kmg(o->min_bs[DDIR_READ]);
606 c2 = fio_uint_to_kmg(o->max_bs[DDIR_WRITE]);
607 c3 = fio_uint_to_kmg(o->min_bs[DDIR_READ]);
608 c4 = fio_uint_to_kmg(o->max_bs[DDIR_WRITE]);
609 sprintf(tmp, "%s-%s/%s-%s", c1, c2, c3, c4);
614 multitext_add_entry(&ge->eta.bs, tmp);
616 multitext_add_entry(&ge->eta.ioengine, (const char *) o->ioengine);
618 sprintf(tmp, "%u", o->iodepth);
619 multitext_add_entry(&ge->eta.iodepth, tmp);
621 multitext_set_entry(&ge->eta.iotype, 0);
622 multitext_set_entry(&ge->eta.bs, 0);
623 multitext_set_entry(&ge->eta.ioengine, 0);
624 multitext_set_entry(&ge->eta.iodepth, 0);
626 gfio_set_state(ge, GE_STATE_JOB_SENT);
631 static void gfio_update_job_op(struct fio_client *client,
632 struct fio_net_cmd *cmd)
634 uint32_t *pdu_error = (uint32_t *) cmd->payload;
635 struct gfio_client *gc = client->client_data;
637 gc->update_job_status = le32_to_cpu(*pdu_error);
638 gc->update_job_done = 1;
641 static void gfio_client_timed_out(struct fio_client *client)
643 struct gfio_client *gc = client->client_data;
648 gfio_set_state(gc->ge, GE_STATE_NEW);
649 clear_ge_ui_info(gc->ge);
651 sprintf(buf, "Client %s: timeout talking to server.\n", client->hostname);
652 gfio_report_info(gc->ge->ui, "Network timeout", buf);
657 static void gfio_client_stop(struct fio_client *client, struct fio_net_cmd *cmd)
659 struct gfio_client *gc = client->client_data;
663 gfio_set_state(gc->ge, GE_STATE_JOB_DONE);
666 entry_set_int_value(gc->err_entry, client->error);
671 static void gfio_client_start(struct fio_client *client, struct fio_net_cmd *cmd)
673 struct gfio_client *gc = client->client_data;
676 gfio_set_state(gc->ge, GE_STATE_JOB_STARTED);
680 static void gfio_client_job_start(struct fio_client *client, struct fio_net_cmd *cmd)
682 struct gfio_client *gc = client->client_data;
685 gfio_set_state(gc->ge, GE_STATE_JOB_RUNNING);
689 static void gfio_client_iolog(struct fio_client *client, struct cmd_iolog_pdu *pdu)
691 printf("got iolog: name=%s, type=%u, entries=%u\n", pdu->name, pdu->log_type, pdu->nr_samples);
695 static void gfio_add_total_depths_tree(GtkListStore *model,
696 struct thread_stat *ts, unsigned int len)
698 double io_u_dist[FIO_IO_U_MAP_NR];
700 /* Bits 1-6, and 8 */
701 const int add_mask = 0x17e;
704 stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
706 gtk_list_store_append(model, &iter);
708 gtk_list_store_set(model, &iter, 0, "Total", -1);
710 for (i = 1, j = 0; i < len; i++) {
713 if (!(add_mask & (1UL << (i - 1))))
714 sprintf(fbuf, "0.0%%");
716 sprintf(fbuf, "%3.1f%%", io_u_dist[j]);
720 gtk_list_store_set(model, &iter, i, fbuf, -1);
725 static void gfio_add_end_results(struct gfio_client *gc, struct thread_stat *ts,
726 struct group_run_stats *rs)
728 unsigned int nr = gc->nr_results;
730 gc->results = realloc(gc->results, (nr + 1) * sizeof(struct end_results));
731 memcpy(&gc->results[nr].ts, ts, sizeof(*ts));
732 memcpy(&gc->results[nr].gs, rs, sizeof(*rs));
736 static void gfio_add_sc_depths_tree(GtkListStore *model,
737 struct thread_stat *ts, unsigned int len,
740 double io_u_dist[FIO_IO_U_MAP_NR];
742 /* Bits 0, and 3-8 */
743 const int add_mask = 0x1f9;
747 stat_calc_dist(ts->io_u_submit, ts->total_submit, io_u_dist);
749 stat_calc_dist(ts->io_u_complete, ts->total_complete, io_u_dist);
751 gtk_list_store_append(model, &iter);
753 gtk_list_store_set(model, &iter, 0, submit ? "Submit" : "Complete", -1);
755 for (i = 1, j = 0; i < len; i++) {
758 if (!(add_mask & (1UL << (i - 1))))
759 sprintf(fbuf, "0.0%%");
761 sprintf(fbuf, "%3.1f%%", io_u_dist[j]);
765 gtk_list_store_set(model, &iter, i, fbuf, -1);
770 static void gfio_show_io_depths(GtkWidget *vbox, struct thread_stat *ts)
772 GtkWidget *frame, *box, *tree_view = NULL;
773 GtkTreeSelection *selection;
776 const char *labels[] = { "Depth", "0", "1", "2", "4", "8", "16", "32", "64", ">= 64" };
777 const int nr_labels = ARRAY_SIZE(labels);
778 GType types[nr_labels];
780 frame = gtk_frame_new("IO depths");
781 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
783 box = gtk_hbox_new(FALSE, 3);
784 gtk_container_add(GTK_CONTAINER(frame), box);
786 for (i = 0; i < nr_labels; i++)
787 types[i] = G_TYPE_STRING;
789 model = gtk_list_store_newv(nr_labels, types);
791 tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
792 gtk_widget_set_can_focus(tree_view, FALSE);
794 g_object_set(G_OBJECT(tree_view), "headers-visible", TRUE,
795 "enable-grid-lines", GTK_TREE_VIEW_GRID_LINES_BOTH, NULL);
797 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
798 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);
800 for (i = 0; i < nr_labels; i++)
801 tree_view_column(tree_view, i, labels[i], ALIGN_RIGHT | UNSORTABLE);
803 gfio_add_total_depths_tree(model, ts, nr_labels);
804 gfio_add_sc_depths_tree(model, ts, nr_labels, 1);
805 gfio_add_sc_depths_tree(model, ts, nr_labels, 0);
807 gtk_box_pack_start(GTK_BOX(box), tree_view, TRUE, TRUE, 3);
810 static void gfio_show_cpu_usage(GtkWidget *vbox, struct thread_stat *ts)
812 GtkWidget *box, *frame, *entry;
813 double usr_cpu, sys_cpu;
814 unsigned long runtime;
817 runtime = ts->total_run_time;
819 double runt = (double) runtime;
821 usr_cpu = (double) ts->usr_time * 100 / runt;
822 sys_cpu = (double) ts->sys_time * 100 / runt;
828 frame = gtk_frame_new("OS resources");
829 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
831 box = gtk_hbox_new(FALSE, 3);
832 gtk_container_add(GTK_CONTAINER(frame), box);
834 entry = new_info_entry_in_frame(box, "User CPU");
835 sprintf(tmp, "%3.2f%%", usr_cpu);
836 gtk_entry_set_text(GTK_ENTRY(entry), tmp);
837 entry = new_info_entry_in_frame(box, "System CPU");
838 sprintf(tmp, "%3.2f%%", sys_cpu);
839 gtk_entry_set_text(GTK_ENTRY(entry), tmp);
840 entry = new_info_entry_in_frame(box, "Context switches");
841 entry_set_int_value(entry, ts->ctx);
842 entry = new_info_entry_in_frame(box, "Major faults");
843 entry_set_int_value(entry, ts->majf);
844 entry = new_info_entry_in_frame(box, "Minor faults");
845 entry_set_int_value(entry, ts->minf);
848 static GtkWidget *gfio_output_lat_buckets(double *lat, const char **labels,
851 GtkWidget *tree_view;
852 GtkTreeSelection *selection;
858 types = malloc(num * sizeof(GType));
860 for (i = 0; i < num; i++)
861 types[i] = G_TYPE_STRING;
863 model = gtk_list_store_newv(num, types);
867 tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
868 gtk_widget_set_can_focus(tree_view, FALSE);
870 g_object_set(G_OBJECT(tree_view), "headers-visible", TRUE,
871 "enable-grid-lines", GTK_TREE_VIEW_GRID_LINES_BOTH, NULL);
873 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
874 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);
876 for (i = 0; i < num; i++)
877 tree_view_column(tree_view, i, labels[i], ALIGN_RIGHT | UNSORTABLE);
879 gtk_list_store_append(model, &iter);
881 for (i = 0; i < num; i++) {
885 sprintf(fbuf, "0.00");
887 sprintf(fbuf, "%3.2f%%", lat[i]);
889 gtk_list_store_set(model, &iter, i, fbuf, -1);
895 static struct graph *setup_lat_bucket_graph(const char *title, double *lat,
898 double xdim, double ydim)
903 g = graph_new(xdim, ydim, gfio_graph_font);
904 graph_title(g, title);
905 graph_x_title(g, "Buckets");
906 graph_y_title(g, "Percent");
908 for (i = 0; i < len; i++) {
911 l = graph_add_label(g, labels[i]);
912 graph_add_data(g, l, lat[i]);
918 static int on_expose_lat_drawing_area(GtkWidget *w, GdkEvent *event, gpointer p)
923 cr = gdk_cairo_create(gtk_widget_get_window(w));
925 if (graph_has_tooltips(g)) {
926 g_object_set(w, "has-tooltip", TRUE, NULL);
927 g_signal_connect(w, "query-tooltip", G_CALLBACK(clat_graph_tooltip), g);
930 cairo_set_source_rgb(cr, 0, 0, 0);
931 bar_graph_draw(g, cr);
937 static gint on_config_lat_drawing_area(GtkWidget *w, GdkEventConfigure *event,
940 guint width = gtk_widget_get_allocated_width(w);
941 guint height = gtk_widget_get_allocated_height(w);
942 struct graph *g = data;
944 graph_set_size(g, width, height);
945 graph_set_size(g, width, height);
946 graph_set_position(g, 0, 0);
950 static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
951 struct thread_stat *ts)
953 double io_u_lat[FIO_IO_U_LAT_U_NR + FIO_IO_U_LAT_M_NR];
954 const char *ranges[] = { "2u", "4u", "10u", "20u", "50u", "100u",
955 "250u", "500u", "750u", "1m", "2m",
956 "4m", "10m", "20m", "50m", "100m",
957 "250m", "500m", "750m", "1s", "2s", ">= 2s" };
959 const int total = FIO_IO_U_LAT_U_NR + FIO_IO_U_LAT_M_NR;
960 GtkWidget *frame, *tree_view, *hbox, *completion_vbox, *drawing_area;
961 struct gui_entry *ge = gc->ge;
963 stat_calc_lat_u(ts, io_u_lat);
964 stat_calc_lat_m(ts, &io_u_lat[FIO_IO_U_LAT_U_NR]);
967 * Found out which first bucket has entries, and which last bucket
970 for (i = 0; i < total; i++) {
971 if (io_u_lat[i] == 0.00)
985 tree_view = gfio_output_lat_buckets(&io_u_lat[start], &ranges[start], end - start + 1);
986 ge->lat_bucket_graph = setup_lat_bucket_graph("Latency Buckets", &io_u_lat[start], &ranges[start], end - start + 1, 700.0, 300.0);
988 frame = gtk_frame_new("Latency buckets");
989 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
991 completion_vbox = gtk_vbox_new(FALSE, 3);
992 gtk_container_add(GTK_CONTAINER(frame), completion_vbox);
993 hbox = gtk_hbox_new(FALSE, 3);
994 gtk_container_add(GTK_CONTAINER(completion_vbox), hbox);
996 drawing_area = gtk_drawing_area_new();
997 gtk_widget_set_size_request(GTK_WIDGET(drawing_area), 700, 300);
998 gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
999 gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area);
1000 g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph);
1001 g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
1003 gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
1006 static void gfio_show_lat(GtkWidget *vbox, const char *name, unsigned long min,
1007 unsigned long max, double mean, double dev)
1009 const char *base = "(usec)";
1010 GtkWidget *hbox, *label, *frame;
1014 if (!usec_to_msec(&min, &max, &mean, &dev))
1017 minp = num2str(min, 6, 1, 0);
1018 maxp = num2str(max, 6, 1, 0);
1020 sprintf(tmp, "%s %s", name, base);
1021 frame = gtk_frame_new(tmp);
1022 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
1024 hbox = gtk_hbox_new(FALSE, 3);
1025 gtk_container_add(GTK_CONTAINER(frame), hbox);
1027 label = new_info_label_in_frame(hbox, "Minimum");
1028 gtk_label_set_text(GTK_LABEL(label), minp);
1029 label = new_info_label_in_frame(hbox, "Maximum");
1030 gtk_label_set_text(GTK_LABEL(label), maxp);
1031 label = new_info_label_in_frame(hbox, "Average");
1032 sprintf(tmp, "%5.02f", mean);
1033 gtk_label_set_text(GTK_LABEL(label), tmp);
1034 label = new_info_label_in_frame(hbox, "Standard deviation");
1035 sprintf(tmp, "%5.02f", dev);
1036 gtk_label_set_text(GTK_LABEL(label), tmp);
1042 static GtkWidget *gfio_output_clat_percentiles(unsigned int *ovals,
1048 GType types[FIO_IO_U_LIST_MAX_LEN];
1049 GtkWidget *tree_view;
1050 GtkTreeSelection *selection;
1051 GtkListStore *model;
1055 for (i = 0; i < len; i++)
1056 types[i] = G_TYPE_INT;
1058 model = gtk_list_store_newv(len, types);
1060 tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
1061 gtk_widget_set_can_focus(tree_view, FALSE);
1063 g_object_set(G_OBJECT(tree_view), "headers-visible", TRUE,
1064 "enable-grid-lines", GTK_TREE_VIEW_GRID_LINES_BOTH, NULL);
1066 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
1067 gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);
1069 for (i = 0; i < len; i++) {
1072 sprintf(fbuf, "%2.2f%%", plist[i].u.f);
1073 tree_view_column(tree_view, i, fbuf, ALIGN_RIGHT | UNSORTABLE);
1076 gtk_list_store_append(model, &iter);
1078 for (i = 0; i < len; i++) {
1080 ovals[i] = (ovals[i] + 999) / 1000;
1081 gtk_list_store_set(model, &iter, i, ovals[i], -1);
1087 static struct graph *setup_clat_graph(char *title, unsigned int *ovals,
1090 double xdim, double ydim)
1095 g = graph_new(xdim, ydim, gfio_graph_font);
1096 graph_title(g, title);
1097 graph_x_title(g, "Percentile");
1098 graph_y_title(g, "Time");
1100 for (i = 0; i < len; i++) {
1104 sprintf(fbuf, "%2.2f%%", plist[i].u.f);
1105 l = graph_add_label(g, fbuf);
1106 graph_add_data(g, l, (double) ovals[i]);
1112 static void gfio_show_clat_percentiles(struct gfio_client *gc,
1113 GtkWidget *vbox, struct thread_stat *ts,
1116 unsigned int *io_u_plat = ts->io_u_plat[ddir];
1117 unsigned long nr = ts->clat_stat[ddir].samples;
1118 fio_fp64_t *plist = ts->percentile_list;
1119 unsigned int *ovals, len, minv, maxv, scale_down;
1121 GtkWidget *tree_view, *frame, *hbox, *drawing_area, *completion_vbox;
1122 struct gui_entry *ge = gc->ge;
1125 len = calc_clat_percentiles(io_u_plat, nr, plist, &ovals, &maxv, &minv);
1130 * We default to usecs, but if the value range is such that we
1131 * should scale down to msecs, do that.
1133 if (minv > 2000 && maxv > 99999) {
1141 sprintf(tmp, "Completion percentiles (%s)", base);
1142 tree_view = gfio_output_clat_percentiles(ovals, plist, len, base, scale_down);
1143 ge->clat_graph = setup_clat_graph(tmp, ovals, plist, len, 700.0, 300.0);
1145 frame = gtk_frame_new(tmp);
1146 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
1148 completion_vbox = gtk_vbox_new(FALSE, 3);
1149 gtk_container_add(GTK_CONTAINER(frame), completion_vbox);
1150 hbox = gtk_hbox_new(FALSE, 3);
1151 gtk_container_add(GTK_CONTAINER(completion_vbox), hbox);
1152 drawing_area = gtk_drawing_area_new();
1153 gtk_widget_set_size_request(GTK_WIDGET(drawing_area), 700, 300);
1154 gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
1155 gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area);
1156 g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->clat_graph);
1157 g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->clat_graph);
1159 gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
1169 static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
1170 struct group_run_stats *rs,
1171 struct thread_stat *ts, int ddir)
1173 const char *ddir_label[2] = { "Read", "Write" };
1174 GtkWidget *frame, *label, *box, *vbox, *main_vbox;
1175 unsigned long min[3], max[3], runt;
1176 unsigned long long bw, iops;
1177 unsigned int flags = 0;
1178 double mean[3], dev[3];
1179 char *io_p, *bw_p, *iops_p;
1182 if (!ts->runtime[ddir])
1185 i2p = is_power_of_2(rs->kb_base);
1186 runt = ts->runtime[ddir];
1188 bw = (1000 * ts->io_bytes[ddir]) / runt;
1189 io_p = num2str(ts->io_bytes[ddir], 6, 1, i2p);
1190 bw_p = num2str(bw, 6, 1, i2p);
1192 iops = (1000 * (uint64_t)ts->total_io_u[ddir]) / runt;
1193 iops_p = num2str(iops, 6, 1, 0);
1195 box = gtk_hbox_new(FALSE, 3);
1196 gtk_box_pack_start(GTK_BOX(mbox), box, TRUE, FALSE, 3);
1198 frame = gtk_frame_new(ddir_label[ddir]);
1199 gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 5);
1201 main_vbox = gtk_vbox_new(FALSE, 3);
1202 gtk_container_add(GTK_CONTAINER(frame), main_vbox);
1204 box = gtk_hbox_new(FALSE, 3);
1205 gtk_box_pack_start(GTK_BOX(main_vbox), box, TRUE, FALSE, 3);
1207 label = new_info_label_in_frame(box, "IO");
1208 gtk_label_set_text(GTK_LABEL(label), io_p);
1209 label = new_info_label_in_frame(box, "Bandwidth");
1210 gtk_label_set_text(GTK_LABEL(label), bw_p);
1211 label = new_info_label_in_frame(box, "IOPS");
1212 gtk_label_set_text(GTK_LABEL(label), iops_p);
1213 label = new_info_label_in_frame(box, "Runtime (msec)");
1214 label_set_int_value(label, ts->runtime[ddir]);
1216 if (calc_lat(&ts->bw_stat[ddir], &min[0], &max[0], &mean[0], &dev[0])) {
1217 double p_of_agg = 100.0;
1218 const char *bw_str = "KB";
1221 if (rs->agg[ddir]) {
1222 p_of_agg = mean[0] * 100 / (double) rs->agg[ddir];
1223 if (p_of_agg > 100.0)
1227 if (mean[0] > 999999.9) {
1235 sprintf(tmp, "Bandwidth (%s)", bw_str);
1236 frame = gtk_frame_new(tmp);
1237 gtk_box_pack_start(GTK_BOX(main_vbox), frame, FALSE, FALSE, 5);
1239 box = gtk_hbox_new(FALSE, 3);
1240 gtk_container_add(GTK_CONTAINER(frame), box);
1242 label = new_info_label_in_frame(box, "Minimum");
1243 label_set_int_value(label, min[0]);
1244 label = new_info_label_in_frame(box, "Maximum");
1245 label_set_int_value(label, max[0]);
1246 label = new_info_label_in_frame(box, "Percentage of jobs");
1247 sprintf(tmp, "%3.2f%%", p_of_agg);
1248 gtk_label_set_text(GTK_LABEL(label), tmp);
1249 label = new_info_label_in_frame(box, "Average");
1250 sprintf(tmp, "%5.02f", mean[0]);
1251 gtk_label_set_text(GTK_LABEL(label), tmp);
1252 label = new_info_label_in_frame(box, "Standard deviation");
1253 sprintf(tmp, "%5.02f", dev[0]);
1254 gtk_label_set_text(GTK_LABEL(label), tmp);
1257 if (calc_lat(&ts->slat_stat[ddir], &min[0], &max[0], &mean[0], &dev[0]))
1259 if (calc_lat(&ts->clat_stat[ddir], &min[1], &max[1], &mean[1], &dev[1]))
1261 if (calc_lat(&ts->lat_stat[ddir], &min[2], &max[2], &mean[2], &dev[2]))
1265 frame = gtk_frame_new("Latency");
1266 gtk_box_pack_start(GTK_BOX(main_vbox), frame, FALSE, FALSE, 5);
1268 vbox = gtk_vbox_new(FALSE, 3);
1269 gtk_container_add(GTK_CONTAINER(frame), vbox);
1271 if (flags & GFIO_SLAT)
1272 gfio_show_lat(vbox, "Submission latency", min[0], max[0], mean[0], dev[0]);
1273 if (flags & GFIO_CLAT)
1274 gfio_show_lat(vbox, "Completion latency", min[1], max[1], mean[1], dev[1]);
1275 if (flags & GFIO_LAT)
1276 gfio_show_lat(vbox, "Total latency", min[2], max[2], mean[2], dev[2]);
1279 if (ts->clat_percentiles)
1280 gfio_show_clat_percentiles(gc, main_vbox, ts, ddir);
1287 static void __gfio_display_end_results(GtkWidget *win, struct gfio_client *gc,
1288 struct thread_stat *ts,
1289 struct group_run_stats *rs)
1291 GtkWidget *box, *vbox, *entry, *scroll;
1293 scroll = gtk_scrolled_window_new(NULL, NULL);
1294 gtk_container_set_border_width(GTK_CONTAINER(scroll), 5);
1295 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
1297 vbox = gtk_vbox_new(FALSE, 3);
1299 box = gtk_hbox_new(FALSE, 0);
1300 gtk_box_pack_start(GTK_BOX(vbox), box, TRUE, FALSE, 5);
1302 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), vbox);
1304 gtk_notebook_append_page(GTK_NOTEBOOK(win), scroll, gtk_label_new(ts->name));
1306 entry = new_info_entry_in_frame(box, "Name");
1307 gtk_entry_set_text(GTK_ENTRY(entry), ts->name);
1308 if (strlen(ts->description)) {
1309 entry = new_info_entry_in_frame(box, "Description");
1310 gtk_entry_set_text(GTK_ENTRY(entry), ts->description);
1312 entry = new_info_entry_in_frame(box, "Group ID");
1313 entry_set_int_value(entry, ts->groupid);
1314 entry = new_info_entry_in_frame(box, "Jobs");
1315 entry_set_int_value(entry, ts->members);
1316 gc->err_entry = entry = new_info_entry_in_frame(box, "Error");
1317 entry_set_int_value(entry, ts->error);
1318 entry = new_info_entry_in_frame(box, "PID");
1319 entry_set_int_value(entry, ts->pid);
1321 if (ts->io_bytes[DDIR_READ])
1322 gfio_show_ddir_status(gc, vbox, rs, ts, DDIR_READ);
1323 if (ts->io_bytes[DDIR_WRITE])
1324 gfio_show_ddir_status(gc, vbox, rs, ts, DDIR_WRITE);
1326 gfio_show_latency_buckets(gc, vbox, ts);
1327 gfio_show_cpu_usage(vbox, ts);
1328 gfio_show_io_depths(vbox, ts);
1331 void gfio_display_end_results(struct gfio_client *gc)
1333 struct gui_entry *ge = gc->ge;
1334 GtkWidget *res_notebook;
1337 res_notebook = get_results_window(ge);
1339 for (i = 0; i < gc->nr_results; i++) {
1340 struct end_results *e = &gc->results[i];
1342 __gfio_display_end_results(res_notebook, gc, &e->ts, &e->gs);
1345 if (gfio_disk_util_show(gc))
1346 gtk_widget_show_all(ge->results_window);
1349 static void gfio_display_ts(struct fio_client *client, struct thread_stat *ts,
1350 struct group_run_stats *rs)
1352 struct gfio_client *gc = client->client_data;
1353 struct gui_entry *ge = gc->ge;
1355 gfio_add_end_results(gc, ts, rs);
1357 gdk_threads_enter();
1358 if (ge->results_window)
1359 __gfio_display_end_results(ge->results_notebook, gc, ts, rs);
1361 gfio_display_end_results(gc);
1362 gdk_threads_leave();
1365 static void gfio_client_removed(struct fio_client *client)
1367 struct gfio_client *gc = client->client_data;
1369 assert(gc->client == client);
1370 fio_put_client(gc->client);
1374 struct client_ops gfio_client_ops = {
1375 .text = gfio_text_op,
1376 .disk_util = gfio_disk_util_op,
1377 .thread_status = gfio_thread_status_op,
1378 .group_stats = gfio_group_stats_op,
1379 .jobs_eta = gfio_update_client_eta,
1380 .eta = gfio_update_all_eta,
1381 .probe = gfio_probe_op,
1382 .quit = gfio_quit_op,
1383 .add_job = gfio_add_job_op,
1384 .update_job = gfio_update_job_op,
1385 .timed_out = gfio_client_timed_out,
1386 .stop = gfio_client_stop,
1387 .start = gfio_client_start,
1388 .job_start = gfio_client_job_start,
1389 .iolog = gfio_client_iolog,
1390 .removed = gfio_client_removed,
1391 .eta_msec = FIO_CLIENT_DEF_ETA_MSEC,
1392 .stay_connected = 1,
1393 .client_type = FIO_CLIENT_TYPE_GUI,