I'm posting this as an RFC due to the following hurdles:
1.) I've probably broken ppc64 with my /proc/cpuinfo parser changes but
I don't have a relevant machine on which to test the patch.
2.) Cross-compiling for ARM doesn't work and I see the following error
checking kernel version supports perf_events... This kernel has perf_events support
checking for "/usr/include/linux/perf_event.h"... configure: error: cannot check for file existence when cross compiling
perhaps we should have a --with-perf-events option or something
3.) operf requests exclude_idle=1 in the perf_event_attr passed to the
kernel. ARM cores do not support this mode exclusion and requesting
it will give you -EPERM (which is the wrong error code -- I'll fix
this in the kernel...).