steadystate: kill off ->attained
authorJens Axboe <axboe@fb.com>
Wed, 17 Aug 2016 05:17:26 +0000 (23:17 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 17 Aug 2016 05:17:26 +0000 (23:17 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
stat.c
steadystate.c
steadystate.h

diff --git a/stat.c b/stat.c
index 31042cab8f7e6f510c54a5ec1391f0527134e984..d91473657f0ce8cd0378669ab85b674574cbfd40 100644 (file)
--- 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;
index c7a7e4c70195ac193ce7742adab8044f9cd745b9..512500fdd62e4b979ac0f31d13025a4d1f31212e 100644 (file)
@@ -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);
                        }
                }
index 86f975c8bac04b7021610e40e8311acdaffdfcca..3829ee412e95ae763a65b83ac6729b87f57ce661 100644 (file)
@@ -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,