Skip to content

Commit 29b1d26

Browse files
coresight: tmc: dump system memory content only when needed
Calling tmc_etf/etr_dump_hw() is required only when operating from sysFS. When working from Perf, the system memory is harvested from the AUX trace API. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit a40318fb01e98e72175bd9891208541148633d42)
1 parent cc878b6 commit 29b1d26

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

drivers/hwtracing/coresight/coresight-tmc-etf.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
7474
CS_UNLOCK(drvdata->base);
7575

7676
tmc_flush_and_stop(drvdata);
77-
tmc_etb_dump_hw(drvdata);
77+
/*
78+
* When operating in sysFS mode the content of the buffer needs to be
79+
* read before the TMC is disabled.
80+
*/
81+
if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
82+
tmc_etb_dump_hw(drvdata);
7883
tmc_disable_hw(drvdata);
7984

8085
CS_LOCK(drvdata->base);

drivers/hwtracing/coresight/coresight-tmc-etr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ static void tmc_etr_disable_hw(struct tmc_drvdata *drvdata)
7676
CS_UNLOCK(drvdata->base);
7777

7878
tmc_flush_and_stop(drvdata);
79-
tmc_etr_dump_hw(drvdata);
79+
/*
80+
* When operating in sysFS mode the content of the buffer needs to be
81+
* read before the TMC is disabled.
82+
*/
83+
if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
84+
tmc_etr_dump_hw(drvdata);
8085
tmc_disable_hw(drvdata);
8186

8287
CS_LOCK(drvdata->base);

0 commit comments

Comments
 (0)