lkml.org 
[lkml]   [2016]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFCv4 5/7] drivers/perf: arm_pmu: expose a cpumask in sysfs
On Fri, Sep 09, 2016 at 11:24:43AM +0100, Will Deacon wrote:
> On Thu, Sep 08, 2016 at 11:21:50AM +0100, Mark Rutland wrote:
> > +static ssize_t armpmu_cpumask_show(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct arm_pmu *armpmu = to_arm_pmu(dev_get_drvdata(dev));
> > + return cpumap_print_to_pagebuf(true, buf, &armpmu->supported_cpus);
> > +}
> > +
> > +static struct device_attribute armpmu_cpumask_attr =
> > + __ATTR(cpus, S_IRUGO, armpmu_cpumask_show, NULL);
>
> You can use the DEVICE_ATTR macro for this.

Ok. I've made use of this locally.

I'll send an updated version of the patches shortly, once I've given
this a spin on HW

Mark.

\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.110 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site