On Mon, 13 May 2019 at 14:01, Mathieu Poirier mathieu.poirier@linaro.org wrote:
On Mon, 13 May 2019 at 05:16, Leo Yan leo.yan@linaro.org wrote:
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.
I've been thinking about this. Both ETR and ETF have a 'buffer_size" entry in sysfs and ETB does not. The first thing I suggest is to add a "buffer_size" entry to the ETB driver so that all sink devices look the same. From there enhance the current information carried by "buffer_size" to include pages. For example:
$cat 20070000.etr/buffer_size 0x100000 0x100
$ cat 20010000.etf/buffer_size 0x10000 0x10
$ cat 20010000.etb/buffer_size 0x8000 0x8
That way we have the information we need without adding more entries to sysfs - all we need to do is update the documentation (which we'd have to do anyway). Let me know what you think.
What I did forget to mention is that my next revision of the feature does not mandate to make the ring buffer match the size of the internal buffer memories. The above reply was in the context of letting users know how to make the size of the buffers match should they want to. But so far I haven't found a use case where doing so would be beneficial.
Mathieu
Thanks, Leo Yan