coresight: tmc: dump system memory content only when needed
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 3 May 2016 17:33:55 +0000 (11:33 -0600)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:46:39 +0000 (15:46 -0600)
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)

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

index bc0efc1e5b49dc4eec534f90e7eee12adf1eb968..b5e5e6ac67ebbc0b3589f0b77cb5c201a3e3d64e 100644 (file)
@@ -74,7 +74,12 @@ static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
        CS_UNLOCK(drvdata->base);
 
        tmc_flush_and_stop(drvdata);
-       tmc_etb_dump_hw(drvdata);
+       /*
+        * When operating in sysFS mode the content of the buffer needs to be
+        * read before the TMC is disabled.
+        */
+       if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
+               tmc_etb_dump_hw(drvdata);
        tmc_disable_hw(drvdata);
 
        CS_LOCK(drvdata->base);
index 0c107811a232e8e20548a52992c45f9f07a81ba9..7208584d0da7f4335d29c9daa7d81dd8203ed319 100644 (file)
@@ -76,7 +76,12 @@ static void tmc_etr_disable_hw(struct tmc_drvdata *drvdata)
        CS_UNLOCK(drvdata->base);
 
        tmc_flush_and_stop(drvdata);
-       tmc_etr_dump_hw(drvdata);
+       /*
+        * When operating in sysFS mode the content of the buffer needs to be
+        * read before the TMC is disabled.
+        */
+       if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
+               tmc_etr_dump_hw(drvdata);
        tmc_disable_hw(drvdata);
 
        CS_LOCK(drvdata->base);