Skip to content

Commit 182e8c7

Browse files
james-c-linaroSuzuki K Poulose
authored andcommitted
Coresight: Use coresight_etm_get_trace_id() in traceid_show()
Use the new API, coresight_etm_get_trace_id, to read the traceid of the ETM device when call traceid_show via sysfs node. Signed-off-by: James Clark <[email protected]> Reviewed-by: James Clark <[email protected]> Signed-off-by: Jie Gan <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c367a89 commit 182e8c7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/hwtracing/coresight/coresight-etm3x-sysfs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,10 +1190,9 @@ static DEVICE_ATTR_RO(cpu);
11901190
static ssize_t traceid_show(struct device *dev,
11911191
struct device_attribute *attr, char *buf)
11921192
{
1193-
int trace_id;
11941193
struct etm_drvdata *drvdata = dev_get_drvdata(dev->parent);
1194+
int trace_id = coresight_etm_get_trace_id(drvdata->csdev, CS_MODE_SYSFS, NULL);
11951195

1196-
trace_id = etm_read_alloc_trace_id(drvdata);
11971196
if (trace_id < 0)
11981197
return trace_id;
11991198

drivers/hwtracing/coresight/coresight-etm4x-sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Author: Mathieu Poirier <[email protected]>
55
*/
66

7+
#include <linux/coresight.h>
78
#include <linux/pid_namespace.h>
89
#include <linux/pm_runtime.h>
910
#include <linux/sysfs.h>
@@ -2402,10 +2403,9 @@ static ssize_t trctraceid_show(struct device *dev,
24022403
struct device_attribute *attr,
24032404
char *buf)
24042405
{
2405-
int trace_id;
24062406
struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
2407+
int trace_id = coresight_etm_get_trace_id(drvdata->csdev, CS_MODE_SYSFS, NULL);
24072408

2408-
trace_id = etm4_read_alloc_trace_id(drvdata);
24092409
if (trace_id < 0)
24102410
return trace_id;
24112411

0 commit comments

Comments
 (0)