server: include number of CPUs in probe reply
[fio.git] / gclient.c
index 1042eafbd5ea242be0b44992e21a8c33d0e7a2b3..8675f617fb2d4dfd46d4326c16c5f88e8baf56bd 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -426,7 +426,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();
 }
@@ -514,7 +514,7 @@ 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();
 }
@@ -538,6 +538,9 @@ 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);
@@ -620,6 +623,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;
@@ -963,7 +976,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);
 
@@ -980,7 +993,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
        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), 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);
+       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, TRUE, 3);
 }
@@ -1363,6 +1376,7 @@ 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,