From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 07 Feb 2019 23:12:00 -0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1grspq-0005wZ-Uh for speck@linutronix.de; Fri, 08 Feb 2019 00:11:59 +0100 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x17N9een049660 for ; Thu, 7 Feb 2019 23:11:50 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2qd97f9vxa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 07 Feb 2019 23:11:50 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x17NBmEc007011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 7 Feb 2019 23:11:49 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x17NBmQr012254 for ; Thu, 7 Feb 2019 23:11:48 GMT Date: Thu, 7 Feb 2019 18:11:47 -0500 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [PATCH v2 1/8] PERFv2 Message-ID: <20190207231147.GA19131@char.us.oracle.com> References: <3c5756531a45ca9791a9c4bca295e92e063957ac.1549416008.git.ak@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <3c5756531a45ca9791a9c4bca295e92e063957ac.1549416008.git.ak@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, Feb 05, 2019 at 05:23:55PM -0800, speck for Andi Kleen wrote: > From: Andi Kleen > Subject: x86/pmu/intel: Export number of counters in caps > > Export the number of generic and fixed counters in the core PMU in caps/ > This helps users and tools with constructing groups. Will be also more > important with upcoming patches that can change the number of counters. > > Signed-off-by: Andi Kleen Reviewed-by: Konrad Rzeszutek Wilk > --- > arch/x86/events/core.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > index 374a19712e20..58e659bfc2d9 100644 > --- a/arch/x86/events/core.c > +++ b/arch/x86/events/core.c > @@ -2248,8 +2248,28 @@ static ssize_t max_precise_show(struct device *cdev, > > static DEVICE_ATTR_RO(max_precise); > > +static ssize_t num_counter_show(struct device *cdev, > + struct device_attribute *attr, > + char *buf) > +{ > + return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu.num_counters); > +} > + > +static DEVICE_ATTR_RO(num_counter); > + > +static ssize_t num_counter_fixed_show(struct device *cdev, > + struct device_attribute *attr, > + char *buf) > +{ > + return snprintf(buf, PAGE_SIZE, "%d\n", x86_pmu.num_counters_fixed); > +} > + > +static DEVICE_ATTR_RO(num_counter_fixed); > + > static struct attribute *x86_pmu_caps_attrs[] = { > &dev_attr_max_precise.attr, > + &dev_attr_num_counter.attr, > + &dev_attr_num_counter_fixed.attr, > NULL > }; > > -- > 2.17.2