Ok, wrong question. Better would have been: Did you run it on a
non-pebs Intel machine of an non-ibs AMD machine?
I do not post patches without testing them. This particular patch was
verified in a Virtual Machine (no PEBS) and using :pG modifier.
'egrep -r ENOTSUP tools/perf' shows hits in 3 other files, so I am not
the only one using the shortcut. I'll change it in the follow up with
better commit messages to make it consistent with patch 2.
For VM this might be valid. Don't know where ENOTSUP comes from. It is
neither in kernel/events/ nor arch/x86/kernel/cpu/perf.
If you run this bare-metal on older machines which do not support pebs
or ibs, the syscall returns EOPNOTSUPP. You can trigger the same
behaviour on newer systems with:
# perf record -e cycles:ppp -c 2097120 -R -a sleep 1
Error: sys_perf_event_open() syscall returned with 95 (Operation not supported). /bin/dmesg may provide additional information.
...
It should work in this case too.