]> www.infradead.org Git - users/jedix/linux-maple.git/commit
coresight: Use per-sink trace ID maps for Perf sessions
authorJames Clark <james.clark@arm.com>
Mon, 22 Jul 2024 10:11:56 +0000 (11:11 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 20 Aug 2024 14:02:38 +0000 (15:02 +0100)
commit5ad628a7617607baac53745f8025638b967470a2
treeac7259ae97550bb7ca48f33614d77eb1ae48d416
parentd53c8253c7822fbc524adcd950e7c6de6a229c99
coresight: Use per-sink trace ID maps for Perf sessions

This will allow sessions with more than CORESIGHT_TRACE_IDS_MAX ETMs
as long as there are fewer than that many ETMs connected to each sink.

Each sink owns its own trace ID map, and any Perf session connecting to
that sink will allocate from it, even if the sink is currently in use by
other users. This is similar to the existing behavior where the dynamic
trace IDs are constant as long as there is any concurrent Perf session
active. It's not completely optimal because slightly more IDs will be
used than necessary, but the optimal solution involves tracking the PIDs
of each session and allocating ID maps based on the session owner. This
is difficult to do with the combination of per-thread and per-cpu modes
and some scheduling issues. The complexity of this isn't likely to worth
it because even with multiple users they'd just see a difference in the
ordering of ID allocations rather than hitting any limits (unless the
hardware does have too many ETMs connected to one sink).

Signed-off-by: James Clark <james.clark@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240722101202.26915-15-james.clark@linaro.org
drivers/hwtracing/coresight/coresight-core.c
drivers/hwtracing/coresight/coresight-dummy.c
drivers/hwtracing/coresight/coresight-etm-perf.c
drivers/hwtracing/coresight/coresight-etm3x-core.c
drivers/hwtracing/coresight/coresight-etm4x-core.c
drivers/hwtracing/coresight/coresight-stm.c
drivers/hwtracing/coresight/coresight-sysfs.c
drivers/hwtracing/coresight/coresight-tpdm.c
include/linux/coresight.h