perf_event_open() always get zero when specifying CPU ID
I am reading Perf performance counters using this example:
https://gist.github.com/teqdruid/2473071
However, instead of:
fd[0] = perf_event_open(&attr[0], getpid(), -1, -1, 0);
I only want to ...