From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbdKTOKQ (ORCPT ); Mon, 20 Nov 2017 09:10:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51652 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751100AbdKTOKN (ORCPT ); Mon, 20 Nov 2017 09:10:13 -0500 Date: Mon, 20 Nov 2017 15:10:07 +0100 From: Jiri Olsa To: Megha Dey 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, megha.dey@intel.com Subject: Re: [PATCH V2 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510970046-25387-3-git-send-email-megha.dey@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.31]); Mon, 20 Nov 2017 14:10:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 jirka