I am hard pressed to figure a topology where the first ETR found after an ETM is not also the least connected ETR. Even a 1:1 with an additional global ETR via replicator still needs a funnel before the global ETR, ensuring the global ETR is further away.
Yes as long as you count a non-programmable funnel as a hop, so if
- replicator - per-core ETR - invisible funnel - shared ETR
and if you happen to stumble across the shared ETR first, you have two ETRs at the same level, but it's the per-core ETR you likely want to use. (I think we are going to be seeing a SoC like this.)
Perhaps the rule should be "least shared and closest" ETR which is generally also the closest, but acts as a tie-breaker if there are several at the same level. It also does the right thing when there's a per-core ETR (or TRBE) when you invariably want to be using that.
Al
Perhaps the first approach could be to implement the 1st ETR / 1st Sink approach for principal / default sink, and revisit specific tagging should a use case arise.
Regards
Mike
And this should solve the 1:1 configurations and per cluster ETR and one ETR per system.
This can be a one time list, updated when there is a change in the system (ETR added, ETM registered).
Thoughts ?
Suzuki
Regards
Mike
Therefore, we select the principal sink using a property in the device tree. This allows the routine to select the best possible for the situation.
The only rule for selecting such sinks, is that there should only be one principal sink marked for any given source, across all possible paths from that source to any sinks. (if this rule is violated then the first found will be used)
Therefore to select a sink, we start with the source, and walk the child connections until a sink marked as a principal sink is found.
Applied to Linux 5.7-rc1 (with dts updates 1,2), tested on Juno / DB410
Note A: Moving forward to topologies which have groups of sources going to dedicated sinks e.g. multisocket / multicluster where each socket / cluster has a sink, then multiple sinks can be marked as
principal sink, one for each cluster.
The same applies to 1:1 ETM:sink topolgy were each sink will be marked.
Note B: The current set does not auto-select when using sysfs, but I believe this could easily be added.
[1] https://lists.linaro.org/pipermail/coresight/2020-April/003819.htm l [2] https://lists.linaro.org/pipermail/coresight/2020-April/003821.htm l
Mike Leach (5): coresight: Add principal sink handling to CoreSight base coresight: tmc: Add principal sink attribute detection coresight: etm: perf: Add default sink selection to etm perf perf: cs-etm: Allow no CoreSight sink to be specified on command line dt-bindings: arm: qcom: Add CoreSight principal sink select parameters
arch/arm64/boot/dts/arm/juno-base.dtsi | 1 + arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + .../hwtracing/coresight/coresight-etm-perf.c | 20 +++++++++-- drivers/hwtracing/coresight/coresight-priv.h | 2 ++ drivers/hwtracing/coresight/coresight-tmc.c | 9 +++++ drivers/hwtracing/coresight/coresight.c | 34 +++++++++++++++++++ include/linux/coresight.h | 7 ++++ tools/perf/arch/arm/util/cs-etm.c | 6 ++-- 8 files changed, 74 insertions(+), 6 deletions(-)
-- 2.17.1
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.