dst->members = le32_to_cpu(src->members);
dst->unified_rw_rep = le32_to_cpu(src->unified_rw_rep);
dst->ioprio = le32_to_cpu(src->ioprio);
+ dst->disable_prio_stat = le32_to_cpu(src->disable_prio_stat);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
convert_io_stat(&dst->clat_stat[i], &src->clat_stat[i]);
struct thread_data *td = sw->priv;
(*sum_cnt)++;
+
+ /*
+ * io_workqueue_update_acct_fn() doesn't support per prio stats, and
+ * even if it did, offload can't be used with all async IO engines.
+ * If group reporting is set in the parent td, the group result
+ * generated by __show_run_stats() can still contain multiple prios
+ * from different offloaded jobs.
+ */
+ sw->wq->td->ts.disable_prio_stat = 1;
sum_thread_stats(&sw->wq->td->ts, &td->ts);
fio_options_free(td);
p.ts.members = cpu_to_le32(ts->members);
p.ts.unified_rw_rep = cpu_to_le32(ts->unified_rw_rep);
p.ts.ioprio = cpu_to_le32(ts->ioprio);
+ p.ts.disable_prio_stat = cpu_to_le32(ts->disable_prio_stat);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
convert_io_stat(&p.ts.clat_stat[i], &ts->clat_stat[i]);
ts->groupid = -1;
}
+static void init_per_prio_stats(struct thread_stat *threadstats, int nr_ts)
+{
+ struct thread_data *td;
+ struct thread_stat *ts;
+ int i, j, last_ts, idx;
+ enum fio_ddir ddir;
+
+ j = 0;
+ last_ts = -1;
+ idx = 0;
+
+ /*
+ * Loop through all tds, if a td requires per prio stats, temporarily
+ * store a 1 in ts->disable_prio_stat, and then do an additional
+ * loop at the end where we invert the ts->disable_prio_stat values.
+ */
+ for_each_td(td, i) {
+ if (!td->o.stats)
+ continue;
+ if (idx &&
+ (!td->o.group_reporting ||
+ (td->o.group_reporting && last_ts != td->groupid))) {
+ idx = 0;
+ j++;
+ }
+
+ last_ts = td->groupid;
+ ts = &threadstats[j];
+
+ /* idx == 0 means first td in group, or td is not in a group. */
+ if (idx == 0)
+ ts->ioprio = td->ioprio;
+ else if (td->ioprio != ts->ioprio)
+ ts->disable_prio_stat = 1;
+
+ for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
+ if (td->ts.clat_prio[ddir]) {
+ ts->disable_prio_stat = 1;
+ break;
+ }
+ }
+
+ idx++;
+ }
+
+ /* Loop through all dst threadstats and fixup the values. */
+ for (i = 0; i < nr_ts; i++) {
+ ts = &threadstats[i];
+ ts->disable_prio_stat = !ts->disable_prio_stat;
+ }
+}
+
void __show_run_stats(void)
{
struct group_run_stats *runstats, *rs;
opt_lists[i] = NULL;
}
+ init_per_prio_stats(threadstats, nr_ts);
+
j = 0;
last_ts = -1;
idx = 0;