client: remove command reply after calling into client update_job
[fio.git] / gfio.h
CommitLineData
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
12struct probe_widget {
13 GtkWidget *hostname;
14 GtkWidget *os;
15 GtkWidget *arch;
16 GtkWidget *fio_ver;
17};
18
53e0e85d
JA
19struct 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;
35};
36
37struct gfio_graphs {
38#define DRAWING_AREA_XDIM 1000
39#define DRAWING_AREA_YDIM 400
40 GtkWidget *drawing_area;
41 struct graph *iops_graph;
8dfd6071
JA
42 graph_label_t read_iops;
43 graph_label_t write_iops;
53e0e85d 44 struct graph *bandwidth_graph;
8dfd6071
JA
45 graph_label_t read_bw;
46 graph_label_t write_bw;
53e0e85d
JA
47};
48
49/*
50 * Main window widgets and data
51 */
52struct gui {
53 GtkUIManager *uimanager;
54 GtkRecentManager *recentmanager;
55 GtkActionGroup *actiongroup;
56 guint recent_ui_id;
57 GtkWidget *menu;
58 GtkWidget *window;
59 GtkWidget *vbox;
60 GtkWidget *thread_status_pb;
61 GtkWidget *buttonbox;
62 GtkWidget *notebook;
63 GtkWidget *error_info_bar;
64 GtkWidget *error_label;
65 GtkListStore *log_model;
66 GtkWidget *log_tree;
67 GtkWidget *log_view;
68 struct gfio_graphs graphs;
69 struct probe_widget probe;
70 struct eta_widget eta;
71 pthread_t server_t;
72
73 pthread_t t;
74 int handler_running;
75
b98ab718 76 GHashTable *ge_hash;
53e0e85d
JA
77} main_ui;
78
79enum {
80 GE_STATE_NEW = 1,
81 GE_STATE_CONNECTED,
82 GE_STATE_JOB_SENT,
83 GE_STATE_JOB_STARTED,
84 GE_STATE_JOB_RUNNING,
85 GE_STATE_JOB_DONE,
86};
87
88enum {
89 GFIO_BUTTON_CONNECT = 0,
90 GFIO_BUTTON_SEND,
91 GFIO_BUTTON_START,
92 GFIO_BUTTON_NR,
93};
94
95/*
96 * Notebook entry
97 */
98struct gui_entry {
53e0e85d
JA
99 struct gui *ui;
100
101 GtkWidget *vbox;
102 GtkWidget *job_notebook;
103 GtkWidget *thread_status_pb;
104 GtkWidget *buttonbox;
105 GtkWidget *button[GFIO_BUTTON_NR];
106 GtkWidget *notebook;
107 GtkWidget *error_info_bar;
108 GtkWidget *error_label;
109 GtkWidget *results_window;
110 GtkWidget *results_notebook;
111 GtkUIManager *results_uimanager;
112 GtkWidget *results_menu;
113 GtkWidget *disk_util_vbox;
114 GtkListStore *log_model;
115 GtkWidget *log_tree;
116 GtkWidget *log_view;
117 struct gfio_graphs graphs;
118 struct probe_widget probe;
119 struct eta_widget eta;
120 GtkWidget *page_label;
121 gint page_num;
122 unsigned int state;
123
124 struct graph *clat_graph;
125 struct graph *lat_bucket_graph;
126
127 struct gfio_client *client;
0cf3ece0
JA
128 char *job_file;
129 char *host;
130 int port;
131 int type;
132 int server_start;
53e0e85d
JA
133};
134
135struct end_results {
136 struct group_run_stats gs;
137 struct thread_stat ts;
138};
139
cf3d8241
JA
140struct gfio_client_options {
141 struct flist_head list;
142 struct thread_options o;
143};
144
53e0e85d
JA
145struct gfio_client {
146 struct gui_entry *ge;
147 struct fio_client *client;
148 GtkWidget *err_entry;
753e9e64 149
cf3d8241 150 struct flist_head o_list;
753e9e64 151 unsigned int o_list_nr;
53e0e85d
JA
152
153 struct end_results *results;
154 unsigned int nr_results;
155
156 struct cmd_du_pdu *du;
157 unsigned int nr_du;
158};
159
53e0e85d
JA
160#define GFIO_MIME "text/fio"
161
1252d8f2
JA
162extern void gfio_view_log(struct gui *ui);
163extern void gfio_set_state(struct gui_entry *ge, unsigned int state);
164extern void clear_ge_ui_info(struct gui_entry *ge);
165
166extern const char *gfio_graph_font;
167extern GdkColor gfio_color_white;
168
53e0e85d 169#endif