From ad743db401637bd503d0466c94f735d92248be79 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 16 Aug 2016 23:17:26 -0600 Subject: [PATCH] steadystate: kill off ->attained Signed-off-by: Jens Axboe --- stat.c | 4 ++-- steadystate.c | 6 +++--- steadystate.h | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stat.c b/stat.c index 31042cab..d9147365 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->attained); + json_object_add_value_int(tmp, "attained", ss->mode & __FIO_SS_ATTAINED); snprintf(ss_buf, sizeof(ss_buf), "%f%s", (float) ss->criterion, ss->pct ? "%" : ""); json_object_add_value_string(tmp, "criterion", ss_buf); @@ -1294,7 +1294,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts, ** otherwise it actually points to the second element ** in the list */ - if (ss->attained || ss->sum_y == 0) + if ((ss->mode & __FIO_SS_ATTAINED) || ss->sum_y == 0) j = ss->head; else j = ss->head == 0 ? ss->dur - 1 : ss->head - 1; diff --git a/steadystate.c b/steadystate.c index c7a7e4c7..512500fd 100644 --- a/steadystate.c +++ b/steadystate.c @@ -209,7 +209,7 @@ void steadystate_check(void) struct steadystate_data *ss = &td->ss; if (!ss->dur || td->runstate <= TD_SETTING_UP || - td->runstate >= TD_EXITED || ss->attained) + td->runstate >= TD_EXITED || (ss->mode & __FIO_SS_ATTAINED)) continue; td_iops = 0; @@ -281,12 +281,12 @@ void steadystate_check(void) if (td->o.group_reporting) { for_each_td(td2, j) { if (td2->groupid == td->groupid) { - td2->ss.attained = 1; + td2->ss.mode |= __FIO_SS_ATTAINED; fio_mark_td_terminate(td2); } } } else { - ss->attained = 1; + ss->mode |= __FIO_SS_ATTAINED; fio_mark_td_terminate(td); } } diff --git a/steadystate.h b/steadystate.h index 86f975c8..3829ee41 100644 --- a/steadystate.h +++ b/steadystate.h @@ -19,7 +19,6 @@ struct steadystate_data { bool pct; unsigned int mode; - int attained; int last_in_group; int ramp_time_over; @@ -44,9 +43,10 @@ struct steadystate_data { }; enum { - __FIO_SS_IOPS = 1, - __FIO_SS_BW = 2, - __FIO_SS_SLOPE = 4, + __FIO_SS_IOPS = 1, + __FIO_SS_BW = 2, + __FIO_SS_SLOPE = 4, + __FIO_SS_ATTAINED = 8, FIO_SS_IOPS = __FIO_SS_IOPS, FIO_SS_IOPS_SLOPE = __FIO_SS_IOPS | __FIO_SS_SLOPE, -- 2.25.1