From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbdKUPRp (ORCPT ); Tue, 21 Nov 2017 10:17:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdKUPRn (ORCPT ); Tue, 21 Nov 2017 10:17:43 -0500 Date: Tue, 21 Nov 2017 16:17:40 +0100 From: Jiri Olsa To: Jin Yao 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 Subject: Re: [PATCH v1 5/9] perf util: Remove a set of shadow stats static variables Message-ID: <20171121151740.GG20440@krava> References: <1511189024-19908-1-git-send-email-yao.jin@linux.intel.com> <1511189024-19908-6-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1511189024-19908-6-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 21 Nov 2017 15:17:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 10:43:40PM +0800, Jin Yao wrote: > In previous patches, we have reconstructed the code and let > it not access the static variables directly. > > This patch removes these static variables. > > Signed-off-by: Jin Yao > --- > tools/perf/util/stat-shadow.c | 64 ++++++++++--------------------------------- > tools/perf/util/stat.h | 1 + > 2 files changed, 16 insertions(+), 49 deletions(-) > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > index 6f28782..74bcc4d 100644 > --- a/tools/perf/util/stat-shadow.c > +++ b/tools/perf/util/stat-shadow.c > @@ -16,28 +16,6 @@ > * AGGR_NONE: Use matching CPU > * AGGR_THREAD: Not supported? > */ > -static struct stats runtime_nsecs_stats[MAX_NR_CPUS]; > -static struct stats runtime_cycles_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_stalled_cycles_front_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_stalled_cycles_back_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_branches_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_cacherefs_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_l1_dcache_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_l1_icache_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_ll_cache_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_itlb_cache_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_dtlb_cache_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_cycles_in_tx_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_transaction_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_elision_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_topdown_total_slots[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_topdown_slots_issued[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_topdown_slots_retired[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_topdown_fetch_bubbles[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_topdown_recovery_bubbles[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_smi_num_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct stats runtime_aperf_stats[NUM_CTX][MAX_NR_CPUS]; > -static struct rblist runtime_saved_values; > static bool have_frontend_stalled; all this is about switching from array to rb_list for the --per-thread case, which can be considered as a special use case.. how much do we suffer in performance with new code? how about the "perf stat -I 100", would it scale ok for extreme cases (many events in -e or -dddd..) jirka