linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Ravi Bangoria" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Ravi Bangoria <ravi.bangoria@amd.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute
Date: Wed, 11 May 2022 19:46:58 -0000	[thread overview]
Message-ID: <165229841825.4207.4646918223828683533.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220509044914.1473-5-ravi.bangoria@amd.com>

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     838de1d843fc9b6161e0e1c6308a8c027d08606d
Gitweb:        https://git.kernel.org/tip/838de1d843fc9b6161e0e1c6308a8c027d08606d
Author:        Ravi Bangoria <ravi.bangoria@amd.com>
AuthorDate:    Mon, 09 May 2022 10:19:10 +05:30
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 11 May 2022 16:27:10 +02:00

perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute

PMU driver can advertise certain feature via capability attribute('caps'
sysfs directory) which can be consumed by userspace tools like perf. Add
zen4_ibs_extensions capability attribute for IBS pmus. This attribute
will be enabled when CPUID_Fn8000001B_EAX[11] is set.

With patch on Zen4:

  $ ls /sys/bus/event_source/devices/ibs_op/caps
  zen4_ibs_extensions

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220509044914.1473-5-ravi.bangoria@amd.com
---
 arch/x86/events/amd/ibs.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 2dc8b7e..c251bc4 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -537,8 +537,14 @@ static struct attribute_group empty_format_group = {
 	.attrs = attrs_empty,
 };
 
+static struct attribute_group empty_caps_group = {
+	.name = "caps",
+	.attrs = attrs_empty,
+};
+
 static const struct attribute_group *empty_attr_groups[] = {
 	&empty_format_group,
+	&empty_caps_group,
 	NULL,
 };
 
@@ -546,6 +552,7 @@ PMU_FORMAT_ATTR(rand_en,	"config:57");
 PMU_FORMAT_ATTR(cnt_ctl,	"config:19");
 PMU_EVENT_ATTR_STRING(l3missonly, fetch_l3missonly, "config:59");
 PMU_EVENT_ATTR_STRING(l3missonly, op_l3missonly, "config:16");
+PMU_EVENT_ATTR_STRING(zen4_ibs_extensions, zen4_ibs_extensions, "1");
 
 static umode_t
 zen4_ibs_extensions_is_visible(struct kobject *kobj, struct attribute *attr, int i)
@@ -563,6 +570,11 @@ static struct attribute *fetch_l3missonly_attrs[] = {
 	NULL,
 };
 
+static struct attribute *zen4_ibs_extensions_attrs[] = {
+	&zen4_ibs_extensions.attr.attr,
+	NULL,
+};
+
 static struct attribute_group group_rand_en = {
 	.name = "format",
 	.attrs = rand_en_attrs,
@@ -574,13 +586,21 @@ static struct attribute_group group_fetch_l3missonly = {
 	.is_visible = zen4_ibs_extensions_is_visible,
 };
 
+static struct attribute_group group_zen4_ibs_extensions = {
+	.name = "caps",
+	.attrs = zen4_ibs_extensions_attrs,
+	.is_visible = zen4_ibs_extensions_is_visible,
+};
+
 static const struct attribute_group *fetch_attr_groups[] = {
 	&group_rand_en,
+	&empty_caps_group,
 	NULL,
 };
 
 static const struct attribute_group *fetch_attr_update[] = {
 	&group_fetch_l3missonly,
+	&group_zen4_ibs_extensions,
 	NULL,
 };
 
@@ -615,6 +635,7 @@ static struct attribute_group group_op_l3missonly = {
 static const struct attribute_group *op_attr_update[] = {
 	&group_cnt_ctl,
 	&group_op_l3missonly,
+	&group_zen4_ibs_extensions,
 	NULL,
 };
 

  reply	other threads:[~2022-05-11 19:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09  4:49 [PATCH v2 0/8] perf/amd: Zen4 IBS extensions support Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 1/8] perf/amd/ibs: Cascade pmu init functions' return value Ravi Bangoria
2022-05-11 19:47   ` [tip: perf/core] " tip-bot2 for Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 2/8] perf/amd/ibs: Use ->is_visible callback for dynamic attributes Ravi Bangoria
2022-05-11 19:47   ` [tip: perf/core] " tip-bot2 for Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 3/8] perf/amd/ibs: Add support for L3 miss filtering Ravi Bangoria
2022-05-09 12:05   ` Peter Zijlstra
2022-05-09 12:35     ` Ravi Bangoria
2022-05-09 13:07       ` Peter Zijlstra
2022-05-11 19:46   ` [tip: perf/core] " tip-bot2 for Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 4/8] perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute Ravi Bangoria
2022-05-11 19:46   ` tip-bot2 for Ravi Bangoria [this message]
2022-05-09  4:49 ` [PATCH v2 5/8] perf record ibs: Warn about sampling period skew Ravi Bangoria
2022-05-16 13:22   ` Arnaldo Carvalho de Melo
2022-05-16 13:27     ` Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 6/8] perf header: Parse non-cpu pmu capabilities Ravi Bangoria
2022-05-16  4:15   ` Ravi Bangoria
2022-05-16 12:53     ` Arnaldo Carvalho de Melo
2022-05-16 13:28   ` Arnaldo Carvalho de Melo
2022-05-16 13:46     ` Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 7/8] perf script ibs: Support new IBS bits in raw trace dump Ravi Bangoria
2022-05-16 13:29   ` Arnaldo Carvalho de Melo
2022-05-16 13:47     ` Ravi Bangoria
2022-05-09  4:49 ` [PATCH v2 8/8] perf ibs: Fix comment Ravi Bangoria
2022-05-11 19:46   ` [tip: perf/core] perf/ibs: " tip-bot2 for Ravi Bangoria

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=165229841825.4207.4646918223828683533.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=x86@kernel.org \
    /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 NNTP newsgroup(s).