coresight: etm4x: Update ETM4 driver to use Trace ID API
authorMike Leach <mike.leach@linaro.org>
Mon, 16 Jan 2023 12:49:18 +0000 (12:49 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Thu, 19 Jan 2023 10:16:47 +0000 (10:16 +0000)
commitdf4871204e5de97e47959f826e9cd2e76b41f969
tree22f402df01c90ff0f4a74538a2734e8aadd32902
parent8d1091c785e1599cccb3d14c54c79e4d7e325220
coresight: etm4x: Update ETM4 driver to use Trace ID API

The trace ID API is now used to allocate trace IDs for ETM4.x / ETE
devices.

For perf sessions, these will be allocated on enable, and released on
disable.

For sysfs sessions, these will be allocated on enable, but only released
on reset. This allows the sysfs session to interrogate the Trace ID used
after the session is over - maintaining functional consistency with the
previous allocation scheme.

The trace ID will also be allocated on read of the mgmt/trctraceid file.
This ensures that if perf or sysfs read this before enabling trace, the
value will be the one used for the trace session.

Trace ID initialisation is removed from the _probe() function.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230116124928.5440-6-mike.leach@linaro.org
drivers/hwtracing/coresight/coresight-etm4x-core.c
drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
drivers/hwtracing/coresight/coresight-etm4x.h