Since we get this callback from our handling thread, we
need to use gdk_threads_enter() and gdk_threads_leave()
to ensure proper locking.
This fixes various crashes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd)
{
static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd)
{
printf("gfio_disk_util_op called\n");
fio_client_ops.disk_util(client, cmd);
printf("gfio_disk_util_op called\n");
fio_client_ops.disk_util(client, cmd);
}
extern int sum_stat_clients;
}
extern int sum_stat_clients;
static void gfio_group_stats_op(struct fio_client *client,
struct fio_net_cmd *cmd)
{
static void gfio_group_stats_op(struct fio_client *client,
struct fio_net_cmd *cmd)
{
printf("gfio_group_stats_op called\n");
fio_client_ops.group_stats(client, cmd);
printf("gfio_group_stats_op called\n");
fio_client_ops.group_stats(client, cmd);
}
static void gfio_update_eta(struct jobs_eta *je)
}
static void gfio_update_eta(struct jobs_eta *je)
double perc = 0.0;
int i2p = 0;
double perc = 0.0;
int i2p = 0;
eta_str[0] = '\0';
output[0] = '\0';
eta_str[0] = '\0';
output[0] = '\0';
}
gfio_update_thread_status(output, perc);
}
gfio_update_thread_status(output, perc);
}
static void gfio_probe_op(struct fio_client *client, struct fio_net_cmd *cmd)
}
static void gfio_probe_op(struct fio_client *client, struct fio_net_cmd *cmd)
if (!client->name)
client->name = strdup((char *) probe->hostname);
if (!client->name)
client->name = strdup((char *) probe->hostname);
gtk_label_set_text(GTK_LABEL(ui.probe.hostname), (char *) probe->hostname);
gtk_label_set_text(GTK_LABEL(ui.probe.os), os);
gtk_label_set_text(GTK_LABEL(ui.probe.arch), arch);
sprintf(buf, "%u.%u.%u", probe->fio_major, probe->fio_minor, probe->fio_patch);
gtk_label_set_text(GTK_LABEL(ui.probe.fio_ver), buf);
gtk_label_set_text(GTK_LABEL(ui.probe.hostname), (char *) probe->hostname);
gtk_label_set_text(GTK_LABEL(ui.probe.os), os);
gtk_label_set_text(GTK_LABEL(ui.probe.arch), arch);
sprintf(buf, "%u.%u.%u", probe->fio_major, probe->fio_minor, probe->fio_patch);
gtk_label_set_text(GTK_LABEL(ui.probe.fio_ver), buf);
}
static void gfio_update_thread_status(char *status_message, double perc)
}
static void gfio_update_thread_status(char *status_message, double perc)
GTK_PROGRESS_BAR(ui.thread_status_pb), m);
gtk_progress_bar_set_fraction(
GTK_PROGRESS_BAR(ui.thread_status_pb), perc / 100.0);
GTK_PROGRESS_BAR(ui.thread_status_pb), m);
gtk_progress_bar_set_fraction(
GTK_PROGRESS_BAR(ui.thread_status_pb), perc / 100.0);
gtk_widget_queue_draw(ui.window);
gtk_widget_queue_draw(ui.window);
}
static void gfio_quit_op(struct fio_client *client)
{
struct gui *ui = client->client_data;
}
static void gfio_quit_op(struct fio_client *client)
{
struct gui *ui = client->client_data;
gfio_set_connected(ui, 0);
gfio_set_connected(ui, 0);
}
static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
}
static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
p->numjobs = le32_to_cpu(p->numjobs);
p->group_reporting = le32_to_cpu(p->group_reporting);
p->numjobs = le32_to_cpu(p->numjobs);
p->group_reporting = le32_to_cpu(p->group_reporting);
gtk_entry_set_text(GTK_ENTRY(ui->eta.name), (gchar *) p->jobname);
gtk_entry_set_text(GTK_ENTRY(ui->eta.iotype), ddir_str(p->rw));
gtk_entry_set_text(GTK_ENTRY(ui->eta.ioengine), (gchar *) p->ioengine);
sprintf(tmp, "%u", p->iodepth);
gtk_entry_set_text(GTK_ENTRY(ui->eta.iodepth), tmp);
gtk_entry_set_text(GTK_ENTRY(ui->eta.name), (gchar *) p->jobname);
gtk_entry_set_text(GTK_ENTRY(ui->eta.iotype), ddir_str(p->rw));
gtk_entry_set_text(GTK_ENTRY(ui->eta.ioengine), (gchar *) p->ioengine);
sprintf(tmp, "%u", p->iodepth);
gtk_entry_set_text(GTK_ENTRY(ui->eta.iodepth), tmp);
}
static void gfio_client_timed_out(struct fio_client *client)
}
static void gfio_client_timed_out(struct fio_client *client)