Hi Mike,
On Tue, May 19, 2020 at 06:31:22PM +0100, Mike Leach wrote:
This patchset provides a proposed infrastructure to allow for the automatic selection of a sink during CoreSight tracing operations.
Currently starting tracing using perf requires a sink selection on the command line:-
sudo ./perf record -e cs_etm/@tmc_etr0/ --per-thread uname -a
After this set the infrastructure will be able to select a default sink:-
sudo ./perf record -e cs_etm// --per-thread uname -a
This matches with the default operation provided with perf and intelpt.
Where no sink is specified at the start of a trace session, the CoreSight system will walk the connection graph from the source ETM, to find a suitable sink using the first encountered highest priority device.
The CoreSight infrastructure is updated to define sink sub_types to differentiate between sinks with built in buffers (ETB / ETF) - BUFFER type , and those that use system memory (ETR) - SYSMEM - types.
SYSMEM types are considered higher priority.
When two sinks are found of equal priority, then the closest sink to the source in terms of connection nodes is chosen.
The automatic sink selection will also operate if an ETM is enabled using sysfs commands, and no sink is currently enabled.
Applies to Linux coresight/next branch
Despite the minor cosmetic issues I think this set is ready for mainline action. We might even be able to squeeze it in for the upcoming merge window _if_ we get an rc8.
For the next revision please send the user space portion as a separate patch to Arnaldo and CC me (and lakml). It is important that Arnaldo be on the "To:" field, otherwiser he won't see it.
Thanks, Mathieu
Changes since v2:
- changed from explicit set priority value to using the sink_subtype in the
coresight_device as the selection priority value.
- Added in search depth to the find algorithm to ensure that the closest sink
to the source with the highest priority is chosen.
- A default sink is cached with the source when the search is first
undertaken, reducing the need for repeat searches for a given source.
Changes since v1:
- Dropped the device-tree attribute labelling of sinks for selection and
implemented the priority schema preferring first encountered ETR, after mailing list discussions. 2) Added in sysfs support for auto sink selection. Mike Leach (6): coresight: Fix comment in main header file. coresight: Add default sink selection to CoreSight base coresight: tmc: Update sink types for default selection. coresight: etm: perf: Add default sink selection to etm perf coresight: sysfs: Allow select default sink on source enable. perf: cs-etm: Allow no CoreSight sink to be specified on command line
.../hwtracing/coresight/coresight-etm-perf.c | 17 +- drivers/hwtracing/coresight/coresight-priv.h | 2 + drivers/hwtracing/coresight/coresight-tmc.c | 3 +- drivers/hwtracing/coresight/coresight.c | 148 +++++++++++++++++- include/linux/coresight.h | 6 +- tools/perf/arch/arm/util/cs-etm.c | 6 +- 6 files changed, 172 insertions(+), 10 deletions(-)
-- 2.17.1