lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 8 May 2020 10:03:31 +0800
From:   "Jin, Yao" <yao.jin@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v3 1/4] perf stat: Fix wrong per-thread runtime stat for
 interval mode

Hi Jiri,

On 5/7/2020 11:19 PM, Jiri Olsa wrote:
> 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?
> 

If we call perf_stat__reset_stat here, it will reset the evsel->counts, but I 
don't think it's necessary. The counts will be updated in read_counts() soon.

> 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
>

Yes, that's good idea. I will create runtime_stat_reset and place it next to
untime_stat_new/runtime_stat_delete.

> other than that it looks ok, thanks
> 
> jirka
> 

Thanks!

Thanks
Jin Yao

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ