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