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