Hi Kim,
I've split off this issue from the original thread (keeping the original audience). A bit more investigation this morning shows that on my juno-r1 the issue only occurs if you enable the TPIU. (couldn't use the r2 but I don't think the differences are relevant here).
See below for test run info.
As far as I am aware, the TPIU driver is currently a stub driver - granted it would be better if it failed gracefully and gave a useful error message, but enabling is not useful without external trace capture (and we might expect the external device to enable this - bit of a grey area starting trace by system calls then piping out to external device).
Mike
===All 4 sinks - mmap error ============ mleach@linaro-developer:~/perf-tools$ for i in /sys/bus/coresight/devices/*/enable_sink; do echo $i; done /sys/bus/coresight/devices/20010000.etf/enable_sink /sys/bus/coresight/devices/20030000.tpiu/enable_sink /sys/bus/coresight/devices/20070000.etr/enable_sink /sys/bus/coresight/devices/20140000.etf/enable_sink mleach@linaro-developer:~/perf-tools$ for i in /sys/bus/coresight/devices/*/enable_sink; do echo 1 | sudo tee $i; done 1 1 1 1 mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname failed to mmap with 12 (Cannot allocate memory) mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.077 MB perf.data ] =============================
====== etf @ 2001 only - no error =========== mleach@linaro-developer:~/perf-tools$ echo 1 | sudo tee /sys/bus/coresight/devices/20010000.etf/enable_sink 1 mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.077 MB perf.data ] =============================
======etr @ 2007 only - no error ============ mleach@linaro-developer:~/perf-tools$ echo 1 | sudo tee /sys/bus/coresight/devices/20070000.etr/enable_sink 1 mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.076 MB perf.data ] =============================
======etf @ 2014 only - no error ============ mleach@linaro-developer:~/perf-tools$ echo 1 | sudo tee /sys/bus/coresight/devices/20140000.etf/enable_sink 1 mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.077 MB perf.data ] =============================
=====tpiu @ 2003 only - mmap error ================= mleach@linaro-developer:~/perf-tools$ echo 1 | sudo tee /sys/bus/coresight/device/20030000.tpiu/enable_sink 1 mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname failed to mmap with 12 (Cannot allocate memory) mleach@linaro-developer:~/perf-tools$ mleach@linaro-developer:~/perf-tools$ sudo taskset -c 2 ./perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 uname Linux [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.076 MB perf.data ] mleach@linaro-developer:~/perf-tools$ =============================