gfio: add per-job option view
[fio.git] / gclient.c
index 45d6100ee9081b02bb971c330b9a1bf29f739aba..0a7d1df51058768129baac06a5a83551ef61eea7 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -550,18 +550,31 @@ 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();
 
@@ -763,7 +776,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)
@@ -1113,7 +1126,7 @@ static void gfio_show_clat_percentiles(struct gfio_client *gc,
        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);
+       gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
 out:
        if (ovals)
                free(ovals);
@@ -1153,7 +1166,7 @@ static void gfio_show_ddir_status(struct gfio_client *gc, GtkWidget *mbox,
        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);