+ dst->mean.u.f = mean;
+ dst->S.u.f = S;
+}
+
+void sum_group_stats(struct group_run_stats *dst, struct group_run_stats *src)
+{
+ int i;
+
+ for (i = 0; i < 2; i++) {
+ if (dst->max_run[i] < src->max_run[i])
+ dst->max_run[i] = src->max_run[i];
+ if (dst->min_run[i] && dst->min_run[i] > src->min_run[i])
+ dst->min_run[i] = src->min_run[i];
+ if (dst->max_bw[i] < src->max_bw[i])
+ dst->max_bw[i] = src->max_bw[i];
+ if (dst->min_bw[i] && dst->min_bw[i] > src->min_bw[i])
+ dst->min_bw[i] = src->min_bw[i];
+
+ dst->io_kb[i] += src->io_kb[i];
+ dst->agg[i] += src->agg[i];
+ }
+
+}
+
+void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src, int nr)
+{
+ int l, k;
+
+ for (l = 0; l <= DDIR_WRITE; l++) {
+ sum_stat(&dst->clat_stat[l], &src->clat_stat[l], nr);
+ sum_stat(&dst->slat_stat[l], &src->slat_stat[l], nr);
+ sum_stat(&dst->lat_stat[l], &src->lat_stat[l], nr);
+ sum_stat(&dst->bw_stat[l], &src->bw_stat[l], nr);
+
+ dst->io_bytes[l] += src->io_bytes[l];
+
+ if (dst->runtime[l] < src->runtime[l])
+ dst->runtime[l] = src->runtime[l];
+ }
+
+ dst->usr_time += src->usr_time;
+ dst->sys_time += src->sys_time;
+ dst->ctx += src->ctx;
+ dst->majf += src->majf;
+ dst->minf += src->minf;
+
+ for (k = 0; k < FIO_IO_U_MAP_NR; k++)
+ dst->io_u_map[k] += src->io_u_map[k];
+ for (k = 0; k < FIO_IO_U_MAP_NR; k++)
+ dst->io_u_submit[k] += src->io_u_submit[k];
+ for (k = 0; k < FIO_IO_U_MAP_NR; k++)
+ dst->io_u_complete[k] += src->io_u_complete[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 <= 2; k++) {
+ dst->total_io_u[k] += src->total_io_u[k];
+ dst->short_io_u[k] += src->short_io_u[k];
+ }
+
+ for (k = 0; k <= DDIR_WRITE; k++) {
+ int m;
+ for (m = 0; m < FIO_IO_U_PLAT_NR; m++)
+ dst->io_u_plat[k][m] += src->io_u_plat[k][m];
+ }
+
+ dst->total_run_time += src->total_run_time;
+ dst->total_submit += src->total_submit;
+ dst->total_complete += src->total_complete;
+}
+
+void init_group_run_stat(struct group_run_stats *gs)
+{
+ memset(gs, 0, sizeof(*gs));
+ gs->min_bw[0] = gs->min_run[0] = ~0UL;
+ gs->min_bw[1] = gs->min_run[1] = ~0UL;
+}
+
+void init_thread_stat(struct thread_stat *ts)
+{
+ int j;
+
+ memset(ts, 0, sizeof(*ts));
+
+ for (j = 0; j <= DDIR_WRITE; j++) {
+ ts->lat_stat[j].min_val = -1UL;
+ ts->clat_stat[j].min_val = -1UL;
+ ts->slat_stat[j].min_val = -1UL;
+ ts->bw_stat[j].min_val = -1UL;
+ }
+ ts->groupid = -1;