- if (o->ss_dur) {
- steadystate = true;
- o->ss_dur /= 1000000L;
-
- /* put all steady state info in one place */
- td->ss.dur = o->ss_dur;
- td->ss.limit = o->ss_limit.u.f;
- td->ss.ramp_time = o->ss_ramp_time;
- td->ss.pct = o->ss_pct;
-
- if (o->ss == FIO_STEADYSTATE_IOPS_SLOPE || o->ss == FIO_STEADYSTATE_BW_SLOPE) {
- td->ss.check_slope = true;
- td->ss.evaluate = &steadystate_slope;
- } else {
- td->ss.check_slope = false;
- td->ss.evaluate = &steadystate_deviation;
- }
-
- if (o->ss == FIO_STEADYSTATE_IOPS || o->ss == FIO_STEADYSTATE_IOPS_SLOPE)
- td->ss.check_iops = true;
- else
- td->ss.check_iops = false;
-
-
- /* when group reporting is enabled only the cache allocated for the final td is actually used */
- td->ss.cache = malloc(o->ss_dur * sizeof(*(td->ss.cache)));
- if (td->ss.cache == NULL)
- {
- log_err("fio: unable to allocate memory for steadystate cache\n");
- goto err;
- }
- for (i = 0; i < td->ss.dur; i++)
- td->ss.cache[i] = 0;
- /* initialize so that it is obvious if the cache is not full in the output */
-
- td->ss.ramp_time_over = (td->ss.ramp_time == 0);
- td->ss.attained = 0;
- td->ss.last_in_group = 0;
- td->ss.head = 0;
- td->ss.tail = 0;
- td->ss.sum_x = o->ss_dur * (o->ss_dur - 1) / 2;
- td->ss.sum_x_sq = (o->ss_dur - 1) * (o->ss_dur) * (2*o->ss_dur - 1) / 6;
- td->ss.prev_bytes = 0;
- td->ss.prev_iops = 0;
- td->ss.sum_y = 0;
- td->ss.oldest_y = 0;
- td->ss.criterion = 0.0;
- td->ts.ss = &td->ss;
- }
- else
- td->ts.ss = NULL;