Hi Suzuki,
On Mon, May 13, 2019 at 09:37:01AM +0100, Suzuki K Poulose wrote:
Hi,
On 11/05/2019 08:32, Leo Yan wrote:
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.
If at all we want to match the aux space size with that of the device buffer, I recommend exposing this via a new "buf_pages" attribute under the sysfs to help the user.
Agree, I also saw you suggested in another email. Using "buf_pages" is directive and consistent for different sink devices.
Thanks, Leo Yan