diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-02-02 14:14:01 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 22:12:18 -0800 |
commit | 52210c8745e418f82f3f0aeeee01d7bc4858812a (patch) | |
tree | 9b9eb6173abfbc6735b15785c10d8f13f8121fa1 /drivers/hwtracing/coresight/coresight-etm4x.c | |
parent | b15f0fb657e040401d875d11ae13b269af8a16e0 (diff) | |
download | lwn-52210c8745e418f82f3f0aeeee01d7bc4858812a.tar.gz lwn-52210c8745e418f82f3f0aeeee01d7bc4858812a.zip |
coresight: implementing 'cpu_id()' API
Other than plainly parsing the device tree there is no way to
know which CPU a tracer is affined to. As such adding an
interface to lookup the CPU field enclosed in the etm_drvdata
structure that was initialised at boot time.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-etm4x.c')
-rw-r--r-- | drivers/hwtracing/coresight/coresight-etm4x.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 167004f9c42b..b6ae9cb6ff57 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -63,6 +63,13 @@ static bool etm4_arch_supported(u8 arch) return true; } +static int etm4_cpu_id(struct coresight_device *csdev) +{ + struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); + + return drvdata->cpu; +} + static int etm4_trace_id(struct coresight_device *csdev) { struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -262,6 +269,7 @@ static void etm4_disable(struct coresight_device *csdev) } static const struct coresight_ops_source etm4_source_ops = { + .cpu_id = etm4_cpu_id, .trace_id = etm4_trace_id, .enable = etm4_enable, .disable = etm4_disable, |