- GtkWidget *win, *notebook;
-
- if (ui->results_window)
- return ui->results_notebook;
-
- win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(win), "Results");
- g_signal_connect(win, "delete-event", G_CALLBACK(results_window_delete), ui);
- g_signal_connect(win, "destroy", G_CALLBACK(results_window_delete), ui);
-
- notebook = gtk_notebook_new();
- gtk_container_add(GTK_CONTAINER(win), notebook);
-
- ui->results_window = win;
- ui->results_notebook = notebook;
- return ui->results_notebook;
-}
-
-static void gfio_display_ts(struct fio_client *client, struct thread_stat *ts,
- struct group_run_stats *rs)
-{
- GtkWidget *res_win, *box, *vbox, *entry;
- struct gfio_client *gc = client->client_data;
-
- gdk_threads_enter();
-
- res_win = get_results_window(gc->ui);
-
- vbox = gtk_vbox_new(FALSE, 3);
-
- box = gtk_hbox_new(TRUE, 3);
- gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 5);
-
- gtk_notebook_append_page(GTK_NOTEBOOK(res_win), vbox, 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)) {
- entry = new_info_entry_in_frame(box, "Description");
- gtk_entry_set_text(GTK_ENTRY(entry), ts->description);
- }
- entry = new_info_entry_in_frame(box, "Group ID");
- entry_set_int_value(entry, ts->groupid);
- entry = new_info_entry_in_frame(box, "Jobs");
- entry_set_int_value(entry, ts->members);
- entry = new_info_entry_in_frame(box, "Error");
- entry_set_int_value(entry, ts->error);
- 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(vbox, rs, ts, DDIR_READ);
- if (ts->io_bytes[DDIR_WRITE])
- gfio_show_ddir_status(vbox, rs, ts, DDIR_WRITE);
-
- gfio_show_latency_buckets(vbox, ts);
- gfio_show_cpu_usage(vbox, ts);
- gfio_show_io_depths(vbox, ts);
-
- gtk_widget_show_all(gc->ui->results_window);
- gdk_threads_leave();
-}
-
-static void gfio_text_op(struct fio_client *client, struct fio_net_cmd *cmd)
-{
- struct cmd_text_pdu *p = (struct cmd_text_pdu *) cmd->payload;
- struct gfio_client *gc = client->client_data;
- GtkTreeIter iter;
- struct tm *tm;
- time_t sec;
- char tmp[64], timebuf[80];
-
- sec = p->log_sec;
- tm = localtime(&sec);
- strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", tm);
- sprintf(timebuf, "%s.%03ld", tmp, p->log_usec / 1000);
-
- gdk_threads_enter();
-
- gtk_list_store_append(gc->ui->log_model, &iter);
- gtk_list_store_set(gc->ui->log_model, &iter, 0, timebuf, -1);
- gtk_list_store_set(gc->ui->log_model, &iter, 1, client->hostname, -1);
- gtk_list_store_set(gc->ui->log_model, &iter, 2, p->level, -1);
- gtk_list_store_set(gc->ui->log_model, &iter, 3, p->buf, -1);
-
- gdk_threads_leave();
-}
-
-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;
-
- gdk_threads_enter();
-
- if (!gc->results_widget) {
- printf("no results!\n");
- 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);
-
- gtk_widget_show_all(gc->results_widget);
-out:
- gdk_threads_leave();