Skip to content

Commit 95f5819

Browse files
xinydevwilldeacon
authored andcommitted
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. Signed-off-by: Xin Yang <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent b1acb4e commit 95f5819

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/perf/arm_dmc620_pmu.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,31 @@ static const struct attribute_group dmc620_pmu_format_attr_group = {
227227
.attrs = dmc620_pmu_formats_attrs,
228228
};
229229

230+
static ssize_t dmc620_pmu_cpumask_show(struct device *dev,
231+
struct device_attribute *attr, char *buf)
232+
{
233+
struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(dev_get_drvdata(dev));
234+
235+
return cpumap_print_to_pagebuf(true, buf,
236+
cpumask_of(dmc620_pmu->irq->cpu));
237+
}
238+
239+
static struct device_attribute dmc620_pmu_cpumask_attr =
240+
__ATTR(cpumask, 0444, dmc620_pmu_cpumask_show, NULL);
241+
242+
static struct attribute *dmc620_pmu_cpumask_attrs[] = {
243+
&dmc620_pmu_cpumask_attr.attr,
244+
NULL,
245+
};
246+
247+
static const struct attribute_group dmc620_pmu_cpumask_attr_group = {
248+
.attrs = dmc620_pmu_cpumask_attrs,
249+
};
250+
230251
static const struct attribute_group *dmc620_pmu_attr_groups[] = {
231252
&dmc620_pmu_events_attr_group,
232253
&dmc620_pmu_format_attr_group,
254+
&dmc620_pmu_cpumask_attr_group,
233255
NULL,
234256
};
235257

0 commit comments

Comments
 (0)