coresight: etm4x: Adds trace return stack option programming for ETMv4.
authorMike Leach <mike.leach@linaro.org>
Wed, 2 Aug 2017 16:22:03 +0000 (10:22 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:05:48 +0000 (16:05 +0200)
Adds handling to program the return stack option into ETMv4 hardware if
specified in the perf command line.

If option is not supported by the hardware then it will be ignored.
This allows capture to move between core/ETM combinations that have the
hardware support to those that do not.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-etm4x.c

index 532adc9dd32aa35d63a5a92b524846c8c5f06d4f..ac77b4c973d8791f0c9fbcd73728ca5e7e845d34 100644 (file)
@@ -224,6 +224,10 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
        if (attr->config & BIT(ETM_OPT_TS))
                /* bit[11], Global timestamp tracing bit */
                config->cfg |= BIT(11);
+       /* return stack - enable if selected and supported */
+       if ((attr->config & BIT(ETM_OPT_RETSTK)) && drvdata->retstack)
+               /* bit[12], Return stack enable bit */
+               config->cfg |= BIT(12);
 
 out:
        return ret;