dst->sig_figs = src->sig_figs;
}
+/*
+ * Free the clat_prio_stat arrays allocated by alloc_clat_prio_stat_ddir().
+ */
+void free_clat_prio_stats(struct thread_stat *ts)
+{
+ enum fio_ddir ddir;
+
+ for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
+ sfree(ts->clat_prio[ddir]);
+ ts->clat_prio[ddir] = NULL;
+ ts->nr_clat_prio[ddir] = 0;
+ }
+}
+
+/*
+ * Allocate a clat_prio_stat array. The array has to be allocated/freed using
+ * smalloc/sfree, so that it is accessible by the process/thread summing the
+ * thread_stats.
+ */
+int alloc_clat_prio_stat_ddir(struct thread_stat *ts, enum fio_ddir ddir,
+ int nr_prios)
+{
+ struct clat_prio_stat *clat_prio;
+ int i;
+
+ clat_prio = scalloc(nr_prios, sizeof(*ts->clat_prio[ddir]));
+ if (!clat_prio) {
+ log_err("fio: failed to allocate ts clat data\n");
+ return 1;
+ }
+
+ for (i = 0; i < nr_prios; i++)
+ clat_prio[i].clat_stat.min_val = ULONG_MAX;
+
+ ts->clat_prio[ddir] = clat_prio;
+ ts->nr_clat_prio[ddir] = nr_prios;
+
+ return 0;
+}
+
void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src)
{
int k, l, m;
FIO_LAT_CNT = 3,
};
+struct clat_prio_stat {
+ uint64_t io_u_plat[FIO_IO_U_PLAT_NR];
+ struct io_stat clat_stat;
+ uint32_t ioprio;
+};
+
struct thread_stat {
char name[FIO_JOBNAME_SIZE];
char verror[FIO_VERROR_SIZE];
uint64_t pad5;
};
+ union {
+ struct clat_prio_stat *clat_prio[DDIR_RWDIR_CNT];
+ /*
+ * For FIO_NET_CMD_TS, the pointed to data will temporarily
+ * be stored at this offset from the start of the payload.
+ */
+ uint64_t clat_prio_offset[DDIR_RWDIR_CNT];
+ uint64_t pad6;
+ };
+ uint32_t nr_clat_prio[DDIR_RWDIR_CNT];
+
uint64_t cachehit;
uint64_t cachemiss;
} __attribute__((packed));
extern void add_sync_clat_sample(struct thread_stat *ts,
unsigned long long nsec);
extern int calc_log_samples(void);
+extern void free_clat_prio_stats(struct thread_stat *);
+extern int alloc_clat_prio_stat_ddir(struct thread_stat *, enum fio_ddir, int);
extern void print_disk_util(struct disk_util_stat *, struct disk_util_agg *, int terse, struct buf_output *);
extern void json_array_add_disk_util(struct disk_util_stat *dus,