Skip to content

Commit 4a29fa2

Browse files
james-c-linaroSuzuki K Poulose
authored andcommitted
coresight: docs: Remove target sink from examples
Previously the sink had to be specified, but now it auto selects one by default. Including a sink in the examples causes issues when copy pasting the command because it might not work if that sink isn't present. Remove the sink from all the basic examples and create a new section specifically about overriding the default one. Make the text a but more concise now that it's in the advanced section, and similarly for removing the old kernel advice. Signed-off-by: James Clark <[email protected]> Reviewed-by: Leo Yan <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d11eb31 commit 4a29fa2

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

Documentation/trace/coresight/coresight.rst

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -462,44 +462,35 @@ queried by the perf command line tool:
462462

463463
cs_etm// [Kernel PMU event]
464464

465-
linaro@linaro-nano:~$
466-
467465
Regardless of the number of tracers available in a system (usually equal to the
468466
amount of processor cores), the "cs_etm" PMU will be listed only once.
469467

470468
A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is
471-
listed along with configuration options within forward slashes '/'. Since a
472-
Coresight system will typically have more than one sink, the name of the sink to
473-
work with needs to be specified as an event option.
474-
On newer kernels the available sinks are listed in sysFS under
469+
provided along with configuration options within forward slashes '/' (see
470+
`Config option formats`_).
471+
472+
Advanced Perf framework usage
473+
-----------------------------
474+
475+
Sink selection
476+
~~~~~~~~~~~~~~
477+
478+
An appropriate sink will be selected automatically for use with Perf, but since
479+
there will typically be more than one sink, the name of the sink to use may be
480+
specified as a special config option prefixed with '@'.
481+
482+
The available sinks are listed in sysFS under
475483
($SYSFS)/bus/event_source/devices/cs_etm/sinks/::
476484

477485
root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls
478486
tmc_etf0 tmc_etr0 tpiu0
479487

480-
On older kernels, this may need to be found from the list of coresight devices,
481-
available under ($SYSFS)/bus/coresight/devices/::
482-
483-
root:~# ls /sys/bus/coresight/devices/
484-
etm0 etm1 etm2 etm3 etm4 etm5 funnel0
485-
funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0
486488
root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program
487489

488-
As mentioned above in section "Device Naming scheme", the names of the devices could
489-
look different from what is used in the example above. One must use the device names
490-
as it appears under the sysFS.
491-
492-
The syntax within the forward slashes '/' is important. The '@' character
493-
tells the parser that a sink is about to be specified and that this is the sink
494-
to use for the trace session.
495-
496490
More information on the above and other example on how to use Coresight with
497491
the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub
498492
repository [#third]_.
499493

500-
Advanced perf framework usage
501-
-----------------------------
502-
503494
AutoFDO analysis using the perf tools
504495
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
505496

@@ -508,7 +499,7 @@ perf can be used to record and analyze trace of programs.
508499
Execution can be recorded using 'perf record' with the cs_etm event,
509500
specifying the name of the sink to record to, e.g::
510501

511-
perf record -e cs_etm/@tmc_etr0/u --per-thread
502+
perf record -e cs_etm//u --per-thread
512503

513504
The 'perf report' and 'perf script' commands can be used to analyze execution,
514505
synthesizing instruction and branch events from the instruction trace.
@@ -572,7 +563,7 @@ sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tuto
572563
Bubble sorting array of 30000 elements
573564
5910 ms
574565

575-
$ perf record -e cs_etm/@tmc_etr0/u --per-thread taskset -c 2 ./sort
566+
$ perf record -e cs_etm//u --per-thread taskset -c 2 ./sort
576567
Bubble sorting array of 30000 elements
577568
12543 ms
578569
[ perf record: Woken up 35 times to write data ]

Documentation/userspace-api/perf_ring_buffer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ regular ring buffer.
627627
AUX events and AUX trace data are two different things. Let's see an
628628
example::
629629

630-
perf record -a -e cycles -e cs_etm/@tmc_etr0/ -- sleep 2
630+
perf record -a -e cycles -e cs_etm// -- sleep 2
631631

632632
The above command enables two events: one is the event *cycles* from PMU
633633
and another is the AUX event *cs_etm* from Arm CoreSight, both are saved
@@ -766,7 +766,7 @@ only record AUX trace data at a specific time point which users are
766766
interested in. E.g. below gives an example of how to take snapshots
767767
with 1 second interval with Arm CoreSight::
768768

769-
perf record -e cs_etm/@tmc_etr0/u -S -a program &
769+
perf record -e cs_etm//u -S -a program &
770770
PERFPID=$!
771771
while true; do
772772
kill -USR2 $PERFPID

0 commit comments

Comments
 (0)