summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-09-24 18:48:46 +0200
committerJens Axboe <axboe@kernel.dk>2012-09-24 18:48:46 +0200
commit5442cfb01f805ba26d3b8917b85c8e5f7bc50456 (patch)
treea8ac7cb1520aef486b918496caa87d9f57717fb4
parent298921d65ea914873cbc270af6663dad9e08b782 (diff)
gfio: add trim UI support
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--gclient.c19
-rw-r--r--gfio.c9
-rw-r--r--gfio.h4
3 files changed, 26 insertions, 6 deletions
diff --git a/gclient.c b/gclient.c
index f317dc7..6095863 100644
--- a/gclient.c
+++ b/gclient.c
@@ -388,8 +388,9 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j
#endif
if (je->eta_sec != INT_MAX && je->nr_running) {
- char *iops_str[2];
- char *rate_str[2];
+ char *iops_str[DDIR_RWDIR_CNT];
+ char *rate_str[DDIR_RWDIR_CNT];
+ int i;
if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running)
strcpy(output, "-.-% done");
@@ -401,24 +402,30 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j
rate_str[0] = num2str(je->rate[0], 5, 10, i2p);
rate_str[1] = num2str(je->rate[1], 5, 10, i2p);
+ rate_str[2] = num2str(je->rate[2], 5, 10, i2p);
iops_str[0] = num2str(je->iops[0], 4, 1, 0);
iops_str[1] = num2str(je->iops[1], 4, 1, 0);
+ iops_str[2] = num2str(je->iops[2], 4, 1, 0);
gtk_entry_set_text(GTK_ENTRY(ge->eta.read_bw), rate_str[0]);
gtk_entry_set_text(GTK_ENTRY(ge->eta.read_iops), iops_str[0]);
gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), rate_str[1]);
gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), iops_str[1]);
+ gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_bw), rate_str[2]);
+ gtk_entry_set_text(GTK_ENTRY(ge->eta.trim_iops), iops_str[2]);
graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.read_iops, je->elapsed_sec, je->iops[0], iops_str[0]);
graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.write_iops, je->elapsed_sec, je->iops[1], iops_str[1]);
+ graph_add_xy_data(ge->graphs.iops_graph, ge->graphs.trim_iops, je->elapsed_sec, je->iops[2], iops_str[2]);
graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.read_bw, je->elapsed_sec, je->rate[0], rate_str[0]);
graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.write_bw, je->elapsed_sec, je->rate[1], rate_str[1]);
+ graph_add_xy_data(ge->graphs.bandwidth_graph, ge->graphs.trim_bw, je->elapsed_sec, je->rate[2], rate_str[2]);
- free(rate_str[0]);
- free(rate_str[1]);
- free(iops_str[0]);
- free(iops_str[1]);
+ for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+ free(rate_str[i]);
+ free(iops_str[i]);
+ }
}
if (eta_str[0]) {
diff --git a/gfio.c b/gfio.c
index b9da702..977f2fc 100644
--- a/gfio.c
+++ b/gfio.c
@@ -85,8 +85,10 @@ static void setup_iops_graph(struct gfio_graphs *gg)
graph_x_title(g, "Time (secs)");
gg->read_iops = graph_add_label(g, "Read IOPS");
gg->write_iops = graph_add_label(g, "Write IOPS");
+ gg->trim_iops = graph_add_label(g, "Trim 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);
+ graph_set_color(g, gg->trim_iops, 0.24, 0.18, 0.52);
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);
@@ -102,8 +104,10 @@ static void setup_bandwidth_graph(struct gfio_graphs *gg)
graph_x_title(g, "Time (secs)");
gg->read_bw = graph_add_label(g, "Read Bandwidth");
gg->write_bw = graph_add_label(g, "Write Bandwidth");
+ gg->trim_bw = graph_add_label(g, "Trim 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);
+ graph_set_color(g, gg->trim_bw, 0.24, 0.18, 0.52);
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);
@@ -1385,6 +1389,8 @@ static GtkWidget *new_client_page(struct gui_entry *ge)
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.trim_bw = new_info_entry_in_frame(probe_box, "Trim BW");
+ ge->eta.trim_iops = new_info_entry_in_frame(probe_box, "IOPS");
/*
* Only add this if we have a commit rate
@@ -1471,6 +1477,9 @@ static GtkWidget *new_main_page(struct gui *ui)
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.trim_bw = new_info_entry_in_frame(probe_box, "Trim BW");
+ ui->eta.trim_iops = new_info_entry_in_frame(probe_box, "IOPS");
+
/*
* Only add this if we have a commit rate
diff --git a/gfio.h b/gfio.h
index dd75c8a..aa14e3c 100644
--- a/gfio.h
+++ b/gfio.h
@@ -32,6 +32,8 @@ struct eta_widget {
GtkWidget *write_iops;
GtkWidget *cw_bw;
GtkWidget *cw_iops;
+ GtkWidget *trim_bw;
+ GtkWidget *trim_iops;
};
struct gfio_graphs {
@@ -41,9 +43,11 @@ struct gfio_graphs {
struct graph *iops_graph;
graph_label_t read_iops;
graph_label_t write_iops;
+ graph_label_t trim_iops;
struct graph *bandwidth_graph;
graph_label_t read_bw;
graph_label_t write_bw;
+ graph_label_t trim_bw;
};
/*