display_lat("clat", min, max, mean, dev, out);
if (calc_lat(&ts->lat_stat[ddir], &min, &max, &mean, &dev))
display_lat(" lat", min, max, mean, dev, out);
- if (calc_lat(&ts->clat_high_prio_stat[ddir], &min, &max, &mean, &dev))
- display_lat("prio_clat", min, max, mean, dev, out);
+ if (calc_lat(&ts->clat_high_prio_stat[ddir], &min, &max, &mean, &dev)) {
+ display_lat(ts->lat_percentiles ? "high prio_lat" : "high prio_clat",
+ min, max, mean, dev, out);
+ if (calc_lat(&ts->clat_low_prio_stat[ddir], &min, &max, &mean, &dev))
+ display_lat(ts->lat_percentiles ? "low prio_lat" : "low prio_clat",
+ min, max, mean, dev, out);
+ }
if (ts->slat_percentiles && ts->slat_stat[ddir].samples > 0)
show_clat_percentiles(ts->io_u_plat[FIO_SLAT][ddir],
ts->percentile_precision, "lat", out);
if (ts->clat_percentiles || ts->lat_percentiles) {
- const char *name = ts->lat_percentiles ? " lat" : "clat";
+ const char *name = ts->lat_percentiles ? "lat" : "clat";
char prio_name[32];
uint64_t samples;
/* Only print this if some high and low priority stats were collected */
if (ts->clat_high_prio_stat[ddir].samples > 0 &&
- ts->clat_prio_stat[ddir].samples > 0)
+ ts->clat_low_prio_stat[ddir].samples > 0)
{
sprintf(prio_name, "high prio (%.2f%%) %s",
100. * (double) ts->clat_high_prio_stat[ddir].samples / (double) samples,
ts->percentile_precision, prio_name, out);
sprintf(prio_name, "low prio (%.2f%%) %s",
- 100. * (double) ts->clat_prio_stat[ddir].samples / (double) samples,
+ 100. * (double) ts->clat_low_prio_stat[ddir].samples / (double) samples,
name);
- show_clat_percentiles(ts->io_u_plat_prio[ddir],
- ts->clat_prio_stat[ddir].samples,
+ show_clat_percentiles(ts->io_u_plat_low_prio[ddir],
+ ts->clat_low_prio_stat[ddir].samples,
ts->percentile_list,
ts->percentile_precision, prio_name, out);
}
obj = json_create_object();
json_array_add_value_object(array, obj);
- json_object_add_value_string(obj, "name", dus->name);
+ json_object_add_value_string(obj, "name", (const char *)dus->name);
json_object_add_value_int(obj, "read_ios", dus->s.ios[0]);
json_object_add_value_int(obj, "write_ios", dus->s.ios[1]);
json_object_add_value_int(obj, "read_merges", dus->s.merges[0]);
const char *high, *low;
if (ts->lat_percentiles) {
- high = "lat_prio";
+ high = "lat_high_prio";
low = "lat_low_prio";
} else {
- high = "clat_prio";
+ high = "clat_high_prio";
low = "clat_low_prio";
}
json_object_add_value_object(dir_object, high, tmp_object);
tmp_object = add_ddir_lat_json(ts, ts->clat_percentiles | ts->lat_percentiles,
- &ts->clat_prio_stat[ddir], ts->io_u_plat_prio[ddir]);
+ &ts->clat_low_prio_stat[ddir], ts->io_u_plat_low_prio[ddir]);
json_object_add_value_object(dir_object, low, tmp_object);
}
json_object_add_value_object(root, name, dir_object);
flist_for_each(entry, opt_list) {
- const char *pos = "";
-
p = flist_entry(entry, struct print_option, list);
- if (p->value)
- pos = p->value;
- json_object_add_value_string(dir_object, p->name, pos);
+ json_object_add_value_string(dir_object, p->name, p->value);
}
}
if (!dst->unified_rw_rep) {
sum_stat(&dst->clat_stat[l], &src->clat_stat[l], first, false);
sum_stat(&dst->clat_high_prio_stat[l], &src->clat_high_prio_stat[l], first, false);
- sum_stat(&dst->clat_prio_stat[l], &src->clat_prio_stat[l], first, false);
+ sum_stat(&dst->clat_low_prio_stat[l], &src->clat_low_prio_stat[l], first, false);
sum_stat(&dst->slat_stat[l], &src->slat_stat[l], first, false);
sum_stat(&dst->lat_stat[l], &src->lat_stat[l], first, false);
sum_stat(&dst->bw_stat[l], &src->bw_stat[l], first, true);
dst->runtime[l] = src->runtime[l];
} else {
sum_stat(&dst->clat_stat[0], &src->clat_stat[l], first, false);
- sum_stat(&dst->clat_high_prio_stat[l], &src->clat_high_prio_stat[l], first, false);
- sum_stat(&dst->clat_prio_stat[l], &src->clat_prio_stat[l], first, false);
+ sum_stat(&dst->clat_high_prio_stat[0], &src->clat_high_prio_stat[l], first, false);
+ sum_stat(&dst->clat_low_prio_stat[0], &src->clat_low_prio_stat[l], first, false);
sum_stat(&dst->slat_stat[0], &src->slat_stat[l], first, false);
sum_stat(&dst->lat_stat[0], &src->lat_stat[l], first, false);
sum_stat(&dst->bw_stat[0], &src->bw_stat[l], first, true);
for (m = 0; m < FIO_IO_U_PLAT_NR; m++) {
if (!dst->unified_rw_rep) {
dst->io_u_plat_high_prio[k][m] += src->io_u_plat_high_prio[k][m];
- dst->io_u_plat_prio[k][m] += src->io_u_plat_prio[k][m];
+ dst->io_u_plat_low_prio[k][m] += src->io_u_plat_low_prio[k][m];
} else {
dst->io_u_plat_high_prio[0][m] += src->io_u_plat_high_prio[k][m];
- dst->io_u_plat_prio[0][m] += src->io_u_plat_prio[k][m];
+ dst->io_u_plat_low_prio[0][m] += src->io_u_plat_low_prio[k][m];
}
}
ts->bw_stat[j].min_val = -1UL;
ts->iops_stat[j].min_val = -1UL;
ts->clat_high_prio_stat[j].min_val = -1UL;
- ts->clat_prio_stat[j].min_val = -1UL;
+ ts->clat_low_prio_stat[j].min_val = -1UL;
}
ts->sync_stat.min_val = -1UL;
ts->groupid = -1;
fio_sem_up(stat_sem);
}
-static bool status_interval_init;
-static struct timespec status_time;
static bool status_file_disabled;
#define FIO_STATUS_FILE "fio-dump-status"
void check_for_running_stats(void)
{
- if (status_interval) {
- if (!status_interval_init) {
- fio_gettime(&status_time, NULL);
- status_interval_init = true;
- } else if (mtime_since_now(&status_time) >= status_interval) {
- show_running_run_stats();
- fio_gettime(&status_time, NULL);
- return;
- }
- }
if (check_status_file()) {
show_running_run_stats();
return;
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
reset_io_stat(&ts->clat_high_prio_stat[i]);
- reset_io_stat(&ts->clat_prio_stat[i]);
+ reset_io_stat(&ts->clat_low_prio_stat[i]);
reset_io_stat(&ts->clat_stat[i]);
reset_io_stat(&ts->slat_stat[i]);
reset_io_stat(&ts->lat_stat[i]);
for (j = 0; j < FIO_IO_U_PLAT_NR; j++) {
ts->io_u_plat_high_prio[i][j] = 0;
- ts->io_u_plat_prio[i][j] = 0;
+ ts->io_u_plat_low_prio[i][j] = 0;
if (!i)
ts->io_u_sync_plat[j] = 0;
}
return diff;
}
- _add_stat_to_log(iolog, elapsed, td->o.log_max != 0, priority_bit);
+ __add_stat_to_log(iolog, ddir, elapsed, td->o.log_max != 0, priority_bit);
iolog->avg_last[ddir] = elapsed - (this_window - iolog->avg_msec);
return iolog->avg_msec;
add_lat_percentile_sample_noprio(ts, nsec, ddir, lat);
if (!priority_bit)
- ts->io_u_plat_prio[ddir][idx]++;
+ ts->io_u_plat_low_prio[ddir][idx]++;
else
ts->io_u_plat_high_prio[ddir][idx]++;
}
add_stat_sample(&ts->clat_stat[ddir], nsec);
- if (priority_bit) {
- add_stat_sample(&ts->clat_high_prio_stat[ddir], nsec);
- } else {
- add_stat_sample(&ts->clat_prio_stat[ddir], nsec);
+ if (!ts->lat_percentiles) {
+ if (priority_bit)
+ add_stat_sample(&ts->clat_high_prio_stat[ddir], nsec);
+ else
+ add_stat_sample(&ts->clat_low_prio_stat[ddir], nsec);
}
if (td->clat_log)
add_log_sample(td, td->lat_log, sample_val(nsec), ddir, bs,
offset, priority_bit);
- if (ts->lat_percentiles)
+ if (ts->lat_percentiles) {
add_lat_percentile_sample(ts, nsec, ddir, priority_bit, FIO_LAT);
+ if (priority_bit)
+ add_stat_sample(&ts->clat_high_prio_stat[ddir], nsec);
+ else
+ add_stat_sample(&ts->clat_low_prio_stat[ddir], nsec);
+ }
if (needs_lock)
__td_io_u_unlock(td);
}