So, for completeness, further testing it to see how far it goes on a 8GB
machine I got:
[root@emilia ~]# echo 131100 > /proc/sys/kernel/perf_event_max_stack
[root@emilia ~]# perf record -g ls
Error:
The sys_perf_event_open() syscall returned with 12 (Cannot allocate memory) for event (cycles).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?