Lets squash them all, with a bit of tooling help.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
return 1;
if (td_non_fatal_error(err)) {
- /*
- * Continue with the I/Os in case of
+ /*
+ * Continue with the I/Os in case of
* a non fatal error.
*/
update_error_count(td, err);
memcpy(&td->tv_cache, &td->start, sizeof(td->start));
if (td->o.ratemin[0] || td->o.ratemin[1]) {
- memcpy(&td->lastrate[0], &td->bw_sample_time,
+ memcpy(&td->lastrate[0], &td->bw_sample_time,
sizeof(td->bw_sample_time));
- memcpy(&td->lastrate[1], &td->bw_sample_time,
+ memcpy(&td->lastrate[1], &td->bw_sample_time,
sizeof(td->bw_sample_time));
}
double factor, direction;
cairo_text_extents_t extents;
- switch(alignment) {
+ switch (alignment) {
case CENTERED:
direction = -1.0;
factor = 0.5;
draw_aligned_text(cr, font, x, y, fontsize, text, LEFT_JUSTIFIED);
}
-void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
+void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
double y, double fontsize,
const char *text)
{
double x, double y,
double fontsize, const char *text);
-void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
+void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
double y, double fontsize,
const char *text);
#endif
for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i));
#if 0
- uint8_t cpumask[FIO_TOP_STR_MAX];
- uint8_t verify_cpumask[FIO_TOP_STR_MAX];
+ uint8_t cpumask[FIO_TOP_STR_MAX];
+ uint8_t verify_cpumask[FIO_TOP_STR_MAX];
#endif
}
for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f));
#if 0
- uint8_t cpumask[FIO_TOP_STR_MAX];
- uint8_t verify_cpumask[FIO_TOP_STR_MAX];
+ uint8_t cpumask[FIO_TOP_STR_MAX];
+ uint8_t verify_cpumask[FIO_TOP_STR_MAX];
#endif
}
#ifdef WIN32
WSADATA wsd;
- WSAStartup(MAKEWORD(2,2), &wsd);
+ WSAStartup(MAKEWORD(2, 2), &wsd);
#endif
dprint(FD_NET, "client: connect all\n");
r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0,
f->real_file_size);
- if (r != 0) {
+ if (r != 0)
td_verror(td, errno, "fallocate");
- }
+
break;
#endif /* FIO_HAVE_LINUX_FALLOCATE */
default:
sprintf(dst, " - %s", eta_str);
}
-
+
gfio_update_thread_status(ge, output, perc);
gdk_threads_leave();
}
sprintf(dst, " - %s", eta_str);
}
-
+
gfio_update_thread_status_all(ui, output, perc);
gdk_threads_leave();
}
*/
if (start == -1U)
return;
-
+
tree_view = gfio_output_lat_buckets(&io_u_lat[start], &ranges[start], end - start + 1);
ge->lat_bucket_graph = setup_lat_bucket_graph("Latency Buckets", &io_u_lat[start], &ranges[start], end - start + 1, 700.0, 300.0);
gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area);
g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph);
- g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
+ g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
}
void gtk_combo_box_text_insert_text(GtkComboBoxText *combo_box, gint position, const gchar *text);
void gtk_combo_box_text_prepend_text(GtkComboBoxText *combo_box, const gchar *text);
void gtk_combo_box_text_remove(GtkComboBoxText *combo_box, gint position);
-gchar *gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box);
+gchar *gtk_combo_box_text_get_active_text(GtkComboBoxText *combo_box);
#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
#endif /* GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 24 */
#include "gerror.h"
static void on_info_bar_response(GtkWidget *widget, gint response,
- gpointer data)
+ gpointer data)
{
struct gui *ui = (struct gui *) data;
if (ui->error_info_bar == NULL) {
ui->error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK,
- GTK_RESPONSE_OK,
- NULL);
+ GTK_RESPONSE_OK, NULL);
g_signal_connect(ui->error_info_bar, "response", G_CALLBACK(on_info_bar_response), ui);
gtk_info_bar_set_message_type(GTK_INFO_BAR(ui->error_info_bar),
- GTK_MESSAGE_ERROR);
-
+ GTK_MESSAGE_ERROR);
+
ui->error_label = gtk_label_new(error->message);
GtkWidget *container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar));
gtk_container_add(GTK_CONTAINER(container), ui->error_label);
-
+
gtk_box_pack_start(GTK_BOX(ui->vbox), ui->error_info_bar, FALSE, FALSE, 0);
gtk_widget_show_all(ui->vbox);
} else {
/*
* gfio - gui front end for fio - the flexible io tester
*
- * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
+ * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
* Copyright (C) 2012 Jens Axboe <axboe@kernel.dk>
*
* The license below covers all files distributed with fio unless otherwise
static void gfio_quit(struct gui *ui)
{
- gtk_main_quit();
+ gtk_main_quit();
}
static void quit_clicked(__attribute__((unused)) GtkWidget *widget,
- __attribute__((unused)) gpointer data)
+ gpointer data)
{
struct gui *ui = (struct gui *) data;
}
static void start_job_clicked(__attribute__((unused)) GtkWidget *widget,
- gpointer data)
+ gpointer data)
{
struct gui_entry *ge = data;
struct gfio_client *gc = ge->client;
if (get_connection_details(ge)) {
if (ge_is_new)
gtk_widget_destroy(ge->vbox);
-
+
return 1;
}
{
struct gui *ui = (struct gui *) data;
struct gui_entry *ge;
-
+
ge = get_ge_from_cur_tab(ui);
if (ge)
connect_clicked(w, ge);
setup_graphs(&ge->graphs);
/*
- * Set up alignments for widgets at the bottom of ui,
+ * Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
setup_graphs(&ui->graphs);
/*
- * Set up alignments for widgets at the bottom of ui,
+ * Set up alignments for widgets at the bottom of ui,
* align bottom left, expand horizontally but not vertically
*/
bottom_align = gtk_alignment_new(0, 1, 1, 0);
gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "gfio setting");
g_type_init();
gdk_color_parse("white", &gfio_color_white);
-
+
ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(ui->window), "fio");
gtk_window_set_default_size(GTK_WINDOW(ui->window), 1024, 768);
/*
* gfio - gui front end for fio - the flexible io tester
*
- * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
+ * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
*
* The license below covers all files distributed with fio unless otherwise
* noted in the file itself.
graph_axis_unit_change_callback y_axis_unit_change_callback;
unsigned int base_offset;
unsigned int dont_graph_all_zeroes;
- double left_extra;
- double right_extra;
- double top_extra;
- double bottom_extra;
+ double left_extra;
+ double right_extra;
+ double top_extra;
+ double bottom_extra;
double xtick_zero;
double xtick_delta;
cairo_close_path(cr);
cairo_fill(cr);
cairo_stroke(cr);
- bar_num++;
+ bar_num++;
}
}
double *x1, double *y1, double *x2, double *y2)
{
cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_set_line_width (cr, 0.8);
+ cairo_set_line_width(cr, 0.8);
- *x1 = 0.10 * g->xdim;
+ *x1 = 0.10 * g->xdim;
*x2 = 0.95 * g->xdim;
- *y1 = 0.10 * g->ydim;
+ *y1 = 0.10 * g->ydim;
*y2 = 0.90 * g->ydim;
cairo_move_to(cr, *x1, *y1);
draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata);
// draw_centered_text(cr, label_offset + (bar_width / 2.0 + bar_width * 0.1), bg->ydim * 0.93,
draw_centered_text(cr, bg->font, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93,
- 12.0, lb->label);
+ 12.0, lb->label);
i++;
}
cairo_stroke(cr);
first = 0;
answer = tmp;
}
- answer = cmp(tmp, answer);
+ answer = cmp(tmp, answer);
}
}
{
struct flist_head *entry;
struct graph_label *i;
-
+
flist_for_each(entry, &bg->label_list) {
i = flist_entry(entry, struct graph_label, list);
graph_label_t graph_add_label(struct graph *bg, const char *label)
{
struct graph_label *i;
-
+
i = graph_find_label(bg, label);
if (i)
return i; /* already present. */
while (!flist_empty(&l->value_list)) {
i = flist_entry(l->value_list.next, struct graph_value, list);
graph_value_drop(l, i);
- }
+ }
}
static void graph_free_labels(struct graph *g)
flist_del(&i->list);
graph_free_values(i);
free(i);
- }
+ }
}
void graph_set_color(struct graph *gr, graph_label_t label, double red,
g->per_label_limit = per_label_limit;
}
-void graph_add_extra_space(struct graph *g, double left_percent, double right_percent,
- double top_percent, double bottom_percent)
+void graph_add_extra_space(struct graph *g, double left_percent,
+ double right_percent, double top_percent,
+ double bottom_percent)
{
- g->left_extra = left_percent;
- g->right_extra = right_percent;
- g->top_extra = top_percent;
- g->bottom_extra = bottom_percent;
+ g->left_extra = left_percent;
+ g->right_extra = right_percent;
+ g->top_extra = top_percent;
+ g->bottom_extra = bottom_percent;
}
/*
mask = -1UL;
else
mask = ((1UL << this_blocks) - 1) << bit;
-
+
if (!(f->file_map[idx] & mask))
break;
ret = 1;
}
}
-
+
if (!ret) {
if (offset != -1ULL)
io_u->offset = offset;
io_u_log_error(td, io_u);
}
if (icd->error && td_non_fatal_error(icd->error) &&
- (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
+ (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
/*
* If there is a non_fatal error, then add to the error count
* and clear all the errors.
out:
if (r >= 0) {
/*
- * Reflect that our submitted requests were retrieved with
+ * Reflect that our submitted requests were retrieved with
* whatever OS async calls are in the underlying engine.
*/
td->io_u_in_flight -= r;
if (!td->cur_depth || !td->io_u_queued)
return 0;
- io_u_mark_depth(td, td->io_u_queued);
+ io_u_mark_depth(td, td->io_u_queued);
if (td->io_ops->commit) {
ret = td->io_ops->commit(td);
if (ret)
td_verror(td, -ret, "io commit");
}
-
+
/*
* Reflect that events were submitted as async IO requests.
*/
ret = os_trim(f->fd, io_u->offset, io_u->xfer_buflen);
if (!ret)
- return io_u->xfer_buflen;;
+ return io_u->xfer_buflen;
io_u->error = ret;
return 0;
{
struct io_piece *ipo;
unsigned long elapsed;
-
+
while (!flist_empty(&td->io_log_list)) {
int ret;
elapsed = mtime_since_genesis();
if (ipo->delay > elapsed)
usec_sleep(td, (ipo->delay - elapsed) * 1000);
-
}
free(ipo);
-
+
if (io_u->ddir != DDIR_WAIT)
return 0;
}
ipo->fileno = fileno;
ipo->file_action = file_action;
}
-
+
queue_io_piece(td, ipo);
}
{
int base;
- switch(a) {
+ switch (a) {
case '0'...'9':
base = '0';
break;
default:
base = 0;
}
- return (a - base);
+ return a - base;
}
static int bs_cmp(const void *p1, const void *p2)
struct thread_data *td = data;
long off;
int i = 0, j = 0, len, k, base = 10;
- char* loc1, * loc2;
+ char *loc1, *loc2;
loc1 = strstr(input, "0x");
loc2 = strstr(input, "0X");
sprintf(buf, "echo '%s' | %s", tmp, BC_APP);
f = popen(buf, "r");
- if (!f) {
+ if (!f)
return NULL;
- }
ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
- if (ret <= 0) {
+ if (ret <= 0)
return NULL;
- }
pclose(f);
buf[(tmp - str) + ret - 1] = '\0';
extern struct opt_group *opt_group_from_mask(unsigned int *mask);
extern struct opt_group *opt_group_cat_from_mask(unsigned int *mask);
extern struct fio_option *fio_option_find(const char *name);
+extern unsigned int fio_get_kb_base(void *);
#endif
#include "options.h"
static struct fio_option *__fio_options;
-extern unsigned int fio_get_kb_base(void *);
static int vp_cmp(const void *p1, const void *p2)
{
static void show_option_range(struct fio_option *o,
int (*logger)(const char *format, ...))
{
- if (o->type == FIO_OPT_FLOAT_LIST){
+ if (o->type == FIO_OPT_FLOAT_LIST) {
if (isnan(o->minfp) && isnan(o->maxfp))
return;
int first, int more, int curr)
{
int il, *ilp;
- double* flp;
+ double *flp;
long long ull, *ullp;
long ul1, ul2;
double uf;
o->maxlen);
return 1;
}
- if(!str_to_float(ptr, &uf)){
+ if (!str_to_float(ptr, &uf)) {
log_err("not a floating point value: %s\n", ptr);
return 1;
}
cr = gtk_print_context_get_cairo_context(context);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_set_line_width (cr, 5.0);
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ cairo_set_line_width(cr, 5.0);
cairo_move_to(cr, 0.0, 0.0);
cairo_line_to(cr, print_params.width, print_params.height);
cairo_move_to(cr, 0.0, print_params.height);
y = print_params.height / 5.0;
sprintf(str, "(%g,%g)", x, y);
draw_right_justified_text(cr, "Sans", x, y, 12.0, str);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_set_line_width (cr, 2.0);
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ cairo_set_line_width(cr, 2.0);
cairo_move_to(cr, x, y - 30.0);
cairo_line_to(cr, x, y + 30.0);
cairo_move_to(cr, x - 30, y);
x *= 2.0;
sprintf(str, "(%g,%g)", x, y);
draw_right_justified_text(cr, "Sans", x, y, 12.0, str);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_set_line_width (cr, 2.0);
+ cairo_set_source_rgb(cr, 0, 0, 0);
+ cairo_set_line_width(cr, 2.0);
cairo_move_to(cr, x, y - 30.0);
cairo_line_to(cr, x, y + 30.0);
cairo_move_to(cr, x - 30, y);
static int add_profile_options(struct profile_ops *ops)
{
struct fio_option *o;
-
+
if (!ops->options)
return 0;
struct cmd_text_pdu *pdu = (struct cmd_text_pdu *) cmdret->payload;
char *buf = (char *) pdu->buf;
- buf[pdu->buf_len ] = '\0';
+ buf[pdu->buf_len] = '\0';
} else if (cmdret->opcode == FIO_NET_CMD_JOB) {
struct cmd_job_pdu *pdu = (struct cmd_job_pdu *) cmdret->payload;
char *buf = (char *) pdu->buf;
ret = handle_run_cmd(cmd);
break;
default:
- log_err("fio: unknown opcode: %s\n",fio_server_op(cmd->opcode));
+ log_err("fio: unknown opcode: %s\n", fio_server_op(cmd->opcode));
ret = 1;
}
if (!flist_empty(&job_list))
timeout = 100;
-
+
ret = poll(&pfd, 1, timeout);
if (ret < 0) {
if (errno == EINTR)
#if defined(WIN32)
WSADATA wsd;
- WSAStartup(MAKEWORD(2,2), &wsd);
+ WSAStartup(MAKEWORD(2, 2), &wsd);
#endif
if (!pidfile)
/*
* Discard the error bits and apply the mask to find the
- * index for the buckets in the group
+ * index for the buckets in the group
*/
offset = (FIO_IO_U_PLAT_VAL - 1) & (val >> error_bits);
/* Make sure the index does not exceed (array size - 1) */
- idx = (base + offset) < (FIO_IO_U_PLAT_NR - 1)?
+ idx = (base + offset) < (FIO_IO_U_PLAT_NR - 1) ?
(base + offset) : (FIO_IO_U_PLAT_NR - 1);
return idx;
/* MSB <= (FIO_IO_U_PLAT_BITS-1), cannot be rounded off. Use
* all bits of the sample as index */
- if (idx < (FIO_IO_U_PLAT_VAL << 1) )
+ if (idx < (FIO_IO_U_PLAT_VAL << 1))
return idx;
/* Find the group and compute the minimum value of that group */
- error_bits = (idx >> FIO_IO_U_PLAT_BITS) -1;
+ error_bits = (idx >> FIO_IO_U_PLAT_BITS) - 1;
base = 1 << (error_bits + FIO_IO_U_PLAT_BITS);
/* Find its bucket number of the group */
* isn't a worry. Also note that this does not work for NaN values.
*/
if (len > 1)
- qsort((void*)plist, len, sizeof(plist[0]), double_cmp);
+ qsort((void *)plist, len, sizeof(plist[0]), double_cmp);
/*
* Calculate bucket values, note down max and min values
}
static void show_thread_status_terse_v2(struct thread_stat *ts,
- struct group_run_stats *rs)
+ struct group_run_stats *rs)
{
double io_u_dist[FIO_IO_U_MAP_NR];
double io_u_lat_u[FIO_IO_U_LAT_U_NR];
#include <malloc.h>
#include <string.h>
-/*
+/*
* adapted from Paul Heckbert's algorithm on p 657-659 of
* Andrew S. Glassner's book, "Graphics Gems"
* ISBN 0-12-286166-3
printf("Testing range %g - %g\n", x, y);
nticks = calc_tickmarks(x, y, 10, &tm);
- for (i = 0; i < nticks; i++) {
+ for (i = 0; i < nticks; i++)
printf(" (%s) %g\n", tm[i].string, tm[i].value);
- }
+
printf("\n\n");
free(tm);
}
int main(int argc, char *argv[])
{
- test_range(0.0005, 0.008);
- test_range(0.5, 0.8);
- test_range(5.5, 8.8);
- test_range(50.5, 80.8);
- test_range(-20, 20.8);
- test_range(-30, 700.8);
+ test_range(0.0005, 0.008);
+ test_range(0.5, 0.8);
+ test_range(5.5, 8.8);
+ test_range(50.5, 80.8);
+ test_range(-20, 20.8);
+ test_range(-30, 700.8);
}
#endif