Commit | Line | Data |
---|---|---|
53e0e85d JA |
1 | #ifndef GFIO_H |
2 | #define GFIO_H | |
3 | ||
4 | #include <gtk/gtk.h> | |
5 | ||
f762cef9 | 6 | #include "gcompat.h" |
41666588 JA |
7 | #include "stat.h" |
8 | #include "thread_options.h" | |
49c34176 | 9 | #include "ghelpers.h" |
8dfd6071 | 10 | #include "graph.h" |
49c34176 | 11 | |
53e0e85d JA |
12 | struct probe_widget { |
13 | GtkWidget *hostname; | |
14 | GtkWidget *os; | |
15 | GtkWidget *arch; | |
16 | GtkWidget *fio_ver; | |
17 | }; | |
18 | ||
53e0e85d JA |
19 | struct eta_widget { |
20 | GtkWidget *names; | |
21 | struct multitext_widget iotype; | |
22 | struct multitext_widget bs; | |
23 | struct multitext_widget ioengine; | |
24 | struct multitext_widget iodepth; | |
25 | GtkWidget *jobs; | |
26 | GtkWidget *files; | |
27 | GtkWidget *read_bw; | |
28 | GtkWidget *read_iops; | |
29 | GtkWidget *cr_bw; | |
30 | GtkWidget *cr_iops; | |
31 | GtkWidget *write_bw; | |
32 | GtkWidget *write_iops; | |
33 | GtkWidget *cw_bw; | |
34 | GtkWidget *cw_iops; | |
5442cfb0 JA |
35 | GtkWidget *trim_bw; |
36 | GtkWidget *trim_iops; | |
53e0e85d JA |
37 | }; |
38 | ||
39 | struct gfio_graphs { | |
40 | #define DRAWING_AREA_XDIM 1000 | |
41 | #define DRAWING_AREA_YDIM 400 | |
42 | GtkWidget *drawing_area; | |
43 | struct graph *iops_graph; | |
8dfd6071 JA |
44 | graph_label_t read_iops; |
45 | graph_label_t write_iops; | |
5442cfb0 | 46 | graph_label_t trim_iops; |
53e0e85d | 47 | struct graph *bandwidth_graph; |
8dfd6071 JA |
48 | graph_label_t read_bw; |
49 | graph_label_t write_bw; | |
5442cfb0 | 50 | graph_label_t trim_bw; |
53e0e85d JA |
51 | }; |
52 | ||
53 | /* | |
54 | * Main window widgets and data | |
55 | */ | |
56 | struct gui { | |
57 | GtkUIManager *uimanager; | |
58 | GtkRecentManager *recentmanager; | |
59 | GtkActionGroup *actiongroup; | |
60 | guint recent_ui_id; | |
61 | GtkWidget *menu; | |
62 | GtkWidget *window; | |
63 | GtkWidget *vbox; | |
64 | GtkWidget *thread_status_pb; | |
65 | GtkWidget *buttonbox; | |
66 | GtkWidget *notebook; | |
67 | GtkWidget *error_info_bar; | |
68 | GtkWidget *error_label; | |
69 | GtkListStore *log_model; | |
70 | GtkWidget *log_tree; | |
71 | GtkWidget *log_view; | |
72 | struct gfio_graphs graphs; | |
73 | struct probe_widget probe; | |
74 | struct eta_widget eta; | |
75 | pthread_t server_t; | |
76 | ||
77 | pthread_t t; | |
78 | int handler_running; | |
79 | ||
b98ab718 | 80 | GHashTable *ge_hash; |
63a4b9cc JA |
81 | }; |
82 | ||
83 | extern struct gui main_ui; | |
53e0e85d JA |
84 | |
85 | enum { | |
86 | GE_STATE_NEW = 1, | |
87 | GE_STATE_CONNECTED, | |
88 | GE_STATE_JOB_SENT, | |
89 | GE_STATE_JOB_STARTED, | |
90 | GE_STATE_JOB_RUNNING, | |
91 | GE_STATE_JOB_DONE, | |
92 | }; | |
93 | ||
94 | enum { | |
95 | GFIO_BUTTON_CONNECT = 0, | |
96 | GFIO_BUTTON_SEND, | |
97 | GFIO_BUTTON_START, | |
98 | GFIO_BUTTON_NR, | |
99 | }; | |
100 | ||
101 | /* | |
102 | * Notebook entry | |
103 | */ | |
104 | struct gui_entry { | |
53e0e85d JA |
105 | struct gui *ui; |
106 | ||
107 | GtkWidget *vbox; | |
108 | GtkWidget *job_notebook; | |
109 | GtkWidget *thread_status_pb; | |
110 | GtkWidget *buttonbox; | |
111 | GtkWidget *button[GFIO_BUTTON_NR]; | |
112 | GtkWidget *notebook; | |
113 | GtkWidget *error_info_bar; | |
114 | GtkWidget *error_label; | |
115 | GtkWidget *results_window; | |
116 | GtkWidget *results_notebook; | |
117 | GtkUIManager *results_uimanager; | |
118 | GtkWidget *results_menu; | |
119 | GtkWidget *disk_util_vbox; | |
120 | GtkListStore *log_model; | |
121 | GtkWidget *log_tree; | |
122 | GtkWidget *log_view; | |
123 | struct gfio_graphs graphs; | |
124 | struct probe_widget probe; | |
125 | struct eta_widget eta; | |
126 | GtkWidget *page_label; | |
127 | gint page_num; | |
128 | unsigned int state; | |
129 | ||
130 | struct graph *clat_graph; | |
131 | struct graph *lat_bucket_graph; | |
132 | ||
133 | struct gfio_client *client; | |
0cf3ece0 JA |
134 | char *job_file; |
135 | char *host; | |
136 | int port; | |
137 | int type; | |
138 | int server_start; | |
53e0e85d JA |
139 | }; |
140 | ||
141 | struct end_results { | |
142 | struct group_run_stats gs; | |
143 | struct thread_stat ts; | |
144 | }; | |
145 | ||
cf3d8241 JA |
146 | struct gfio_client_options { |
147 | struct flist_head list; | |
148 | struct thread_options o; | |
149 | }; | |
150 | ||
53e0e85d JA |
151 | struct gfio_client { |
152 | struct gui_entry *ge; | |
153 | struct fio_client *client; | |
154 | GtkWidget *err_entry; | |
d31e26d0 JA |
155 | uint32_t client_cpus; |
156 | uint64_t client_flags; | |
753e9e64 | 157 | |
cf3d8241 | 158 | struct flist_head o_list; |
753e9e64 | 159 | unsigned int o_list_nr; |
53e0e85d JA |
160 | |
161 | struct end_results *results; | |
162 | unsigned int nr_results; | |
163 | ||
28db256b JA |
164 | uint32_t update_job_status; |
165 | volatile uint32_t update_job_done; | |
166 | ||
53e0e85d JA |
167 | struct cmd_du_pdu *du; |
168 | unsigned int nr_du; | |
169 | }; | |
170 | ||
53e0e85d JA |
171 | #define GFIO_MIME "text/fio" |
172 | ||
1252d8f2 JA |
173 | extern void gfio_view_log(struct gui *ui); |
174 | extern void gfio_set_state(struct gui_entry *ge, unsigned int state); | |
175 | extern void clear_ge_ui_info(struct gui_entry *ge); | |
176 | ||
177 | extern const char *gfio_graph_font; | |
178 | extern GdkColor gfio_color_white; | |
2a95f716 | 179 | extern GdkColor gfio_color_lightyellow; |
1252d8f2 | 180 | |
53e0e85d | 181 | #endif |