On 17/05/18 12:10, Suzuki K Poulose wrote:
On 09/05/2017 03:37 PM, Mathieu Poirier wrote:
On 4 September 2017 at 04:35, marekzmyslowski marekzmyslowski@poczta.onet.pl wrote:
Hello Mathieu,
Thank for the config file. It works. I was able to build the OpenCSD kernel (form the perf-opencsd-master branch) and install on the USB (I used the ArchLinuxARM-aarch64-latest.tar.gz). I also built the perf tool (make -C tools/perf). Everything is booting but the perf has some issues:
[root@alarm home]# ./perf record -vvv -e cs_etm/@20070000.etr/u --per-thread uname map_groups__set_modules_path_dir: cannot open /lib/modules/4.13.0-rc1-ge565ad6 dir Problems setting modules path maps, continuing anyway...
perf_event_attr: type 8 size 112 { sample_period, sample_freq } 1 sample_type IP|TID|IDENTIFIER read_format ID disabled 1 exclude_kernel 1 exclude_hv 1 enable_on_exec 1 sample_id_all 1
sys_perf_event_open: pid 2242 cpu -1 group_fd -1 flags 0x8 = 4
perf_event_attr: type 1 size 112 config 0x9 { sample_period, sample_freq } 1 sample_type IP|TID|IDENTIFIER read_format ID disabled 1 exclude_kernel 1 exclude_hv 1 mmap 1 comm 1 enable_on_exec 1 task 1 sample_id_all 1 mmap2 1 comm_exec 1
sys_perf_event_open: pid 2242 cpu -1 group_fd -1 flags 0x8 = 5 mmap size 528384B AUX area mmap length 4194304 perf event ring buffer mmapped per thread failed to mmap AUX area failed to mmap with 12 (Cannot allocate memory)
This is a classic problem and _usually_ related to something going wrong when calling kernel function etm_setup_aux() - that is where I'd start looking. The bad news is that you will have to debug this on your own as this is likely to be platform specific. If you want to experiment with a platform that works I suggest purchasing a dragonboard 410c. I test with that platform on a regular basi
It is kind of not helpful, when the setup_aux fails to setup a path from the source to sink and still returns -ENOMEM :-(. I will see if I can fix this in the generic driver.
Are you able to do normal sysfs mode tracing ?
Also, have you tried manually enabling the sink (in this case ETR) every single time before running perf ?
ie. :
echo 1 > /sys/bus/coresight/devices/2070000.etr/enable_sink
That seemed to solve the issue for me in the past with older kernel/perf tools. With 4.17 at least I don't need to do it manually.
Cheers Suzuki