coresight: etm3x: Don't trace PID for non-root PID namespace
authorLeo Yan <leo.yan@linaro.org>
Fri, 4 Feb 2022 15:24:03 +0000 (23:24 +0800)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 22 Feb 2022 16:00:27 +0000 (16:00 +0000)
commit2013b615a7a7e25dc2e43677dbfef12471cdccf8
tree26c981a1d3830fcb49621d95548a3ff9156d88cf
parent0f2be4cd06c7b046a9d64a2617cc64e60f4b45c2
coresight: etm3x: Don't trace PID for non-root PID namespace

ETMv3 driver enables PID tracing by directly using perf config from
userspace, this means the tracer will capture PID packets from root
namespace but the profiling session runs in non-root PID namespace.
Finally, the recorded packets can mislead perf reporting with the
mismatched PID values.

This patch changes to only enable PID tracing for root PID namespace.
Note, the hardware supports VMID tracing from ETMv3.5, but the driver
never enables VMID trace, this patch doesn't handle VMID trace (bit 30
in ETMCR register) particularly.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20220204152403.71775-5-leo.yan@linaro.org
drivers/hwtracing/coresight/coresight-etm3x-core.c