From: Vincent Fu Date: Thu, 27 Oct 2016 20:36:43 +0000 (-0400) Subject: steadystate: bug fixes X-Git-Tag: fio-2.16~3^2~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=94f218f6e5ef1eb2bc9190f72df5c8d105e0bac3;p=fio.git steadystate: bug fixes 1) Fix steadystate option parsing callback bug 2) Re-insert missing multiplier in slope calculation 3) Revert 'attained' in the JSON output to be either 0 or 1 --- diff --git a/options.c b/options.c index 6f3752fa..3af604bd 100644 --- a/options.c +++ b/options.c @@ -1063,7 +1063,7 @@ static int str_random_distribution_cb(void *data, const char *str) static int str_steadystate_cb(void *data, const char *str) { - struct thread_data *td = data; + struct thread_data *td = cb_data_to_td(data); double val; char *nr; char *pct; diff --git a/stat.c b/stat.c index 0eb87bdb..c41ac899 100644 --- a/stat.c +++ b/stat.c @@ -1276,7 +1276,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts, json_object_add_value_string(tmp, "ss", ss_buf); json_object_add_value_int(tmp, "duration", (int)ss->dur); json_object_add_value_int(tmp, "steadystate_ramptime", ss->ramp_time / 1000000L); - json_object_add_value_int(tmp, "attained", ss->state & __FIO_SS_ATTAINED); + json_object_add_value_int(tmp, "attained", (ss->state & __FIO_SS_ATTAINED) > 0); snprintf(ss_buf, sizeof(ss_buf), "%f%s", (float) ss->criterion, ss->pct ? "%" : ""); json_object_add_value_string(tmp, "criterion", ss_buf); diff --git a/steadystate.c b/steadystate.c index 235deac5..1f53ae46 100644 --- a/steadystate.c +++ b/steadystate.c @@ -84,9 +84,9 @@ static bool steadystate_slope(unsigned long iops, unsigned long bw, if (j >= ss->dur) j -= ss->dur; if (ss->state & __FIO_SS_IOPS) - ss->sum_xy += ss->iops_data[j]; + ss->sum_xy += i * ss->iops_data[j]; else - ss->sum_xy += ss->bw_data[j]; + ss->sum_xy += i * ss->bw_data[j]; } } else { /* easy to update the sums */ ss->sum_y -= ss->oldest_y;