summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2015-10-07 17:26:41 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-07 18:54:09 +0200
commitadfad8745c38d2bfe9e855f9d112a8583564112f (patch)
tree17371e83eddfc28d34b5cfab0cc1c6242ed35470 /drivers/hwtracing
parentcoresight: adding comments to remove ambiguity (diff)
downloadlinux-adfad8745c38d2bfe9e855f9d112a8583564112f.tar.xz
linux-adfad8745c38d2bfe9e855f9d112a8583564112f.zip
coresight: etm3x: adding cpu affinity to sysFS interface
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>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight-etm3x.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
index bf2476ed9356..4797f56e7f13 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x.c
@@ -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)
{
@@ -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);