From: Andi Kleen <andi@firstfloor.org>
To: speck@linutronix.de
Cc: Andi Kleen <ak@linux.intel.com>
Subject: [MODERATED] [PATCH v3 1/6] PERFv3
Date: Thu, 7 Feb 2019 15:41:03 -0800 [thread overview]
Message-ID: <3c5756531a45ca9791a9c4bca295e92e063957ac.1549582769.git.ak@linux.intel.com> (raw)
In-Reply-To: <cover.1549582769.git.ak@linux.intel.com>
In-Reply-To: <cover.1549582769.git.ak@linux.intel.com>
From: Andi Kleen <ak@linux.intel.com>
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 <ak@linux.intel.com>
---
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
next prev parent reply other threads:[~2019-02-07 23:41 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 23:41 [MODERATED] [PATCH v3 0/6] PERFv3 Andi Kleen
2019-02-07 23:41 ` Andi Kleen [this message]
2019-02-08 8:45 ` [MODERATED] Re: [PATCH v3 1/6] PERFv3 Peter Zijlstra
2019-02-07 23:41 ` [MODERATED] [PATCH v3 2/6] PERFv3 Andi Kleen
2019-02-08 0:51 ` [MODERATED] Re: [SUSPECTED SPAM][PATCH " Andrew Cooper
2019-02-08 9:01 ` Peter Zijlstra
2019-02-08 9:31 ` [MODERATED] Re: [PATCH " Andrew Cooper
2019-02-08 9:39 ` [MODERATED] Re: [SUSPECTED SPAM][PATCH " Peter Zijlstra
2019-02-08 10:53 ` [MODERATED] [RFC][PATCH] performance walnuts Peter Zijlstra
2019-02-08 18:07 ` [MODERATED] " Andi Kleen
2019-02-11 10:40 ` Peter Zijlstra
2019-02-11 14:06 ` Thomas Gleixner
2019-02-11 20:17 ` [MODERATED] " Konrad Rzeszutek Wilk
2019-02-11 23:39 ` Thomas Gleixner
2019-02-09 0:28 ` [MODERATED] " Linus Torvalds
2019-02-09 4:34 ` Andi Kleen
2019-02-09 8:57 ` Peter Zijlstra
2019-02-13 2:56 ` mark gross
2019-02-15 17:32 ` mark gross
2019-02-15 17:44 ` Peter Zijlstra
2019-02-15 20:47 ` mark gross
2019-02-15 21:33 ` Thomas Gleixner
2019-02-19 13:35 ` [MODERATED] [RFC][PATCH v2] " Peter Zijlstra
2019-02-15 23:45 ` [MODERATED] Encrypted Message Jon Masters
2019-02-08 8:50 ` [MODERATED] Re: [PATCH v3 2/6] PERFv3 Peter Zijlstra
2019-02-08 17:26 ` Andi Kleen
2019-02-07 23:41 ` [MODERATED] [PATCH v3 3/6] PERFv3 Andi Kleen
2019-02-08 9:02 ` [MODERATED] " Peter Zijlstra
2019-02-07 23:41 ` [MODERATED] [PATCH v3 4/6] PERFv3 Andi Kleen
2019-02-07 23:41 ` [MODERATED] [PATCH v3 5/6] PERFv3 Andi Kleen
2019-02-08 0:54 ` [MODERATED] " Andrew Cooper
2019-02-07 23:41 ` [MODERATED] [PATCH v3 6/6] PERFv3 Andi Kleen
2019-02-08 9:07 ` [MODERATED] " Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3c5756531a45ca9791a9c4bca295e92e063957ac.1549582769.git.ak@linux.intel.com \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=speck@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).