Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mathieu Poirier and committed by
Greg Kroah-Hartman
adfad874 58b8d51b

+13
+13
drivers/hwtracing/coresight/coresight-etm3x.c
··· 1545 1545 } 1546 1546 static DEVICE_ATTR_RO(status); 1547 1547 1548 + static ssize_t cpu_show(struct device *dev, 1549 + struct device_attribute *attr, char *buf) 1550 + { 1551 + int val; 1552 + struct etm_drvdata *drvdata = dev_get_drvdata(dev->parent); 1553 + 1554 + val = drvdata->cpu; 1555 + return scnprintf(buf, PAGE_SIZE, "%d\n", val); 1556 + 1557 + } 1558 + static DEVICE_ATTR_RO(cpu); 1559 + 1548 1560 static ssize_t traceid_show(struct device *dev, 1549 1561 struct device_attribute *attr, char *buf) 1550 1562 { ··· 1633 1621 &dev_attr_timestamp_event.attr, 1634 1622 &dev_attr_status.attr, 1635 1623 &dev_attr_traceid.attr, 1624 + &dev_attr_cpu.attr, 1636 1625 NULL, 1637 1626 }; 1638 1627 ATTRIBUTE_GROUPS(coresight_etm);