Hi Mike,
-----Original Message----- From: Mike Leach mike.leach@linaro.org Sent: Wednesday, September 8, 2021 9:42 PM To: Linu Cherian lcherian@marvell.com Cc: Mathieu Poirier mathieu.poirier@linaro.org; Suzuki K. Poulose suzuki.poulose@arm.com; Leo Yan leo.yan@linaro.org; Coresight ML coresight@lists.linaro.org; linuc.decode@gmail.com Subject: [EXT] Re: [RFC PATCH 0/2] Support for stopping trace on a programmed address
External Email
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://urldefense.proofpoint.com/v2/url?u=https- 3A__lore.kernel.org_all_20210723165444.1048-2D2-2Dmike.leach- 40linaro.org&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=DI9kird_6lFtBCV oGa5ogk3dJwsUlHLjLlgu0r46iU4&m=TH0tJTuBbNOqLx1VzaYxOl3UCDJCNV1a LWPQRyNi1uA&s=5rlzi9-n-nEkMJT_w0jjDzdvKocsjwa7rNJChtLQfSE&e= ]
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.
Kindly please CC me when you submit this patchset.
Thanks.
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://urldefense.proofpoint.com/v2/url?u=https-3A__www.mail-
2Darchive.com_linux-2Dkernel- 40vger.kernel.org_msg1652258.html&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7 xtfQ&r=DI9kird_6lFtBCVoGa5ogk3dJwsUlHLjLlgu0r46iU4&m=TH0tJTuBbNOq Lx1VzaYxOl3UCDJCNV1aLWPQRyNi1uA&s=zq0nWzbEsnvwpyxph6TU- XPPB2VKjLOsIWvOGYTwJmE&e=
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