Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Beginner
56 Views

Some questions on Intel PCM

Jump to solution

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

Accepted Solutions
Employee
56 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

0 Kudos
3 Replies
Beginner
56 Views

Can someone give a hand on this? ;-p

0 Kudos
Employee
57 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

0 Kudos
Beginner
56 Views

Thanks a lot Roman!

0 Kudos