- memset((void *)ts_lcl, 0, sizeof(struct thread_stat));
- /* calculate mixed stats */
- ts_lcl->unified_rw_rep = UNIFIED_MIXED;
- init_thread_stat_min_vals(ts_lcl);
-
- sum_thread_stats(ts_lcl, ts, 1);
-
- assert(ddir_rw(ddir));
-
- if (!ts_lcl->runtime[ddir]) {
- free(ts_lcl);
- return;
- }
-
- i2p = is_power_of_2(rs->kb_base);
- runt = ts_lcl->runtime[ddir];
-
- bw = (1000 * ts_lcl->io_bytes[ddir]) / runt;
- io_p = num2str(ts_lcl->io_bytes[ddir], ts->sig_figs, 1, i2p, N2S_BYTE);
- bw_p = num2str(bw, ts->sig_figs, 1, i2p, ts->unit_base);
- bw_p_alt = num2str(bw, ts->sig_figs, 1, !i2p, ts->unit_base);
-
- iops = (1000 * ts_lcl->total_io_u[ddir]) / runt;
- iops_p = num2str(iops, ts->sig_figs, 1, 0, N2S_NONE);
-
- log_buf(out, " mixed: IOPS=%s, BW=%s (%s)(%s/%llumsec)%s\n",
- iops_p, bw_p, bw_p_alt, io_p,
- (unsigned long long) ts_lcl->runtime[ddir],
- post_st ? : "");
-
- free(post_st);
- free(io_p);
- free(bw_p);
- free(bw_p_alt);
- free(iops_p);
-
- if (calc_lat(&ts_lcl->slat_stat[ddir], &min, &max, &mean, &dev))
- display_lat("slat", min, max, mean, dev, out);
- if (calc_lat(&ts_lcl->clat_stat[ddir], &min, &max, &mean, &dev))
- display_lat("clat", min, max, mean, dev, out);
- if (calc_lat(&ts_lcl->lat_stat[ddir], &min, &max, &mean, &dev))
- display_lat(" lat", min, max, mean, dev, out);
- if (calc_lat(&ts_lcl->clat_high_prio_stat[ddir], &min, &max, &mean, &dev)) {
- display_lat(ts_lcl->lat_percentiles ? "high prio_lat" : "high prio_clat",
- min, max, mean, dev, out);
- if (calc_lat(&ts_lcl->clat_low_prio_stat[ddir], &min, &max, &mean, &dev))
- display_lat(ts_lcl->lat_percentiles ? "low prio_lat" : "low prio_clat",
- min, max, mean, dev, out);
- }
-
- if (ts->slat_percentiles && ts_lcl->slat_stat[ddir].samples > 0)
- show_clat_percentiles(ts_lcl->io_u_plat[FIO_SLAT][ddir],
- ts_lcl->slat_stat[ddir].samples,
- ts->percentile_list,
- ts->percentile_precision, "slat", out);
- if (ts->clat_percentiles && ts_lcl->clat_stat[ddir].samples > 0)
- show_clat_percentiles(ts_lcl->io_u_plat[FIO_CLAT][ddir],
- ts_lcl->clat_stat[ddir].samples,
- ts->percentile_list,
- ts->percentile_precision, "clat", out);
- if (ts->lat_percentiles && ts_lcl->lat_stat[ddir].samples > 0)
- show_clat_percentiles(ts_lcl->io_u_plat[FIO_LAT][ddir],
- ts_lcl->lat_stat[ddir].samples,
- ts->percentile_list,
- ts->percentile_precision, "lat", out);
-
- if (ts->clat_percentiles || ts->lat_percentiles) {
- const char *name = ts->lat_percentiles ? "lat" : "clat";
- char prio_name[32];
- uint64_t samples;
-
- if (ts->lat_percentiles)
- samples = ts_lcl->lat_stat[ddir].samples;
- else
- samples = ts_lcl->clat_stat[ddir].samples;
-
- /* Only print if high and low priority stats were collected */
- if (ts_lcl->clat_high_prio_stat[ddir].samples > 0 &&
- ts_lcl->clat_low_prio_stat[ddir].samples > 0) {
- sprintf(prio_name, "high prio (%.2f%%) %s",
- 100. * (double) ts_lcl->clat_high_prio_stat[ddir].samples / (double) samples,
- name);
- show_clat_percentiles(ts_lcl->io_u_plat_high_prio[ddir],
- ts_lcl->clat_high_prio_stat[ddir].samples,
- ts->percentile_list,
- ts->percentile_precision, prio_name, out);
-
- sprintf(prio_name, "low prio (%.2f%%) %s",
- 100. * (double) ts_lcl->clat_low_prio_stat[ddir].samples / (double) samples,
- name);
- show_clat_percentiles(ts_lcl->io_u_plat_low_prio[ddir],
- ts_lcl->clat_low_prio_stat[ddir].samples,
- ts->percentile_list,
- ts->percentile_precision, prio_name, out);
- }