Skip to contentSkip to conversation

perf/arm_dmc620: Add cpumask

PATCH Applied Xin Yang 3 participants 3 messages Jun 13, 2023 – Jun 16, 2023 Arm PMU profiling and debugging

lore
Share & tools
lore

Xin Yang

author
#0 lore raw

PATCH 1/1 perf/arm_dmc620: Add cpumask

Add a cpumask for the DMC620 PMU. As it is an uncore PMU, perf userspace tool only needs to open a single counter on the CPU specified by the CPU mask for each event on a given DMC620 device.

---
 drivers/perf/arm_dmc620_pmu.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/perf/arm_dmc620_pmu.c +22 -0
index 5de06f9a4dd3..9d0f01c4455a 100644
@@ -227,9 +227,31 @@ static const struct attribute_group dmc620_pmu_format_attr_group = {
 	.attrs	= dmc620_pmu_formats_attrs,
 };
 
+static ssize_t dmc620_pmu_cpumask_show(struct device *dev,
+				       struct device_attribute *attr, char *buf)
+{
+	struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(dev_get_drvdata(dev));
+
+	return cpumap_print_to_pagebuf(true, buf,
+				       cpumask_of(dmc620_pmu->irq->cpu));
+}
+
+static struct device_attribute dmc620_pmu_cpumask_attr =
+	__ATTR(cpumask, 0444, dmc620_pmu_cpumask_show, NULL);
+
+static struct attribute *dmc620_pmu_cpumask_attrs[] = {
+	&dmc620_pmu_cpumask_attr.attr,
+	NULL,
+};
+
+static const struct attribute_group dmc620_pmu_cpumask_attr_group = {
+	.attrs = dmc620_pmu_cpumask_attrs,
+};
+
 static const struct attribute_group *dmc620_pmu_attr_groups[] = {
 	&dmc620_pmu_events_attr_group,
 	&dmc620_pmu_format_attr_group,
+	&dmc620_pmu_cpumask_attr_group,
 	NULL,
 };
 
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Xin Yang

Add a cpumask for the DMC620 PMU. As it is an uncore PMU, perf userspace tool only needs to open a single counter on the CPU specified by the CPU mask for each event on a given DMC620 device.

Quoted 31 lines
---
  drivers/perf/arm_dmc620_pmu.c | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)
drivers/perf/arm_dmc620_pmu.c +18 -0
index 5de06f9a4dd3..9d0f01c4455a 100644
@@ -227,9 +227,31 @@ static const struct attribute_group dmc620_pmu_format_attr_group = {
  	.attrs	= dmc620_pmu_formats_attrs,
  };
 
+static ssize_t dmc620_pmu_cpumask_show(struct device *dev,
+				       struct device_attribute *attr, char *buf)
+{
+	struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(dev_get_drvdata(dev));
+
+	return cpumap_print_to_pagebuf(true, buf,
+				       cpumask_of(dmc620_pmu->irq->cpu));
+}
+
+static struct device_attribute dmc620_pmu_cpumask_attr =
+	__ATTR(cpumask, 0444, dmc620_pmu_cpumask_show, NULL);
+
+static struct attribute *dmc620_pmu_cpumask_attrs[] = {
+	&dmc620_pmu_cpumask_attr.attr,
+	NULL,
+};
+
+static const struct attribute_group dmc620_pmu_cpumask_attr_group = {

drivers/perf/arm_dmc620_pmu.c static const struct attribute_group dmc620_pmu_format_attr_group = { · line 257

Quoted 10 lines
drivers/perf/arm_dmc620_pmu.c +4 -0
+	.attrs = dmc620_pmu_cpumask_attrs,
+};
+
  static const struct attribute_group *dmc620_pmu_attr_groups[] = {
  	&dmc620_pmu_events_attr_group,
  	&dmc620_pmu_format_attr_group,
+	&dmc620_pmu_cpumask_attr_group,
  	NULL,
  };
 

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#2 lore raw
In reply to Xin Yang
Quoted 5 lines · Xin Yang

Add a cpumask for the DMC620 PMU. As it is an uncore PMU, perf userspace tool only needs to open a single counter on the CPU specified by the CPU mask for each event on a given DMC620 device.

Applied to will (for-next/perf), thanks!

[1/1] perf/arm_dmc620: Add cpumask

      https://git.kernel.org/will/c/95f5819738a7

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel