Hi Linu,
This requirement for combining CoreSight devices is covered by the CoreSight Configuration patchset[s]
The patches define a coresight configuration as a set of programmed features on a set of coresight devices. Configurations can be loaded via a kernel loadable module, with load via confifs to follow. Configurations can then be selected for operation using the configuration name on the perf command line.
The initial patchset is being merged here [https://lore.kernel.org/all/20210723165444.1048-2-mike.leach@linaro.org]
Follow up sets to provide additional resource management for ETMs,CTI programming, configfs support will follow on coresight/next once 5.15-rc1 is published.
Once these sets are complete, the programming of CTIs and ETMs covered by this patchset will be achieved by writing and loading a configuration, without the need to alter any additional driver code.
Regards
Mike
On Wed, 1 Sept 2021 at 12:02, Linu Cherian lcherian@marvell.com wrote:
This patchset adds support for stopping trace on all enabled coresight sources upon execution of a programmed instruction address.
ETM stop event is triggered by an instruction address match on a comparator. This address match event is then used to stop the tracing across all ETM source devices with the help of external input/output signals and ECT.
The instruction address for the stop event can be programmed using sysfs interface.
The event flow diagram is like this, Address comparator --> EXT OUT --> ECT---> EXT IN --> Counter-->ViewInst
The original intention of this patch is to stop all ETM sources at the time of kernel panic without software intervention so that it can be used as one of the building block while enabling panic/kdump support in coresight drivers [1]. But there can be other use cases like stopping trace on assertions or error functions etc. as well.
I am sending this patch as an RFC so as to get an early feedback on the approach taken for implementation and other inputs if any.
Few caveats:
- Testing was done only with sysfs interface using a arbitrary kernel symbol address. Perf support will be added later based on initial feedback.
- CTI hook for enabling trace event connection need to be rewritten to use existing support APIs.
[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1652258.html
Linu Cherian (2): coresight: Add support to setup Trace event signals coresight: etm4x: Add support to generate and synchronize stop event
drivers/hwtracing/coresight/coresight-core.c | 37 ++++ .../hwtracing/coresight/coresight-cti-core.c | 21 +++ drivers/hwtracing/coresight/coresight-cti.h | 3 + .../coresight/coresight-etm4x-core.c | 167 ++++++++++++++++++ .../coresight/coresight-etm4x-sysfs.c | 64 +++++++ drivers/hwtracing/coresight/coresight-etm4x.h | 16 ++ include/linux/coresight.h | 6 + 7 files changed, 314 insertions(+)
-- 2.31.1
-- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK