[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ebc0dad-bd43-835d-e5c9-70f096174aec@linux.intel.com>
Date: Wed, 22 Nov 2017 10:11:24 +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 v1 3/9] perf util: Reconstruct rblist for supporting
per-thread shadow stats
On 11/21/2017 11:17 PM, Jiri Olsa wrote:
> On Mon, Nov 20, 2017 at 10:43:38PM +0800, Jin Yao wrote:
>
> SNIP
>
>> +static void init_saved_rblist(struct rblist *rblist)
>> +{
>> + rblist__init(rblist);
>> + rblist->node_cmp = saved_value_cmp;
>> + rblist->node_new = saved_value_new;
>> + rblist->node_delete = saved_value_delete;
>> +}
>> +
>> +static void free_saved_rblist(struct rblist *rblist)
>> +{
>> + rblist__reset(rblist);
>> +}
>> +
>> +void perf_stat__init_runtime_stat(struct runtime_stat *stat)
>> +{
>> + memset(stat, 0, sizeof(struct runtime_stat));
>> + init_saved_rblist(&stat->value_list);
>> +}
>> +
>> +void perf_stat__free_runtime_stat(struct runtime_stat *stat)
>> +{
>> + free_saved_rblist(&stat->value_list);
>> +}
>> +
>> void perf_stat__init_shadow_stats(void)
>> {
>> have_frontend_stalled = pmu_have_event("cpu", "stalled-cycles-frontend");
>> - rblist__init(&runtime_saved_values);
>> - runtime_saved_values.node_cmp = saved_value_cmp;
>> - runtime_saved_values.node_new = saved_value_new;
>> - /* No delete for now */
>> + memset(&walltime_nsecs_stats, 0, sizeof(walltime_nsecs_stats));
>
> why do you zero walltime_nsecs_stats in here?
>
> jirka
>
walltime_nsecs_stats is initialized in process_interval().
init_stats(&walltime_nsecs_stats);
Yes, the zero of walltime_nsecs_stats in perf_stat__init_shadow_stats
looks a bit redundant. I will remove it.
Thanks
Jin Yao
Powered by blists - more mailing lists