Re: [PATCH 10/17] stat: increment members counter after call to sum_thread_stats()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/1/22 06:13, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@xxxxxxx>
> 
> 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@xxxxxxx>
> ---
>  stat.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/stat.c b/stat.c
> index 5aa6d588..ff33174e 100644
> --- 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;

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>


-- 
Damien Le Moal
Western Digital Research



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux