On Mon, 25 Mar 2019 at 09:01, Suzuki K Poulose suzuki.poulose@arm.com wrote:
Mathieu,
On 06/03/2019 22:57, Mathieu Poirier wrote:
This patch makes the ETR component aware of the topology the HW is enacting so that it can make choices about the memory mode to use when working in CPU-wide scenarios.
Signed-off-by: Mathieu Poirier mathieu.poirier@linaro.org
.../hwtracing/coresight/coresight-tmc-etr.c | 19 +++++++++++++++++++ drivers/hwtracing/coresight/coresight-tmc.c | 2 ++ drivers/hwtracing/coresight/coresight-tmc.h | 2 ++ 3 files changed, 23 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index d8c71d22bdef..eace816ff042 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1276,6 +1276,22 @@ tmc_etr_setup_perf_buf(struct tmc_drvdata *drvdata, int node, pid_t pid, return etr_perf; }
+static int tmc_etr_is_shared(struct tmc_drvdata *drvdata,
struct list_head *path)
+{
int shared;
/* The HW topology is static, no need to check this twice */
if (drvdata->shared >= 0)
return 0;
shared = coresight_sink_is_shared(path);
if (shared == -EINVAL)
return shared;
drvdata->shared = shared;
return 0;
+}
static void *tmc_alloc_etr_buffer(struct list_head *path, int cpu, pid_t pid, void **pages, int nr_pages, @@ -1291,6 +1307,9 @@ static void *tmc_alloc_etr_buffer(struct list_head *path, int cpu,
drvdata = dev_get_drvdata(csdev->dev.parent);
if (tmc_etr_is_shared(drvdata, path))
return NULL;
So, we don't support tracing if the ETR is shared ? I am failing to understand the rationale of this whole "shared" check. Please could you elaborate ? And may be even add a comment here ?
That is very poor function naming on my side... I had to go back and look at my own code do understand what it does. Here tmc_etr_is_shared() reports the status of the process that determines if a sink is shared rather than the shared status of the sink. I would definitely fix that if we were to move ahead with this code but I thought we both agreed forcing double buffering is something that would be left for another day. As such 17 to 20 can be ignored.
Cheers Suzuki