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;
}
/* Additional output if continue_on_error set - default off*/
if (ts->continue_on_error)
log_buf(out, ";%llu;%d", (unsigned long long) ts->total_err_count, ts->first_error);
- if (ver == 2)
- log_buf(out, "\n");
/* Additional output if description is set */
- if (strlen(ts->description))
+ if (strlen(ts->description)) {
+ if (ver == 2)
+ log_buf(out, "\n");
log_buf(out, ";%s", ts->description);
+ }
log_buf(out, "\n");
}
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];
/*
* These are per-group shared already
*/
- strncpy(ts->name, td->o.name, FIO_JOBNAME_SIZE - 1);
+ snprintf(ts->name, sizeof(ts->name), "%s", td->o.name);
if (td->o.description)
- strncpy(ts->description, td->o.description,
- FIO_JOBDESC_SIZE - 1);
+ snprintf(ts->description,
+ sizeof(ts->description), "%s",
+ td->o.description);
else
memset(ts->description, 0, FIO_JOBDESC_SIZE);
if (!td->error && td->o.continue_on_error &&
td->first_error) {
ts->error = td->first_error;
- ts->verror[sizeof(ts->verror) - 1] = '\0';
- strncpy(ts->verror, td->verror, sizeof(ts->verror) - 1);
+ snprintf(ts->verror, sizeof(ts->verror), "%s",
+ td->verror);
} else if (td->error) {
ts->error = td->error;
- ts->verror[sizeof(ts->verror) - 1] = '\0';
- strncpy(ts->verror, td->verror, sizeof(ts->verror) - 1);
+ snprintf(ts->verror, sizeof(ts->verror), "%s",
+ td->verror);
}
}
io_u_plat = (uint64_t *) td->ts.io_u_plat[ddir];
dst = malloc(sizeof(struct io_u_plat_entry));
memcpy(&(dst->io_u_plat), io_u_plat,
- FIO_IO_U_PLAT_NR * sizeof(unsigned int));
+ FIO_IO_U_PLAT_NR * sizeof(uint64_t));
flist_add(&dst->list, &hw->list);
__add_log_sample(iolog, sample_plat(dst), ddir, bs,
elapsed, offset);