LIKWID
Enumerations | Functions
Access module

Enumerations

enum  AccessMode { ACCESSMODE_PERF = -1, ACCESSMODE_DIRECT = 0, ACCESSMODE_DAEMON = 1 }
 Enum for the access modes. More...
 

Functions

int HPMaddThread (int cpu_id) __attribute__((visibility("default")))
 Add CPU to access module. More...
 
void HPMfinalize () __attribute__((visibility("default")))
 Close connections. More...
 
int HPMinit () __attribute__((visibility("default")))
 Initialize access module. More...
 
void HPMmode (int mode) __attribute__((visibility("default")))
 Set access mode. More...
 

Detailed Description

Enumeration Type Documentation

enum AccessMode

Enum for the access modes.

LIKWID supports multiple access modes to the MSR and PCI performance monitoring registers. For direct access the user must have enough priviledges to access the MSR and PCI devices. The daemon mode forwards the operations to a daemon with higher priviledges.

Enumerator
ACCESSMODE_PERF 

Access performance monitoring through perf_event kernel interface.

ACCESSMODE_DIRECT 

Access performance monitoring registers directly.

ACCESSMODE_DAEMON 

Use the access daemon to access the registers.

Function Documentation

int HPMaddThread ( int  cpu_id)

Add CPU to access module.

Add the given CPU to the access module. This opens the commnunication to either the MSR/PCI files or the access daemon.

Parameters
[in]cpu_idCPU that should be enabled for measurements
Returns
error code (0 for success, -ENODEV if access cannot be initialized
void HPMfinalize ( )

Close connections.

Close the connections to the MSR/PCI files or the access daemon

int HPMinit ( )

Initialize access module.

Initialize the module internals to either the MSR/PCI files or the access daemon

Returns
error code (0 for sccess)
void HPMmode ( int  mode)

Set access mode.

Sets the mode how the MSR and PCI registers should be accessed. 0 for direct access (propably root priviledges required) and 1 for accesses through the access daemon. It must be called before HPMinit()

Parameters
[in]mode(0=direct, 1=daemon)