Hi Al,
-----Original Message----- From: CoreSight coresight-bounces@lists.linaro.org On Behalf Of Al Grant Sent: 10 June 2020 18:48 To: Mike Leach mike.leach@linaro.org; coresight@lists.linaro.org Cc: mathieu.piorier@linaro.org; Andrea Brunato Andrea.Brunato@arm.com Subject: RE: [RFC PATCH 0/3] CoreSight complex config support; ETM strobing.
From: Mike Leach mike.leach@linaro.org Sent: 09 June 2020 17:37 To: coresight@lists.linaro.org Cc: Al Grant Al.Grant@arm.com; mathieu.piorier@linaro.org; Andrea Brunato Andrea.Brunato@arm.com; Suzuki Poulose Suzuki.Poulose@arm.com; Mike Leach mike.leach@linaro.org Subject: [RFC PATCH 0/3] CoreSight complex config support; ETM strobing.
This patchset introduces initial concepts in CoreSight complex configuration support - the device "feature", which is a method of programming the device to perform a specific function.
A built-in feature is provided - the ETM strobing function, which programs the ETM to switch trace on and off in a specific mark / space ratio to effectively sample the program being traced. This feature is essential for the Auto-FDO flow using CoreSight trace.
Features are declared as a data table, a set of register, resource and parameter requirements. A feature can then be loaded into a device, when the requirements are validated. Once loaded a feature can be enabled for a specific trace run.
A feature appears in the sysfs file for the device, as a directory of form 'name.feat', with parameters 'enable', 'description' and any input parameters that may be used to control the operation.
For example the ETM strobing feature provided has parameters of 'window' and 'period' to control the sampling mark / space ratio. The representation in sysfs for the ETMv4 is therefore:- etmX/strobing.feat/ /enable /window /period
Future developments will introduce resource management, and allow for the runtime loading of additional features, and the setting of features across an entire CoreSight system.
Will it be possible to set the strobing parameters per session? Or at least select (per session) between some predefined configurations with different strobing parameters?
Ultimately - yes.
Complex config has two essential components: 1) features - a way of programming a device to perform a specific function 2) configurations - a description of a programmed system consisting of enabling features on various devices.
So a named configuration might be described as:-
afdo-1 { etm4 strobing window=5000 period=10000 }
Selected by the user as
perf record -e cs_etm/@afdo-1/ <rest of perf command line>
We will need to extend the feature support to associate the parameters / volatile elements with a specific perf event - so they are recalled when that event is on the device.
I think the concept of pre-sets may be very useful. I have been trying to find a way of specifying parameter values on the perf command line, but that gets very messy quite quickly. However if a feature / config has a set of presets, then passing a single preset number is suddenly much easier. 4 bits - which could be in part of the unused perf config vars we currently use to pass bits for timestamps etc, could give us up to 16 presets per configuration.
So if the feature description schema is extended to allow sets of presets for parameters, then we could acheive much of what you require.
Regards
Mike
We've had some partner feedback that it's important for people to be able to open perf sessions with different strobing parameters, without being able to write sysfs.
Al
Mike Leach (3): coresight: etmv4: Fix resource selector constant. coresight: etmv4: Counter values not saved on disable. coresight: etmv4: Adds initial complex config with ETM4 strobe feature.
drivers/hwtracing/coresight/Makefile | 7 +- .../hwtracing/coresight/coresight-config.c | 380 ++++++++++++++++++ .../hwtracing/coresight/coresight-config.h | 156 +++++++ .../hwtracing/coresight/coresight-etm4x-cfg.c | 325 +++++++++++++++ .../hwtracing/coresight/coresight-etm4x-cfg.h | 29 +++++++++++++++ ++ .../coresight/coresight-etm4x-sysfs.c | 3 + drivers/hwtracing/coresight/coresight-etm4x.c | 24 +- drivers/hwtracing/coresight/coresight-etm4x.h | 4 +- drivers/hwtracing/coresight/coresight.c | 1 + include/linux/coresight.h | 2 + 10 files changed, 925 insertions(+), 6 deletions(-) create mode 100644 drivers/hwtracing/coresight/coresight-config.c create mode 100644 drivers/hwtracing/coresight/coresight-config.h create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.c create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.h
-- 2.17.1
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight