Software Tuning, Performance Optimization & Platform Monitoring
Discussion around monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform monitoring

Some questions on Intel PCM

Caesar
Beginner
233 Views

Hello folks, I have some questions that I could not answer by myself, I appreciate any help.

  1. Do I need to be root to execute programs linked with libintelpcm.so?
  2. All events require syscalls? Does cache access, retired instructions, clock cycles, etc. all require syscalls/root access?
  3. Should I use PCM::getInstance() or should I use MsrHandle? It seems the first is a wrapper around the later, is that right? In case of MsrHandle where can I find a list of events(registers) and their description?
  4. Is directly using MsrHandle for read just a few registers (<5) faster than using PCM::getInstance() right?
  5. Are statistics collected using these APIs specific for my program or are them from all programs that executed on the core in between the call to the two "sampling" functions? 

As always, thank you! 

0 Kudos
1 Solution
Roman_D_Intel
Employee
233 Views

>Do I need to be root to execute programs linked with libintelpcm.so?

To access uncore counters on modern Intel architectures, yes.

>All events require syscalls? Does cache access, retired instructions, clock cycles, etc. all require syscalls/root access?

in PCM, yes. It does not use rdpmc instruction yet, rdpmc wpuld allows to avoid syscalls for some core counters. 

>Should I use PCM::getInstance() or should I use MsrHandle? It seems the first is a wrapper around the later, is that right? In case of >MsrHandle where can I find a list of events(registers) and their description?

The lists of core and uncore events for many Intel processors is in the Intel Software Development Manual (many hundred pages...)

MsrHandle is a low level class not intended for direct use (if you want only to collect some performance events). You should use PCM::getInstance if you want to save time not recreating the tool.

>Is directly using MsrHandle for read just a few registers (<5) faster than using PCM::getInstance() right?

this is right, but there are many caveats (i.e. you need to program events, registers may overflow)...

>Are statistics collected using these APIs specific for my program or are them from all programs that executed on the core in between the call to the two "sampling" functions? 

PCM collects global statistics for all programs executed on particular core/processor.

I hope that helps.

Best regards,

Roman

 

View solution in original post

3 Replies
Caesar
Beginner
233 Views

Can someone give a hand on this? ;-p

Roman_D_Intel
Employee
234 Views

>Do I need to be root to execute programs linked with libintelpcm.so?

To access uncore counters on modern Intel architectures, yes.

>All events require syscalls? Does cache access, retired instructions, clock cycles, etc. all require syscalls/root access?

in PCM, yes. It does not use rdpmc instruction yet, rdpmc wpuld allows to avoid syscalls for some core counters. 

>Should I use PCM::getInstance() or should I use MsrHandle? It seems the first is a wrapper around the later, is that right? In case of >MsrHandle where can I find a list of events(registers) and their description?

The lists of core and uncore events for many Intel processors is in the Intel Software Development Manual (many hundred pages...)

MsrHandle is a low level class not intended for direct use (if you want only to collect some performance events). You should use PCM::getInstance if you want to save time not recreating the tool.

>Is directly using MsrHandle for read just a few registers (<5) faster than using PCM::getInstance() right?

this is right, but there are many caveats (i.e. you need to program events, registers may overflow)...

>Are statistics collected using these APIs specific for my program or are them from all programs that executed on the core in between the call to the two "sampling" functions? 

PCM collects global statistics for all programs executed on particular core/processor.

I hope that helps.

Best regards,

Roman

 

Caesar
Beginner
233 Views

Thanks a lot Roman!

Reply