From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585AbdKVMGL (ORCPT ); Wed, 22 Nov 2017 07:06:11 -0500 Received: from mga14.intel.com ([192.55.52.115]:24415 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423AbdKVMGJ (ORCPT ); Wed, 22 Nov 2017 07:06:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="5749373" Subject: Re: [PATCH v1 4/9] perf util: Update and print per-thread shadow stats To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <1511189024-19908-1-git-send-email-yao.jin@linux.intel.com> <1511189024-19908-5-git-send-email-yao.jin@linux.intel.com> <20171121151800.GI20440@krava> <20171122083721.GE30707@krava> From: "Jin, Yao" Message-ID: <9735a307-b51c-ab93-cf59-2acbabfce6cc@linux.intel.com> Date: Wed, 22 Nov 2017 20:06:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171122083721.GE30707@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/2017 4:37 PM, Jiri Olsa wrote: > On Wed, Nov 22, 2017 at 11:10:37AM +0800, Jin, Yao wrote: >> >> >> On 11/21/2017 11:18 PM, Jiri Olsa wrote: >>> On Mon, Nov 20, 2017 at 10:43:39PM +0800, Jin Yao wrote: >>> >>> SNIP >>> >>>> if (num == 0) >>>> diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c >>>> index 151e9ef..50bb16d 100644 >>>> --- a/tools/perf/util/stat.c >>>> +++ b/tools/perf/util/stat.c >>>> @@ -278,9 +278,16 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel >>>> perf_evsel__compute_deltas(evsel, cpu, thread, count); >>>> perf_counts_values__scale(count, config->scale, NULL); >>>> if (config->aggr_mode == AGGR_NONE) >>>> - perf_stat__update_shadow_stats(evsel, count->val, cpu); >>>> - if (config->aggr_mode == AGGR_THREAD) >>>> - perf_stat__update_shadow_stats(evsel, count->val, 0); >>>> + perf_stat__update_shadow_stats(evsel, count->val, cpu, >>>> + NULL); >>>> + if (config->aggr_mode == AGGR_THREAD) { >>>> + if (config->stats) >>>> + perf_stat__update_shadow_stats(evsel, >>>> + count->val, 0, &config->stats[thread]); >>> >>> please add this part together with config->stats allocation/usage >>> and keep this change only about adding the struct runtime_stat *stat >>> into the code path with no functional change >>> >>> thanks, >>> jirka >>> >> >> The interface of perf_stat__update_shadow_stats() is changed (added with a >> new parameter 'struct runtime_stat *stat'). >> >> If I move above part to another patch (e.g. move to >> v1-0006-perf-stat-Allocate-shadow-stats-buffer-for-thread.patch), the >> compilation would be failed if only applying with this patch. It's not good >> for git bisect. > > but you could make the patch just to add the 'struct runtime_stat *stat' > as an argument through the code path.. as a base for the stats, no? > > jirka > Yeah, that might be OK. Let me have a try. Thanks Jin Yao