Why do I need to run an application as a root for the PAPI library to work?

0

I just upgraded to Ubuntu 16.04 LTS. In my C++ applications I use the PAPI library, so I installed it from http://icl.utk.edu/papi/. However for some reason I can not run my applications anymore without having to type sudo in the beginning.

Even just typing papi_avail on the terminal to see which counters are available I get this:

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Avail Deriv Description (Note)
PAPI_L1_DCM  0x80000000  No    No   Level 1 data cache misses
PAPI_L1_ICM  0x80000001  No    No   Level 1 instruction cache misses
PAPI_L2_DCM  0x80000002  No    No   Level 2 data cache misses
PAPI_L2_ICM  0x80000003  No    No   Level 2 instruction cache misses
..........
    Of 108 possible events, 0 are available, of which 0 are derived.

avail.c                                     PASSED

If I run sudo papi_avail I get this:

--------------------------------------------------------------------------------
Of 108 possible events, 50 are available, of which 17 are derived.

avail.c                                     PASSED

What changed in Ubuntu 16.04?

c++
ubuntu-16.04
papi
asked on Stack Overflow Apr 17, 2017 by jsguy

1 Answer

0

It is related with the answer here. Theoretically, executing sudo sysctl -w kernel.perf_event_paranoid=0 should be enough.

answered on Stack Overflow Jun 28, 2017 by Jose M. Abuin

User contributions licensed under CC BY-SA 3.0