Skip to content

Commit

Permalink
coresight: etm3x: adding cpu affinity to sysFS interface
Browse files Browse the repository at this point in the history
Without access to the device tree, it is impossible to know
what CPU a tracer is affined to.  As such adding a new sysFS
interface to convey the information.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mathieu Poirier authored and Greg Kroah-Hartman committed Oct 7, 2015
1 parent 58b8d51 commit adfad87
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/hwtracing/coresight/coresight-etm3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,18 @@ static ssize_t status_show(struct device *dev,
}
static DEVICE_ATTR_RO(status);

static ssize_t cpu_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int val;
struct etm_drvdata *drvdata = dev_get_drvdata(dev->parent);

val = drvdata->cpu;
return scnprintf(buf, PAGE_SIZE, "%d\n", val);

}
static DEVICE_ATTR_RO(cpu);

static ssize_t traceid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -1621,6 +1633,7 @@ static struct attribute *coresight_etm_attrs[] = {
&dev_attr_timestamp_event.attr,
&dev_attr_status.attr,
&dev_attr_traceid.attr,
&dev_attr_cpu.attr,
NULL,
};
ATTRIBUTE_GROUPS(coresight_etm);
Expand Down

0 comments on commit adfad87

Please sign in to comment.