Home | History | Annotate | Download | only in fio

Lines Matching refs:ge

124 void clear_ge_ui_info(struct gui_entry *ge)
126 gtk_label_set_text(GTK_LABEL(ge->probe.hostname), "");
127 gtk_label_set_text(GTK_LABEL(ge->probe.os), "");
128 gtk_label_set_text(GTK_LABEL(ge->probe.arch), "");
129 gtk_label_set_text(GTK_LABEL(ge->probe.fio_ver), "");
132 gtk_entry_set_text(GTK_ENTRY(ge->eta.name), "");
134 multitext_update_entry(&ge->eta.iotype, 0, "");
135 multitext_update_entry(&ge->eta.bs, 0, "");
136 multitext_update_entry(&ge->eta.ioengine, 0, "");
137 multitext_update_entry(&ge->eta.iodepth, 0, "");
138 gtk_entry_set_text(GTK_ENTRY(ge->eta.jobs), "");
139 gtk_entry_set_text(GTK_ENTRY(ge->eta.files), "");
140 gtk_entry_set_text(GTK_ENTRY(ge->eta.read_bw), "");
141 gtk_entry_set_text(GTK_ENTRY(ge->eta.read_iops), "");
142 gtk_entry_set_text(GTK_ENTRY(ge->eta.write_bw), "");
143 gtk_entry_set_text(GTK_ENTRY(ge->eta.write_iops), "");
204 static void add_buttons(struct gui_entry *ge, struct button_spec *buttonlist,
210 ge->button[i] = add_button(ge->buttonbox, &buttonlist[i], ge);
217 static void update_button_states(struct gui *ui, struct gui_entry *ge)
222 switch (ge->state) {
224 gfio_report_error(ge, "Bad client state: %u\n", ge->state);
270 gtk_widget_set_sensitive(ge->button[GFIO_BUTTON_CONNECT], connect_state);
271 gtk_widget_set_sensitive(ge->button[GFIO_BUTTON_SEND], send_state);
272 gtk_widget_set_sensitive(ge->button[GFIO_BUTTON_START], start_state);
273 gtk_button_set_label(GTK_BUTTON(ge->button[GFIO_BUTTON_CONNECT]), connect_str);
274 gtk_widget_set_tooltip_text(ge->button[GFIO_BUTTON_CONNECT], get_button_tooltip(&buttonspeclist[GFIO_BUTTON_CONNECT], connect_state));
283 if (ge->client && ge->client->nr_results)
289 void gfio_set_state(struct gui_entry *ge, unsigned int state)
291 ge->state = state;
292 update_button_states(ge->ui, ge);
384 static void ge_destroy(struct gui_entry *ge)
386 struct gfio_client *gc = ge->client;
390 if (ge->state >= GE_STATE_CONNECTED)
398 g_hash_table_remove(ge->ui->ge_hash, &ge->page_num);
400 free(ge->job_file);
401 free(ge->host);
402 free(ge);
407 struct gui_entry *ge = (struct gui_entry *) data;
409 ge_destroy(ge);
435 static int send_job_file(struct gui_entry *ge)
437 struct gfio_client *gc = ge->client;
452 ret = fio_client_send_ini(gc->client, ge->job_file, false);
456 gfio_report_error(ge, "Failed to send file %s: %s\n", ge->job_file, strerror(-ret));
483 struct gui_entry *ge = data;
484 struct gfio_client *gc = ge->client;
533 static int get_connection_details(struct gui_entry *ge)
537 struct gui *ui = ge->ui;
540 if (ge->host)
613 ge->host = strdup(gtk_entry_get_text(GTK_ENTRY(cw.hentry)));
614 ge->port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(pentry));
618 ge->type = Fio_client_ipv4;
620 ge->type = Fio_client_ipv6;
622 ge->type = Fio_client_socket;
625 ge->server_start = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cw.button));
637 static void gfio_client_added(struct gui_entry *ge, struct fio_client *client)
644 gc->ge = ge;
645 ge->client = gc;
667 struct gui_entry *ge = data;
668 struct gfio_client *gc = ge->client;
670 if (ge->state == GE_STATE_NEW) {
673 if (!ge->job_file)
674 file_open(widget, ge->ui);
675 if (!ge->job_file)
678 gc = ge->client;
683 if (get_connection_details(ge)) {
684 gfio_report_error(ge, "Failed to get connection details\n");
688 client = fio_client_add_explicit(&gfio_client_ops, ge->host, ge->type, ge->port);
690 gfio_report_error(ge, "Failed to add client %s\n", ge->host);
691 free(ge->host);
692 ge->host = NULL;
698 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ge->thread_status_pb), "No jobs running");
699 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ge->thread_status_pb), 0.0);
702 if (!ge->ui->handler_running)
703 pthread_create(&ge->ui->t, NULL, job_thread, ge->ui);
704 gfio_set_state(ge, GE_STATE_CONNECTED);
705 gfio_clear_graph_data(&ge->graphs);
707 gfio_report_error(ge, "Failed to connect to %s: %s\n", ge->client->client->hostname, strerror(-ret));
711 gfio_set_state(ge, GE_STATE_NEW);
712 clear_ge_ui_info(ge);
718 struct gui_entry *ge = data;
720 if (send_job_file(ge))
721 gtk_widget_set_sensitive(ge->button[GFIO_BUTTON_START], 1);
724 static GtkWidget *new_client_page(struct gui_entry *ge);
728 struct gui_entry *ge;
730 ge = malloc(sizeof(*ge));
731 memset(ge, 0, sizeof(*ge));
732 ge->state = GE_STATE_NEW;
733 ge->ui = ui;
734 return ge;
739 struct gui_entry *ge;
741 ge = alloc_new_gui_entry(ui);
743 ge->vbox = new_client_page(ge);
744 g_signal_connect(ge->vbox, "destroy", G_CALLBACK(ge_widget_destroy), ge);
746 ge->page_label = gtk_label_new(name);
747 ge->page_num = gtk_notebook_append_page(GTK_NOTEBOOK(ui->notebook), ge->vbox, ge->page_label);
749 g_hash_table_insert(ui->ge_hash, &ge->page_num, ge);
752 return ge;
758 struct gui_entry *ge;
760 ge = get_new_ge_with_tab(ui, "Untitled");
761 gtk_notebook_set_current_page(GTK_NOTEBOOK(ui->notebook), ge->page_num);
765 * Return the 'ge' corresponding to the tab. If the active tab is the
789 * a ge entry.
801 struct gui_entry *ge;
806 ge = get_ge_from_cur_tab(ui);
807 if (ge) {
808 gtk_widget_destroy(ge->vbox);
842 static int do_file_open(struct gui_entry *ge, const gchar *uri)
846 assert(!ge->job_file);
848 ge->job_file = get_filename_from_uri(uri);
850 client = fio_client_add_explicit(&gfio_client_ops, ge->host, ge->type, ge->port);
855 gtk_label_set_text(GTK_LABEL(ge->page_label), basename(label));
858 gfio_client_added(ge, client);
859 file_add_recent(ge->ui, uri);
863 gfio_report_error(ge, "Failed to add client %s\n", ge->host);
864 free(ge->host);
865 ge->host = NULL;
866 free(ge->job_file);
867 ge->job_file = NULL;
873 struct gui_entry *ge;
882 ge = get_ge_from_page(ui, cur_page, &ge_is_new);
883 if (ge->client) {
884 ge = get_new_ge_with_tab(ui, "Untitled");
888 gtk_notebook_set_current_page(GTK_NOTEBOOK(ui->notebook), ge->page_num);
890 if (get_connection_details(ge)) {
892 gtk_widget_destroy(ge->vbox);
897 ret = do_file_open(ge, uri);
900 if (ge->server_start)
904 gtk_widget_destroy(ge->vbox);
1032 struct gui_entry *ge;
1034 ge = get_ge_from_cur_tab(ui);
1035 if (ge)
1036 connect_clicked(w, ge);
1042 struct gui_entry *ge;
1044 ge = get_ge_from_cur_tab(ui);
1045 if (ge)
1046 send_clicked(w, ge);
1052 struct gui_entry *ge;
1054 ge = get_ge_from_cur_tab(ui);
1055 if (ge && ge->client)
1056 gopt_get_options_window(ui->window, ge->client);
1062 struct gui_entry *ge;
1064 ge = get_ge_from_cur_tab(ui);
1065 if (ge)
1066 start_job_clicked(w, ge);
1073 struct gui_entry *ge;
1075 ge = get_ge_from_cur_tab(ui);
1076 if (!ge)
1079 if (ge->results_window)
1082 gc = ge->client;
1097 struct gui_entry *ge = (struct gui_entry *) value;
1100 __update_graph_settings(&ge->graphs);
1103 g_signal_emit_by_name(G_OBJECT(ge->graphs.drawing_area), GFIO_DRAW_EVENT, GTK_WIDGET(ge->graphs.drawing_area), ev, &ge->graphs);
1337 struct gui_entry *ge = (struct gui_entry *) data;
1342 multitext_set_entry(&ge->eta.iotype, index);
1343 multitext_set_entry(&ge->eta.bs, index);
1344 multitext_set_entry(&ge->eta.ioengine, index);
1345 multitext_set_entry(&ge->eta.iodepth, index);
1350 struct gui_entry *ge = (struct gui_entry *) data;
1352 multitext_free(&ge->eta.iotype);
1353 multitext_free(&ge->eta.bs);
1354 multitext_free(&ge->eta.ioengine);
1355 multitext_free(&ge->eta.iodepth);
1358 static GtkWidget *new_client_page(struct gui_entry *ge)
1377 ge->probe.hostname = new_info_label_in_frame(probe_box, "Host");
1378 ge->probe.os = new_info_label_in_frame(probe_box, "OS");
1379 ge->probe.arch = new_info_label_in_frame(probe_box, "Architecture");
1380 ge->probe.fio_ver = new_info_label_in_frame(probe_box, "Fio version");
1385 ge->eta.names = new_combo_entry_in_frame(probe_box, "Jobs");
1386 g_signal_connect(ge->eta.names, "changed", G_CALLBACK(combo_entry_changed), ge);
1387 g_signal_connect(ge->eta.names, "destroy", G_CALLBACK(combo_entry_destroy), ge);
1388 ge->eta.iotype.entry = new_info_entry_in_frame(probe_box, "IO");
1389 ge->eta.bs.entry = new_info_entry_in_frame(probe_box, "Blocksize (Read/Write/Trim)");
1390 ge->eta.ioengine.entry = new_info_entry_in_frame(probe_box, "IO Engine");
1391 ge->eta.iodepth.entry = new_info_entry_in_frame(probe_box, "IO Depth");
1392 ge->eta.jobs = new_info_entry_in_frame(probe_box, "Jobs");
1393 ge->eta.files = new_info_entry_in_frame(probe_box, "Open files");
1397 ge->eta.read_bw = new_info_entry_in_frame_rgb(probe_box, "Read BW", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
1398 ge->eta.read_iops = new_info_entry_in_frame_rgb(probe_box, "Read IOPS", GFIO_READ_R, GFIO_READ_G, GFIO_READ_B);
1399 ge->eta.write_bw = new_info_entry_in_frame_rgb(probe_box, "Write BW", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
1400 ge->eta.write_iops = new_info_entry_in_frame_rgb(probe_box, "Write IOPS", GFIO_WRITE_R, GFIO_WRITE_G, GFIO_WRITE_B);
1401 ge->eta.trim_bw = new_info_entry_in_frame_rgb(probe_box, "Trim BW", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
1402 ge->eta.trim_iops = new_info_entry_in_frame_rgb(probe_box, "Trim IOPS", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_TRIM_B);
1411 ge->eta.cr_bw = new_info_label_in_frame(probe_box, "Commit BW");
1412 ge->eta.cr_iops = new_info_label_in_frame(probe_box, "Commit IOPS");
1414 ge->eta.cw_bw = new_info_label_in_frame(probe_box, "Commit BW");
1415 ge->eta.cw_iops = new_info_label_in_frame(probe_box, "Commit IOPS");
1421 ge->graphs.drawing_area = gtk_drawing_area_new();
1422 gtk_widget_set_size_request(GTK_WIDGET(ge->graphs.drawing_area),
1424 gtk_widget_modify_bg(ge->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow);
1425 g_signal_connect(G_OBJECT(ge->graphs.drawing_area), GFIO_DRAW_EVENT,
1426 G_CALLBACK(on_expose_drawing_area), &ge->graphs);
1427 g_signal_connect(G_OBJECT(ge->graphs.drawing_area), "configure_event",
1428 G_CALLBACK(on_config_drawing_area), &ge->graphs);
1433 ge->graphs.drawing_area);
1436 setup_graphs(&ge->graphs);
1443 ge->buttonbox = gtk_hbox_new(FALSE, 0);
1444 gtk_container_add(GTK_CONTAINER(bottom_align), ge->buttonbox);
1447 add_buttons(ge, buttonspeclist, ARRAY_SIZE(buttonspeclist));
1452 ge->thread_status_pb = gtk_progress_bar_new();
1453 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ge->thread_status_pb), 0.0);
1454 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ge->thread_status_pb), "No connections");
1455 gtk_container_add(GTK_CONTAINER(ge->buttonbox), ge->thread_status_pb);
1552 struct gui_entry *ge;
1561 ge = get_ge_from_page(ui, page, NULL);
1562 if (ge)
1563 update_button_states(ui, ge);