blob: dd69c5450bb459f1a564303c98058a8a39f216a8 [file] [log] [blame]
Jens Axboe53e0e852012-03-15 19:38:01 +01001#ifndef GFIO_H
2#define GFIO_H
3
4#include <gtk/gtk.h>
5
Jens Axboe41666582012-03-21 10:25:29 +01006#include "stat.h"
7#include "thread_options.h"
Jens Axboe49c34172012-03-16 12:05:17 +01008#include "ghelpers.h"
Jens Axboe8dfd6072012-03-22 22:10:37 +01009#include "graph.h"
Jens Axboe49c34172012-03-16 12:05:17 +010010
Jens Axboe53e0e852012-03-15 19:38:01 +010011struct probe_widget {
12 GtkWidget *hostname;
13 GtkWidget *os;
14 GtkWidget *arch;
15 GtkWidget *fio_ver;
16};
17
Jens Axboe53e0e852012-03-15 19:38:01 +010018struct eta_widget {
19 GtkWidget *names;
20 struct multitext_widget iotype;
21 struct multitext_widget bs;
22 struct multitext_widget ioengine;
23 struct multitext_widget iodepth;
24 GtkWidget *jobs;
25 GtkWidget *files;
26 GtkWidget *read_bw;
27 GtkWidget *read_iops;
28 GtkWidget *cr_bw;
29 GtkWidget *cr_iops;
30 GtkWidget *write_bw;
31 GtkWidget *write_iops;
32 GtkWidget *cw_bw;
33 GtkWidget *cw_iops;
34};
35
36struct gfio_graphs {
37#define DRAWING_AREA_XDIM 1000
38#define DRAWING_AREA_YDIM 400
39 GtkWidget *drawing_area;
40 struct graph *iops_graph;
Jens Axboe8dfd6072012-03-22 22:10:37 +010041 graph_label_t read_iops;
42 graph_label_t write_iops;
Jens Axboe53e0e852012-03-15 19:38:01 +010043 struct graph *bandwidth_graph;
Jens Axboe8dfd6072012-03-22 22:10:37 +010044 graph_label_t read_bw;
45 graph_label_t write_bw;
Jens Axboe53e0e852012-03-15 19:38:01 +010046};
47
48/*
49 * Main window widgets and data
50 */
51struct gui {
52 GtkUIManager *uimanager;
53 GtkRecentManager *recentmanager;
54 GtkActionGroup *actiongroup;
55 guint recent_ui_id;
56 GtkWidget *menu;
57 GtkWidget *window;
58 GtkWidget *vbox;
59 GtkWidget *thread_status_pb;
60 GtkWidget *buttonbox;
61 GtkWidget *notebook;
62 GtkWidget *error_info_bar;
63 GtkWidget *error_label;
64 GtkListStore *log_model;
65 GtkWidget *log_tree;
66 GtkWidget *log_view;
67 struct gfio_graphs graphs;
68 struct probe_widget probe;
69 struct eta_widget eta;
70 pthread_t server_t;
71
72 pthread_t t;
73 int handler_running;
74
Jens Axboeb98ab712012-03-21 12:48:32 +010075 GHashTable *ge_hash;
Jens Axboe53e0e852012-03-15 19:38:01 +010076} main_ui;
77
78enum {
79 GE_STATE_NEW = 1,
80 GE_STATE_CONNECTED,
81 GE_STATE_JOB_SENT,
82 GE_STATE_JOB_STARTED,
83 GE_STATE_JOB_RUNNING,
84 GE_STATE_JOB_DONE,
85};
86
87enum {
88 GFIO_BUTTON_CONNECT = 0,
89 GFIO_BUTTON_SEND,
90 GFIO_BUTTON_START,
91 GFIO_BUTTON_NR,
92};
93
94/*
95 * Notebook entry
96 */
97struct gui_entry {
Jens Axboe53e0e852012-03-15 19:38:01 +010098 struct gui *ui;
99
100 GtkWidget *vbox;
101 GtkWidget *job_notebook;
102 GtkWidget *thread_status_pb;
103 GtkWidget *buttonbox;
104 GtkWidget *button[GFIO_BUTTON_NR];
105 GtkWidget *notebook;
106 GtkWidget *error_info_bar;
107 GtkWidget *error_label;
108 GtkWidget *results_window;
109 GtkWidget *results_notebook;
110 GtkUIManager *results_uimanager;
111 GtkWidget *results_menu;
112 GtkWidget *disk_util_vbox;
113 GtkListStore *log_model;
114 GtkWidget *log_tree;
115 GtkWidget *log_view;
116 struct gfio_graphs graphs;
117 struct probe_widget probe;
118 struct eta_widget eta;
119 GtkWidget *page_label;
120 gint page_num;
121 unsigned int state;
122
123 struct graph *clat_graph;
124 struct graph *lat_bucket_graph;
125
126 struct gfio_client *client;
Jens Axboe0cf3ece2012-03-21 10:15:20 +0100127 char *job_file;
128 char *host;
129 int port;
130 int type;
131 int server_start;
Jens Axboe53e0e852012-03-15 19:38:01 +0100132};
133
134struct end_results {
135 struct group_run_stats gs;
136 struct thread_stat ts;
137};
138
Jens Axboecf3d8242012-03-24 08:56:50 +0100139struct gfio_client_options {
140 struct flist_head list;
141 struct thread_options o;
142};
143
Jens Axboe53e0e852012-03-15 19:38:01 +0100144struct gfio_client {
145 struct gui_entry *ge;
146 struct fio_client *client;
147 GtkWidget *err_entry;
Jens Axboe753e9e62012-03-24 20:22:29 +0100148
Jens Axboecf3d8242012-03-24 08:56:50 +0100149 struct flist_head o_list;
Jens Axboe753e9e62012-03-24 20:22:29 +0100150 unsigned int o_list_nr;
Jens Axboe53e0e852012-03-15 19:38:01 +0100151
152 struct end_results *results;
153 unsigned int nr_results;
154
155 struct cmd_du_pdu *du;
156 unsigned int nr_du;
157};
158
Jens Axboe53e0e852012-03-15 19:38:01 +0100159#define GFIO_MIME "text/fio"
160
Jens Axboe1252d8f2012-03-21 11:13:31 +0100161extern void gfio_view_log(struct gui *ui);
162extern void gfio_set_state(struct gui_entry *ge, unsigned int state);
163extern void clear_ge_ui_info(struct gui_entry *ge);
164
165extern const char *gfio_graph_font;
166extern GdkColor gfio_color_white;
167
Jens Axboe53e0e852012-03-15 19:38:01 +0100168#endif