unsigned int len, i, j = 0;
unsigned int oval_len = 0;
unsigned long long *ovals = NULL;
- int is_last;
+ bool is_last;
*minv = -1ULL;
*maxv = 0;
/*
* Calculate bucket values, note down max and min values
*/
- is_last = 0;
+ is_last = false;
for (i = 0; i < FIO_IO_U_PLAT_NR && !is_last; i++) {
sum += io_u_plat[i];
while (sum >= (plist[j].u.f / 100.0 * nr)) {
if (ovals[j] > *maxv)
*maxv = ovals[j];
- is_last = (j == len - 1);
+ is_last = (j == len - 1) != 0;
if (is_last)
break;
unsigned int divisor, len, i, j = 0;
unsigned long long minv, maxv;
unsigned long long *ovals;
- int is_last, per_line, scale_down, time_width;
+ int per_line, scale_down, time_width;
const char *pre = is_clat ? "clat" : " lat";
+ bool is_last;
char fmt[32];
len = calc_clat_percentiles(io_u_plat, nr, plist, &ovals, &maxv, &minv);
log_buf(out, " |");
/* end of the list */
- is_last = (j == len - 1);
+ is_last = (j == len - 1) != 0;
for (i = 0; i < scale_down; i++)
ovals[j] = (ovals[j] + 999) / 1000;
}
}
-static int show_lat(double *io_u_lat, int nr, const char **ranges,
- const char *msg, struct buf_output *out)
+static bool show_lat(double *io_u_lat, int nr, const char **ranges,
+ const char *msg, struct buf_output *out)
{
- int new_line = 1, i, line = 0, shown = 0;
+ bool new_line = true, shown = false;
+ int i, line = 0;
for (i = 0; i < nr; i++) {
if (io_u_lat[i] <= 0.0)
continue;
- shown = 1;
+ shown = true;
if (new_line) {
if (line)
log_buf(out, "\n");
log_buf(out, " lat (%s) : ", msg);
- new_line = 0;
+ new_line = false;
line = 0;
}
if (line)
log_buf(out, "%s%3.2f%%", ranges[i], io_u_lat[i]);
line++;
if (line == 5)
- new_line = 1;
+ new_line = true;
}
if (shown)
log_buf(out, "\n");
- return shown;
+ return true;
}
static void show_lat_n(double *io_u_lat_n, struct buf_output *out)
struct thread_data *td;
struct thread_stat *threadstats, *ts;
int i, j, k, nr_ts, last_ts, idx;
- int kb_base_warned = 0;
- int unit_base_warned = 0;
+ bool kb_base_warned = false;
+ bool unit_base_warned = false;
struct json_object *root = NULL;
struct json_array *array = NULL;
struct buf_output output[FIO_OUTPUT_NR];
} else if (ts->kb_base != td->o.kb_base && !kb_base_warned) {
log_info("fio: kb_base differs for jobs in group, using"
" %u as the base\n", ts->kb_base);
- kb_base_warned = 1;
+ kb_base_warned = true;
} else if (ts->unit_base != td->o.unit_base && !unit_base_warned) {
log_info("fio: unit_base differs for jobs in group, using"
" %u as the base\n", ts->unit_base);
- unit_base_warned = 1;
+ unit_base_warned = true;
}
ts->continue_on_error = td->o.continue_on_error;
fio_mutex_up(stat_mutex);
}
-static int status_interval_init;
+static bool status_interval_init;
static struct timespec status_time;
-static int status_file_disabled;
+static bool status_file_disabled;
#define FIO_STATUS_FILE "fio-dump-status"
log_err("fio: failed to unlink %s: %s\n", fio_status_file_path,
strerror(errno));
log_err("fio: disabling status file updates\n");
- status_file_disabled = 1;
+ status_file_disabled = true;
}
return 1;
if (status_interval) {
if (!status_interval_init) {
fio_gettime(&status_time, NULL);
- status_interval_init = 1;
+ status_interval_init = true;
} else if (mtime_since_now(&status_time) >= status_interval) {
show_running_run_stats();
fio_gettime(&status_time, NULL);