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)) {
+ while (sum >= ((long double) plist[j].u.f / 100.0 * nr)) {
assert(plist[j].u.f <= 100.0);
ovals[j] = plat_idx_to_val(i);
}
}
+ if (!is_last)
+ log_err("fio: error calculating latency percentiles\n");
+
*output = ovals;
return len;
}
len = 0;
percentile_object = json_create_object();
- json_object_add_value_object(tmp_object, "percentile", percentile_object);
+ if (ts->clat_percentiles)
+ json_object_add_value_object(tmp_object, "percentile", percentile_object);
for (i = 0; i < len; i++) {
snprintf(buf, sizeof(buf), "%f", ts->percentile_list[i].u.f);
json_object_add_value_int(percentile_object, (const char *)buf, ovals[i]);
json_object_add_value_int(tmp_object, "max", max);
json_object_add_value_float(tmp_object, "mean", mean);
json_object_add_value_float(tmp_object, "stddev", dev);
+ if (ts->lat_percentiles)
+ json_object_add_value_object(tmp_object, "percentile", percentile_object);
if (output_format & FIO_OUTPUT_JSON_PLUS && ts->lat_percentiles)
json_object_add_value_object(tmp_object, "bins", clat_bins_object);
dst->io_u_submit[k] += src->io_u_submit[k];
dst->io_u_complete[k] += src->io_u_complete[k];
}
- for (k = 0; k < FIO_IO_U_LAT_N_NR; k++) {
+
+ for (k = 0; k < FIO_IO_U_LAT_N_NR; k++)
dst->io_u_lat_n[k] += src->io_u_lat_n[k];
+ for (k = 0; k < FIO_IO_U_LAT_U_NR; k++)
dst->io_u_lat_u[k] += src->io_u_lat_u[k];
+ for (k = 0; k < FIO_IO_U_LAT_M_NR; k++)
dst->io_u_lat_m[k] += src->io_u_lat_m[k];
- }
+
for (k = 0; k < FIO_IO_U_PLAT_NR; k++)
dst->io_u_sync_plat[k] += src->io_u_sync_plat[k];