/*
* gfio - gui front end for fio - the flexible io tester
*
- * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
+ * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
* Copyright (C) 2012 Jens Axboe <axboe@kernel.dk>
*
* The license below covers all files distributed with fio unless otherwise
static unsigned int gfio_graph_limit = 100;
GdkColor gfio_color_white;
+GdkColor gfio_color_lightyellow;
const char *gfio_graph_font = GRAPH_DEFAULT_FONT;
typedef void (*clickfunction)(GtkWidget *widget, gpointer data);
graph_x_title(g, "Time (secs)");
gg->read_iops = graph_add_label(g, "Read IOPS");
gg->write_iops = graph_add_label(g, "Write IOPS");
- graph_set_color(g, gg->read_iops, 0.13, 0.54, 0.13);
- graph_set_color(g, gg->write_iops, 1.0, 0.0, 0.0);
+ gg->trim_iops = graph_add_label(g, "Trim IOPS");
+ graph_set_color(g, gg->read_iops, GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ graph_set_color(g, gg->write_iops, GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ graph_set_color(g, gg->trim_iops, GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
line_graph_set_data_count_limit(g, gfio_graph_limit);
graph_add_extra_space(g, 0.0, 0.0, 0.0, 0.0);
graph_set_graph_all_zeroes(g, 0);
graph_x_title(g, "Time (secs)");
gg->read_bw = graph_add_label(g, "Read Bandwidth");
gg->write_bw = graph_add_label(g, "Write Bandwidth");
- graph_set_color(g, gg->read_bw, 0.13, 0.54, 0.13);
- graph_set_color(g, gg->write_bw, 1.0, 0.0, 0.0);
+ gg->trim_bw = graph_add_label(g, "Trim Bandwidth");
+ graph_set_color(g, gg->read_bw, GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ graph_set_color(g, gg->write_bw, GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ graph_set_color(g, gg->trim_bw, GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
graph_set_base_offset(g, 1);
line_graph_set_data_count_limit(g, 100);
graph_add_extra_space(g, 0.0, 0.0, 0.0, 0.0);
GtkListStore *model;
GtkWidget *tree_view;
- model = gtk_list_store_new(4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING);
+ model = gtk_list_store_new(4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
gtk_widget_set_can_focus(tree_view, FALSE);
static void gfio_quit(struct gui *ui)
{
- gtk_main_quit();
+ gtk_main_quit();
}
static void quit_clicked(__attribute__((unused)) GtkWidget *widget,
- __attribute__((unused)) gpointer data)
+ gpointer data)
{
struct gui *ui = (struct gui *) data;
}
static void start_job_clicked(__attribute__((unused)) GtkWidget *widget,
- gpointer data)
+ gpointer data)
{
struct gui_entry *ge = data;
struct gfio_client *gc = ge->client;
if (get_connection_details(ge)) {
if (ge_is_new)
gtk_widget_destroy(ge->vbox);
-
+
return 1;
}
{
struct gui *ui = (struct gui *) data;
struct gui_entry *ge;
-
+
ge = get_ge_from_cur_tab(ui);
if (ge)
connect_clicked(w, ge);
__update_graph_settings(&ge->graphs);
ev = gdk_event_new(GDK_EXPOSE);
- g_signal_emit_by_name(G_OBJECT(ge->graphs.drawing_area), "expose_event", GTK_WIDGET(ge->graphs.drawing_area), ev, &ge->graphs);
+ g_signal_emit_by_name(G_OBJECT(ge->graphs.drawing_area), GFIO_DRAW_EVENT, GTK_WIDGET(ge->graphs.drawing_area), ev, &ge->graphs);
gdk_event_free(ev);
}
__update_graph_settings(&ui->graphs);
ev = gdk_event_new(GDK_EXPOSE);
- g_signal_emit_by_name(G_OBJECT(ui->graphs.drawing_area), "expose_event", GTK_WIDGET(ui->graphs.drawing_area), ev, &ui->graphs);
+ g_signal_emit_by_name(G_OBJECT(ui->graphs.drawing_area), GFIO_DRAW_EVENT, GTK_WIDGET(ui->graphs.drawing_area), ev, &ui->graphs);
gdk_event_free(ev);
g_hash_table_foreach(ui->ge_hash, ge_update_settings_fn, NULL);
probe_box = gtk_hbox_new(FALSE, 3);
gtk_box_pack_start(GTK_BOX(probe_frame), probe_box, FALSE, FALSE, 3);
- ge->eta.read_bw = new_info_entry_in_frame(probe_box, "Read BW");
- ge->eta.read_iops = new_info_entry_in_frame(probe_box, "IOPS");
- ge->eta.write_bw = new_info_entry_in_frame(probe_box, "Write BW");
- ge->eta.write_iops = new_info_entry_in_frame(probe_box, "IOPS");
+ ge->eta.read_bw = new_info_entry_in_frame_rgb(probe_box, "Read BW", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ ge->eta.read_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ ge->eta.write_bw = new_info_entry_in_frame_rgb(probe_box, "Write BW", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ ge->eta.write_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ ge->eta.trim_bw = new_info_entry_in_frame_rgb(probe_box, "Trim BW", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
+ ge->eta.trim_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
/*
* Only add this if we have a commit rate
ge->graphs.drawing_area = gtk_drawing_area_new();
gtk_widget_set_size_request(GTK_WIDGET(ge->graphs.drawing_area),
DRAWING_AREA_XDIM, DRAWING_AREA_YDIM);
- gtk_widget_modify_bg(ge->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
- g_signal_connect(G_OBJECT(ge->graphs.drawing_area), "expose_event",
+ gtk_widget_modify_bg(ge->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow);
+ g_signal_connect(G_OBJECT(ge->graphs.drawing_area), GFIO_DRAW_EVENT,
G_CALLBACK(on_expose_drawing_area), &ge->graphs);
g_signal_connect(G_OBJECT(ge->graphs.drawing_area), "configure_event",
G_CALLBACK(on_config_drawing_area), &ge->graphs);
setup_graphs(&ge->graphs);
/*
- * Set up alignments for widgets at the bottom of ui,
+ * Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
probe_box = gtk_hbox_new(FALSE, 3);
gtk_box_pack_start(GTK_BOX(probe_frame), probe_box, FALSE, FALSE, 3);
ui->eta.jobs = new_info_entry_in_frame(probe_box, "Running");
- ui->eta.read_bw = new_info_entry_in_frame(probe_box, "Read BW");
- ui->eta.read_iops = new_info_entry_in_frame(probe_box, "IOPS");
- ui->eta.write_bw = new_info_entry_in_frame(probe_box, "Write BW");
- ui->eta.write_iops = new_info_entry_in_frame(probe_box, "IOPS");
+ ui->eta.read_bw = new_info_entry_in_frame_rgb(probe_box, "Read BW", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ ui->eta.read_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
+ ui->eta.write_bw = new_info_entry_in_frame_rgb(probe_box, "Write BW", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ ui->eta.write_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
+ ui->eta.trim_bw = new_info_entry_in_frame_rgb(probe_box, "Trim BW", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
+ ui->eta.trim_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
/*
* Only add this if we have a commit rate
ui->graphs.drawing_area = gtk_drawing_area_new();
gtk_widget_set_size_request(GTK_WIDGET(ui->graphs.drawing_area),
DRAWING_AREA_XDIM, DRAWING_AREA_YDIM);
- gtk_widget_modify_bg(ui->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
- g_signal_connect(G_OBJECT(ui->graphs.drawing_area), "expose_event",
+ gtk_widget_modify_bg(ui->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow);
+ g_signal_connect(G_OBJECT(ui->graphs.drawing_area), GFIO_DRAW_EVENT,
G_CALLBACK(on_expose_drawing_area), &ui->graphs);
g_signal_connect(G_OBJECT(ui->graphs.drawing_area), "configure_event",
G_CALLBACK(on_config_drawing_area), &ui->graphs);
setup_graphs(&ui->graphs);
/*
- * Set up alignments for widgets at the bottom of ui,
+ * Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
settings = gtk_settings_get_default();
gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "gfio setting");
g_type_init();
+ gdk_color_parse("#fffff4", &gfio_color_lightyellow);
gdk_color_parse("white", &gfio_color_white);
-
+
ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(ui->window), "fio");
gtk_window_set_default_size(GTK_WINDOW(ui->window), 1024, 768);