In some cases, the 100th percentile latency is not correctly identified
because of problems with double precision floating point arithmetic.
Use long doubles instead in the while loop condition to reduce the
likelihood of encountering this problem.
Also, print an error message when latency percentiles are not
successfully identified.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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;
}