Good afternoon,
I have started to review this set. I will go through all the patches first to get a better idea of what is going on. From there I'll do another pass where I will post comments.
With this much code and 20 new structures to look at, the process will take me several days.
Thanks, Mathieu
On Thu, Aug 27, 2020 at 03:34:03PM +0100, Mike Leach wrote:
This patchset introduces initial concepts in CoreSight complex system configuration support.
Configurations consist of 2 elements:-
- Features - programming combinations for devices, applied to a class of
device on the system (all ETMv4), or individual devices. 2) Configurations - a set of programmed features used when the named configuration is selected.
Features and configurations are declared as a data table, a set of register, resource and parameter requirements. Features and configurations are loaded into the system by the virtual cs_syscfg device. This then matches features to any registered devices and loads the feature into them.
Individual device classes that support feature and configuration register with cs_syscfg.
Once loaded a configuration can be enabled for a specific trace run. Configurations are registered with the perf cs_etm event as entries in cs_etm/cs_config. These can be selected on the perf command line as follows:-
perf record -e cs_etm/@<config_name>/ ...
This patch set has one pre-loaded configuration and feature. A named "strobing" feature is provided for ETMv4. A named "autofdo" configuration is provided. This configuration enables strobing on any ETM in used.
Thus the command: perf record -e cs_etm/@autofdo/ ...
will trace the supplied application while enabling the "autofdo" configuation on each ETM as it is enabled by perf. This in turn will enable strobing for the ETM - with default parameters. (at present these default parameters can be altered using sysfs for each individual ETM - but this is under review).
The sink used in the trace run will be automatically selected.
A configuation can supply up to 15 of preset parameter values, which will subsitute in parameter values for any feature used in the configuration.
Selection of preset values as follows perf record -e cs_etm/@autofdo,preset=1/ ...
(valid presets 1-N, where N is the number supplied in the configuration, not exceeding 15. preset=0 is the same as not selecting a preset.)
Changes since v1:
- Moved preloaded configurations and features out of individual drivers.
- Added cs_syscfg driver to manage configurations and features. Individual
drivers register with cs_syscfg indicating support for config, and provide matching information that the system uses to load features into the drivers. This allows individual drivers to be updated on an as needed basis - and removes the need to consider devices that cannot benefit from configuration - static replicators, funnels, tpiu. 3) Added perf selection of configuarations. 4) Rebased onto the coresight module loading set.
Applies to coresight/next (5.9-rc1 base) with the coresight module load set [1] applied.
To follow in future revisions / sets:- a) load of additional config and features by loadable module. b) load of additional config and features by configfs c) enhanced resource management for ETMv4 and checking features have sufficient resources to be enabled. d) ECT and CTI support for configuration and features. e) documentation file.
[1] https://lists.linaro.org/pipermail/coresight/2020-August/004704.html
Mike Leach (8): coresight: syscfg: Initial coresight system configuration coresight: syscfg: Add loading of features and configurations coresight: syscfg: Add registration and feature loading for cs devices coresight: config: Add configuration and feature generic functions perf: cs_etm: update cs_etm processing to allow configuration selection coresight: etm-perf: update to handle configuration selection coresight: etm4x: Add complex configuration handlers to etmv4 coresight: config: Add preloaded configurations
drivers/hwtracing/coresight/Makefile | 6 +- .../coresight/coresight-cfg-preload.c | 165 +++++ .../hwtracing/coresight/coresight-config.c | 565 ++++++++++++++++++ .../hwtracing/coresight/coresight-config.h | 289 +++++++++ drivers/hwtracing/coresight/coresight-core.c | 36 +- .../hwtracing/coresight/coresight-etm-perf.c | 91 ++- .../hwtracing/coresight/coresight-etm-perf.h | 8 +- .../hwtracing/coresight/coresight-etm4x-cfg.c | 226 +++++++ .../hwtracing/coresight/coresight-etm4x-cfg.h | 29 + .../coresight/coresight-etm4x-core.c | 30 +- .../coresight/coresight-etm4x-sysfs.c | 3 + .../hwtracing/coresight/coresight-syscfg.c | 527 ++++++++++++++++ .../hwtracing/coresight/coresight-syscfg.h | 90 +++ include/linux/coresight-pmu.h | 3 + include/linux/coresight.h | 8 + tools/include/linux/coresight-pmu.h | 3 + tools/perf/arch/arm/util/cs-etm.c | 17 +- 17 files changed, 2066 insertions(+), 30 deletions(-) create mode 100644 drivers/hwtracing/coresight/coresight-cfg-preload.c 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 create mode 100644 drivers/hwtracing/coresight/coresight-syscfg.c create mode 100644 drivers/hwtracing/coresight/coresight-syscfg.h
-- 2.17.1