Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752373AbdLLUrp (ORCPT ); Tue, 12 Dec 2017 15:47:45 -0500 Received: from mga14.intel.com ([192.55.52.115]:9850 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbdLLUrl (ORCPT ); Tue, 12 Dec 2017 15:47:41 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,395,1508828400"; d="scan'208";a="11774423" Message-ID: <1513112639.11361.0.camel@megha-Z97X-UD7-TH> Subject: Re: [PATCH V2 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support From: Megha Dey To: Jiri Olsa Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, andriy.shevchenko@linux.intel.com, kstewart@linuxfoundation.org, yu-cheng.yu@intel.com, len.brown@intel.com, gregkh@linuxfoundation.org, peterz@infradead.org, acme@kernel.org, alexander.shishkin@linux.intel.com, namhyung@kernel.org, vikas.shivappa@linux.intel.com, pombredanne@nexb.com, me@kylehuey.com, bp@suse.de, grzegorz.andrejczuk@intel.com, tony.luck@intel.com, corbet@lwn.net, ravi.v.shankar@intel.com Date: Tue, 12 Dec 2017 13:03:59 -0800 In-Reply-To: <20171120141007.GB23281@krava> References: <1510970046-25387-1-git-send-email-megha.dey@linux.intel.com> <1510970046-25387-3-git-send-email-megha.dey@linux.intel.com> <20171120141007.GB23281@krava> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 38 On Mon, 2017-11-20 at 15:10 +0100, Jiri Olsa wrote: > On Fri, Nov 17, 2017 at 05:54:05PM -0800, Megha Dey wrote: > > SNIP > > > +/* Branch Monitoring default and mask values */ > > +#define BM_MAX_WINDOW_SIZE 0x3ff > > +#define BM_MAX_THRESHOLD 0x7f > > +#define BM_MAX_EVENTS 6 > > +#define BM_WINDOW_SIZE_SHIFT 8 > > +#define BM_THRESHOLD_SHIFT 8 > > +#define BM_EVENT_TYPE_SHIFT 1 > > +#define BM_GUEST_DISABLE_SHIFT 3 > > +#define BM_LBR_FREEZE_SHIFT 2 > > +#define BM_WINDOW_CNT_SEL_SHIFT 24 > > +#define BM_CNT_AND_MODE_SHIFT 26 > > +#define BM_MISPRED_EVT_CNT_SHIFT 15 > > +#define BM_ENABLE 0x3 > > +#define BM_CNTR_ENABLE 1 > > + > > +static unsigned int bm_window_size = BM_MAX_WINDOW_SIZE; > > +static unsigned int bm_guest_disable; > > +static unsigned int bm_lbr_freeze; > > +static unsigned int bm_window_cnt_sel; > > +static unsigned int bm_cnt_and_mode; > > + > > +static unsigned int bm_threshold = BM_MAX_THRESHOLD; > > +static unsigned int bm_mispred_evt_cnt; > > + > > +/* Branch monitoring counter owners */ > > +static struct perf_event **bm_counter_owner; > > that's still global.. 2 counters per system Yes, you are right . I will amend this in the next patch set. > > jirka