Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <james.clark@linaro.org>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20241210144933.295798-1-james.clark@linaro.org

authored by

James Clark and committed by
Suzuki K Poulose
4a29fa26 d11eb31d

+18 -27
+16 -25
Documentation/trace/coresight/coresight.rst
··· 462 462 463 463 cs_etm// [Kernel PMU event] 464 464 465 - linaro@linaro-nano:~$ 466 - 467 465 Regardless of the number of tracers available in a system (usually equal to the 468 466 amount of processor cores), the "cs_etm" PMU will be listed only once. 469 467 470 468 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 475 483 ($SYSFS)/bus/event_source/devices/cs_etm/sinks/:: 476 484 477 485 root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls 478 486 tmc_etf0 tmc_etr0 tpiu0 479 487 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 486 488 root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program 487 - 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 489 496 490 More information on the above and other example on how to use Coresight with 497 491 the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub 498 492 repository [#third]_. 499 - 500 - Advanced perf framework usage 501 - ----------------------------- 502 493 503 494 AutoFDO analysis using the perf tools 504 495 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ··· 499 508 Execution can be recorded using 'perf record' with the cs_etm event, 500 509 specifying the name of the sink to record to, e.g:: 501 510 502 - perf record -e cs_etm/@tmc_etr0/u --per-thread 511 + perf record -e cs_etm//u --per-thread 503 512 504 513 The 'perf report' and 'perf script' commands can be used to analyze execution, 505 514 synthesizing instruction and branch events from the instruction trace. ··· 563 572 Bubble sorting array of 30000 elements 564 573 5910 ms 565 574 566 - $ perf record -e cs_etm/@tmc_etr0/u --per-thread taskset -c 2 ./sort 575 + $ perf record -e cs_etm//u --per-thread taskset -c 2 ./sort 567 576 Bubble sorting array of 30000 elements 568 577 12543 ms 569 578 [ perf record: Woken up 35 times to write data ]
+2 -2
Documentation/userspace-api/perf_ring_buffer.rst
··· 627 627 AUX events and AUX trace data are two different things. Let's see an 628 628 example:: 629 629 630 - perf record -a -e cycles -e cs_etm/@tmc_etr0/ -- sleep 2 630 + perf record -a -e cycles -e cs_etm// -- sleep 2 631 631 632 632 The above command enables two events: one is the event *cycles* from PMU 633 633 and another is the AUX event *cs_etm* from Arm CoreSight, both are saved ··· 766 766 interested in. E.g. below gives an example of how to take snapshots 767 767 with 1 second interval with Arm CoreSight:: 768 768 769 - perf record -e cs_etm/@tmc_etr0/u -S -a program & 769 + perf record -e cs_etm//u -S -a program & 770 770 PERFPID=$! 771 771 while true; do 772 772 kill -USR2 $PERFPID