[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251112-james-cs-syncfreq-v4-4-165ba21401dc@linaro.org>
Date: Wed, 12 Nov 2025 15:22:10 +0000
From: James Clark <james.clark@...aro.org>
To: Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jonathan Corbet <corbet@....net>, Leo Yan <leo.yan@....com>
Cc: coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
James Clark <james.clark@...aro.org>
Subject: [PATCH v4 04/13] coresight: Hide unused ETMv3 format attributes
ETMv3 only has a few attributes, and setting unused ones results in an
error, so hide them to begin with.
Signed-off-by: James Clark <james.clark@...aro.org>
---
drivers/hwtracing/coresight/coresight-etm-perf.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
index 17afa0f4cdee..91132abca244 100644
--- a/drivers/hwtracing/coresight/coresight-etm-perf.c
+++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
@@ -106,8 +106,27 @@ static struct attribute *etm_config_formats_attr[] = {
NULL,
};
+static umode_t etm_format_attr_is_visible(struct kobject *kobj,
+ struct attribute *attr, int unused)
+{
+ /* ETM4 has all attributes */
+ if (IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X))
+ return attr->mode;
+
+ /* ETM3 only has these attributes */
+ if (attr == &format_attr_cycacc.attr ||
+ attr == &format_attr_timestamp.attr ||
+ attr == &format_attr_retstack.attr ||
+ attr == &format_attr_sinkid.attr ||
+ attr == &format_attr_configid.attr)
+ return attr->mode;
+
+ return 0;
+}
+
static const struct attribute_group etm_pmu_format_group = {
.name = "format",
+ .is_visible = etm_format_attr_is_visible,
.attrs = etm_config_formats_attr,
};
--
2.34.1
Powered by blists - more mailing lists