What restriction is perf_event_paranoid == 1 actually putting on x86 perf?

In this case CPU event refers to monitoring events per CPU rather than per task. For perf tools this restricts the usage of

-C, --cpu=
    Count only on the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1.
    Ranges of CPUs are specified with -: 0-2. In per-thread mode, this option is ignored. The -a option is still necessary
    to activate system-wide monitoring. Default is to count on all CPUs.

-a, --all-cpus
    system-wide collection from all CPUs (default if no target is specified)

For perf_event_open this considers the following case:

pid == -1 and cpu >= 0
       This measures all processes/threads on the specified CPU.  This requires CAP_SYS_ADMIN capability or a /proc/sys/ker‐
       nel/perf_event_paranoid value of less than 1.

This may be version specific, the cited documentation is from 4.17. This is another related question.

Leave a Comment