Skip to content

Commit 5153e57

Browse files
mikel-armbbgregkh
authored andcommitted
coresight: docs: Add information about the topology representations
Update the CoreSight documents to describe the new connections directory and the links between CoreSight devices in this directory. Signed-off-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200518180242.7916-7-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 73274ab commit 5153e57

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

Documentation/trace/coresight/coresight-ect.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ capable of generating or using trigger signals.::
7272

7373
>$ ls /sys/bus/coresight/devices/etm0/cti_cpu0
7474
channels ctmid enable nr_trigger_cons mgmt power powered regs
75-
subsystem triggers0 triggers1 uevent
75+
connections subsystem triggers0 triggers1 uevent
7676

7777
*Key file items are:-*
7878
* ``enable``: enables/disables the CTI. Read to determine current state.
@@ -88,6 +88,9 @@ capable of generating or using trigger signals.::
8888
* ``channels``: Contains the channel API - CTI main programming interface.
8989
* ``regs``: Gives access to the raw programmable CTI regs.
9090
* ``mgmt``: the standard CoreSight management registers.
91+
* ``connections``: Links to connected *CoreSight* devices. The number of
92+
links can be 0 to ``nr_trigger_cons``. Actual number given by ``nr_links``
93+
in this directory.
9194

9295

9396
triggers<N> directories

Documentation/trace/coresight/coresight.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,91 @@ to the newer scheme, to give a confirmation that what you see on your
241241
system is not unexpected. One must use the "names" as they appear on
242242
the system under specified locations.
243243

244+
Topology Representation
245+
-----------------------
246+
247+
Each CoreSight component has a ``connections`` directory which will contain
248+
links to other CoreSight components. This allows the user to explore the trace
249+
topology and for larger systems, determine the most appropriate sink for a
250+
given source. The connection information can also be used to establish
251+
which CTI devices are connected to a given component. This directory contains a
252+
``nr_links`` attribute detailing the number of links in the directory.
253+
254+
For an ETM source, in this case ``etm0`` on a Juno platform, a typical
255+
arrangement will be::
256+
257+
linaro-developer:~# ls - l /sys/bus/coresight/devices/etm0/connections
258+
<file details> cti_cpu0 -> ../../../23020000.cti/cti_cpu0
259+
<file details> nr_links
260+
<file details> out:0 -> ../../../230c0000.funnel/funnel2
261+
262+
Following the out port to ``funnel2``::
263+
264+
linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel2/connections
265+
<file details> in:0 -> ../../../23040000.etm/etm0
266+
<file details> in:1 -> ../../../23140000.etm/etm3
267+
<file details> in:2 -> ../../../23240000.etm/etm4
268+
<file details> in:3 -> ../../../23340000.etm/etm5
269+
<file details> nr_links
270+
<file details> out:0 -> ../../../20040000.funnel/funnel0
271+
272+
And again to ``funnel0``::
273+
274+
linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel0/connections
275+
<file details> in:0 -> ../../../220c0000.funnel/funnel1
276+
<file details> in:1 -> ../../../230c0000.funnel/funnel2
277+
<file details> nr_links
278+
<file details> out:0 -> ../../../20010000.etf/tmc_etf0
279+
280+
Finding the first sink ``tmc_etf0``. This can be used to collect data
281+
as a sink, or as a link to propagate further along the chain::
282+
283+
linaro-developer:~# ls -l /sys/bus/coresight/devices/tmc_etf0/connections
284+
<file details> cti_sys0 -> ../../../20020000.cti/cti_sys0
285+
<file details> in:0 -> ../../../20040000.funnel/funnel0
286+
<file details> nr_links
287+
<file details> out:0 -> ../../../20150000.funnel/funnel4
288+
289+
via ``funnel4``::
290+
291+
linaro-developer:~# ls -l /sys/bus/coresight/devices/funnel4/connections
292+
<file details> in:0 -> ../../../20010000.etf/tmc_etf0
293+
<file details> in:1 -> ../../../20140000.etf/tmc_etf1
294+
<file details> nr_links
295+
<file details> out:0 -> ../../../20120000.replicator/replicator0
296+
297+
and a ``replicator0``::
298+
299+
linaro-developer:~# ls -l /sys/bus/coresight/devices/replicator0/connections
300+
<file details> in:0 -> ../../../20150000.funnel/funnel4
301+
<file details> nr_links
302+
<file details> out:0 -> ../../../20030000.tpiu/tpiu0
303+
<file details> out:1 -> ../../../20070000.etr/tmc_etr0
304+
305+
Arriving at the final sink in the chain, ``tmc_etr0``::
306+
307+
linaro-developer:~# ls -l /sys/bus/coresight/devices/tmc_etr0/connections
308+
<file details> cti_sys0 -> ../../../20020000.cti/cti_sys0
309+
<file details> in:0 -> ../../../20120000.replicator/replicator0
310+
<file details> nr_links
311+
312+
As described below, when using sysfs it is sufficient to enable a sink and
313+
a source for successful trace. The framework will correctly enable all
314+
intermediate links as required.
315+
316+
Note: ``cti_sys0`` appears in two of the connections lists above.
317+
CTIs can connect to multiple devices and are arranged in a star topology
318+
via the CTM. See (:doc:`coresight-ect`) [#fourth]_ for further details.
319+
Looking at this device we see 4 connections::
320+
321+
linaro-developer:~# ls -l /sys/bus/coresight/devices/cti_sys0/connections
322+
<file details> nr_links
323+
<file details> stm0 -> ../../../20100000.stm/stm0
324+
<file details> tmc_etf0 -> ../../../20010000.etf/tmc_etf0
325+
<file details> tmc_etr0 -> ../../../20070000.etr/tmc_etr0
326+
<file details> tpiu0 -> ../../../20030000.tpiu/tpiu0
327+
328+
244329
How to use the tracer modules
245330
-----------------------------
246331

0 commit comments

Comments
 (0)