On Wed, May 01, 2019 at 11:50:52AM -0600, Mathieu Poirier wrote:
[...]
+2.2) Snapshot mode:
+Using perf's built-in snapshot mode with CoreSight tracers is supported - to +do so the '-S' command line option needs to be specified. Since current sink +devices are used in double-buffer mode when operated from the perf interface, +the size of the perf ring buffer needs to be adjusted to match the size of the +buffer used by the CoreSight sinks. From the perf command line it is possible +to specify the number of pages to use for a session using the '-m,X' option, +where X is the amount of pages.
+The system memory buffer used by ETR devices is automatically adjusted +to match the size of the perf ring buffer and as such does not need to be +modified on the perf command line. For ETB and ETF devices the perf ring +buffer size need to be adjusted to match the size of the internal buffer.
+The following examples assume a system page size of 4096 byte:
- # cat /sys/bus/coresight/devices/20010000.etb/mgmt/rdp
- 0x2000
- # perf record -e cs_etm/@20010000.etf/ -S -m,8 --per-thread $APP
In this case it shows the usage for etb, thus should: s/20010000.etf/20010000.etb/
BTW, the user needs to convert the rdp to byte size with multiplying 4, it's good to explain for this in the doc or give related info in the driver warning log.
Thanks, Leo Yan
- # cat /sys/bus/coresight/devices/20010000.etf/buffer_size
- 0x10000
- # perf record -e cs_etm/@20010000.etf/ -S -m,16 --per-thread $APP
- # perf record -e cs_etm/@20070000.etr/ -S --per-thread $APP
+Once an application is launched trace snapshot are collected by sending the +USR2 message to the process being monitored:
- # perf record -e cs_etm/@20070000.etr/ -S --per-thread $APP &
- [1] 14808
- # kill -USR2 14808
- ...
- ...
- # kill -USR2 14808
- ...
- ...
- # kill 14808
How to use the STM module
-- 2.17.1