Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 1 | #ifndef GFIO_H |
| 2 | #define GFIO_H |
| 3 | |
| 4 | #include <gtk/gtk.h> |
| 5 | |
Jens Axboe | f762cef | 2012-03-26 13:51:11 +0200 | [diff] [blame] | 6 | #include "gcompat.h" |
Jens Axboe | 4166658 | 2012-03-21 10:25:29 +0100 | [diff] [blame] | 7 | #include "stat.h" |
| 8 | #include "thread_options.h" |
Jens Axboe | 49c3417 | 2012-03-16 12:05:17 +0100 | [diff] [blame] | 9 | #include "ghelpers.h" |
Jens Axboe | 8dfd607 | 2012-03-22 22:10:37 +0100 | [diff] [blame] | 10 | #include "graph.h" |
Jens Axboe | 49c3417 | 2012-03-16 12:05:17 +0100 | [diff] [blame] | 11 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 12 | struct probe_widget { |
| 13 | GtkWidget *hostname; |
| 14 | GtkWidget *os; |
| 15 | GtkWidget *arch; |
| 16 | GtkWidget *fio_ver; |
| 17 | }; |
| 18 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 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; |
Jens Axboe | 5442cfb | 2012-09-24 18:48:46 +0200 | [diff] [blame] | 35 | GtkWidget *trim_bw; |
| 36 | GtkWidget *trim_iops; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 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; |
Jens Axboe | 8dfd607 | 2012-03-22 22:10:37 +0100 | [diff] [blame] | 44 | graph_label_t read_iops; |
| 45 | graph_label_t write_iops; |
Jens Axboe | 5442cfb | 2012-09-24 18:48:46 +0200 | [diff] [blame] | 46 | graph_label_t trim_iops; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 47 | struct graph *bandwidth_graph; |
Jens Axboe | 8dfd607 | 2012-03-22 22:10:37 +0100 | [diff] [blame] | 48 | graph_label_t read_bw; |
| 49 | graph_label_t write_bw; |
Jens Axboe | 5442cfb | 2012-09-24 18:48:46 +0200 | [diff] [blame] | 50 | graph_label_t trim_bw; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 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 | |
Jens Axboe | b98ab71 | 2012-03-21 12:48:32 +0100 | [diff] [blame] | 80 | GHashTable *ge_hash; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 81 | } main_ui; |
| 82 | |
| 83 | enum { |
| 84 | GE_STATE_NEW = 1, |
| 85 | GE_STATE_CONNECTED, |
| 86 | GE_STATE_JOB_SENT, |
| 87 | GE_STATE_JOB_STARTED, |
| 88 | GE_STATE_JOB_RUNNING, |
| 89 | GE_STATE_JOB_DONE, |
| 90 | }; |
| 91 | |
| 92 | enum { |
| 93 | GFIO_BUTTON_CONNECT = 0, |
| 94 | GFIO_BUTTON_SEND, |
| 95 | GFIO_BUTTON_START, |
| 96 | GFIO_BUTTON_NR, |
| 97 | }; |
| 98 | |
| 99 | /* |
| 100 | * Notebook entry |
| 101 | */ |
| 102 | struct gui_entry { |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 103 | struct gui *ui; |
| 104 | |
| 105 | GtkWidget *vbox; |
| 106 | GtkWidget *job_notebook; |
| 107 | GtkWidget *thread_status_pb; |
| 108 | GtkWidget *buttonbox; |
| 109 | GtkWidget *button[GFIO_BUTTON_NR]; |
| 110 | GtkWidget *notebook; |
| 111 | GtkWidget *error_info_bar; |
| 112 | GtkWidget *error_label; |
| 113 | GtkWidget *results_window; |
| 114 | GtkWidget *results_notebook; |
| 115 | GtkUIManager *results_uimanager; |
| 116 | GtkWidget *results_menu; |
| 117 | GtkWidget *disk_util_vbox; |
| 118 | GtkListStore *log_model; |
| 119 | GtkWidget *log_tree; |
| 120 | GtkWidget *log_view; |
| 121 | struct gfio_graphs graphs; |
| 122 | struct probe_widget probe; |
| 123 | struct eta_widget eta; |
| 124 | GtkWidget *page_label; |
| 125 | gint page_num; |
| 126 | unsigned int state; |
| 127 | |
| 128 | struct graph *clat_graph; |
| 129 | struct graph *lat_bucket_graph; |
| 130 | |
| 131 | struct gfio_client *client; |
Jens Axboe | 0cf3ece | 2012-03-21 10:15:20 +0100 | [diff] [blame] | 132 | char *job_file; |
| 133 | char *host; |
| 134 | int port; |
| 135 | int type; |
| 136 | int server_start; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 137 | }; |
| 138 | |
| 139 | struct end_results { |
| 140 | struct group_run_stats gs; |
| 141 | struct thread_stat ts; |
| 142 | }; |
| 143 | |
Jens Axboe | cf3d824 | 2012-03-24 08:56:50 +0100 | [diff] [blame] | 144 | struct gfio_client_options { |
| 145 | struct flist_head list; |
| 146 | struct thread_options o; |
| 147 | }; |
| 148 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 149 | struct gfio_client { |
| 150 | struct gui_entry *ge; |
| 151 | struct fio_client *client; |
| 152 | GtkWidget *err_entry; |
Jens Axboe | d31e26d | 2012-03-28 21:38:24 +0200 | [diff] [blame] | 153 | uint32_t client_cpus; |
| 154 | uint64_t client_flags; |
Jens Axboe | 753e9e6 | 2012-03-24 20:22:29 +0100 | [diff] [blame] | 155 | |
Jens Axboe | cf3d824 | 2012-03-24 08:56:50 +0100 | [diff] [blame] | 156 | struct flist_head o_list; |
Jens Axboe | 753e9e6 | 2012-03-24 20:22:29 +0100 | [diff] [blame] | 157 | unsigned int o_list_nr; |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 158 | |
| 159 | struct end_results *results; |
| 160 | unsigned int nr_results; |
| 161 | |
Jens Axboe | 28db256 | 2012-03-28 10:27:42 +0200 | [diff] [blame] | 162 | uint32_t update_job_status; |
| 163 | volatile uint32_t update_job_done; |
| 164 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 165 | struct cmd_du_pdu *du; |
| 166 | unsigned int nr_du; |
| 167 | }; |
| 168 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 169 | #define GFIO_MIME "text/fio" |
| 170 | |
Jens Axboe | 1252d8f | 2012-03-21 11:13:31 +0100 | [diff] [blame] | 171 | extern void gfio_view_log(struct gui *ui); |
| 172 | extern void gfio_set_state(struct gui_entry *ge, unsigned int state); |
| 173 | extern void clear_ge_ui_info(struct gui_entry *ge); |
| 174 | |
| 175 | extern const char *gfio_graph_font; |
| 176 | extern GdkColor gfio_color_white; |
Jens Axboe | 2a95f71 | 2012-04-16 11:48:45 +0200 | [diff] [blame] | 177 | extern GdkColor gfio_color_lightyellow; |
Jens Axboe | 1252d8f | 2012-03-21 11:13:31 +0100 | [diff] [blame] | 178 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 179 | #endif |