On Thu, May 07, 2020 at 02:58:19PM +0800, Jin Yao wrote:

SNIP

> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index e0c1ad23c768..97ee941649e6 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -351,6 +351,16 @@ static void read_counters(struct timespec *rs)
>       }
>  }
>  
> +static void thread_stats_reset(struct perf_stat_config *config)
> +{
> +     int i;
> +
> +     if (config->stats) {
> +             for (i = 0; i < config->stats_num; i++)
> +                     perf_stat__reset_shadow_per_stat(&config->stats[i]);
> +     }
> +}
> +
>  static void process_interval(void)
>  {
>       struct timespec ts, rs;
> @@ -359,6 +369,7 @@ static void process_interval(void)
>       diff_timespec(&rs, &ts, &ref_time);
>  
>       perf_stat__reset_shadow_per_stat(&rt_stat);
> +     thread_stats_reset(&stat_config);

can't you call in here perf_stat__reset_stats?

and if not, I know it's threads related, but new
and delete functions are:

  runtime_stat_new, runtime_stat_delete

so let's call it runtime_stat_reset and place it next to
the new/delete functions

other than that it looks ok, thanks

jirka

>       read_counters(&rs);
>  
>       if (STAT_RECORD) {
> -- 
> 2.17.1
> 

Reply via email to