stat: increment members counter after call to sum_thread_stats()
authorNiklas Cassel <niklas.cassel@wdc.com>
Thu, 3 Feb 2022 19:28:29 +0000 (19:28 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 3 Feb 2022 22:30:06 +0000 (15:30 -0700)
Increment ts->members after the call to sum_thread_stats(), just like how
it's done in client.c and gclient.c.

There is no reason why stat.c should increment ts->members before calling
sum_thread_stats(). Change stat.c so that it is consistent with client.c
and gclient.c. This way, sum_thread_stats() could actually make use of
ts->members (if it wanted to), since it is now being updated consistently.

No logical change, as currently, ts->members is only used in
show_thread_status_normal(), which is always called after the call to
sum_thread_stats().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220203192814.18552-12-Niklas.Cassel@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.c

diff --git a/stat.c b/stat.c
index d7f7362b5de19896d22cc06f7bbaf90496a6eb8a..633415121c5b2951de27444e5ca4a0ff371ca828 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -2241,7 +2241,6 @@ void __show_run_stats(void)
                opt_lists[j] = &td->opt_list;
 
                idx++;
-               ts->members++;
 
                if (ts->groupid == -1) {
                        /*
@@ -2308,6 +2307,8 @@ void __show_run_stats(void)
 
                sum_thread_stats(ts, &td->ts);
 
+               ts->members++;
+
                if (td->o.ss_dur) {
                        ts->ss_state = td->ss.state;
                        ts->ss_dur = td->ss.dur;