Performance Monitoring Support


I am trying to get a few performance monitoring libraries going, but no luck so far. First of all, they all need the perfmon “patch” inside the kernel, but as far as I can tell, the kernel indeed does contain it.(i’m using

If I install the pfmon package from the suse repository, running it will fail with a “can’t create perfmon context: Bad address”.

If I download the official libpfm source files and compile and install that, the example programs will fail with “Your kernel does not have performance monitoring support!” (but the kernel does contain the perfmon…)

If I try to compile and install the PAPI package (Performance API) from PAPI, then it compiles everything correctly, but when I try to run the test, it fails with “PAPI Error: detect_unavail_pmu_regs:pfm_create_context(): Function not implemented.”

Bottom line is, that although it seems that the kernel contains the performance monitoring patches, every single library that would need them fails spectacularly. I tried searching for the problem, but cannot really find anything to correct the error with. Any ideas? Is there some way to check that the perfmon in the kernel indeed works correctly without any extra libraries?


I’ve been looking at the source files in libpfm and the perfmon in the kernel too. The problem in perfmon is, that the pfm_create_context function call fails with the error code ENOSYS. Now if I check that specific function call in the kernel sources, it returns that specific code only if the perfmon in the kernel is disabled (perfmon_disabled variable is set). I searched a bit for that variable, and the interesting thing is, that it is set only during the library initialization (0 in case of success, 1 in case of error), but according to the boot log, everything initialized correctly (the last initialization message from the init function also appers, no error message)… thus perfmon_disabled must be 0. But then why does the pfm_create_context see it as set to 1? I checked all the perfmon source files, and that variable is set only once, and no further modifications are made.

Any idea why the pfm_create_context fails?