LIKWID
Functions
Retrieval and manipulation of processor clock frequencies

Functions

char * freq_getAvailFreq (const int cpu_id) __attribute__((visibility("default")))
 Get the available frequencies of a core. More...
 
char * freq_getAvailGovs (const int cpu_id) __attribute__((visibility("default")))
 Get the available frequency governors of a core. More...
 
uint64_t freq_getCpuClockCurrent (const int cpu_id) __attribute__((visibility("default")))
 Get the current clock frequency of a core. More...
 
uint64_t freq_getCpuClockMax (const int cpu_id) __attribute__((visibility("default")))
 Get the maximal clock frequency of a core. More...
 
uint64_t freq_getCpuClockMin (const int cpu_id) __attribute__((visibility("default")))
 Get the minimal clock frequency of a core. More...
 
char * freq_getGovernor (const int cpu_id) __attribute__((visibility("default")))
 Get the frequency governor of a core. More...
 
int freq_getTurbo (const int cpu_id) __attribute__((visibility("default")))
 Get state of turbo mode for core. More...
 
uint64_t freq_getUncoreFreqCur (const int socket_id) __attribute__((visibility("default")))
 Get the current Uncore frequency. More...
 
uint64_t freq_getUncoreFreqMax (const int socket_id) __attribute__((visibility("default")))
 Get the maximal Uncore frequency. More...
 
uint64_t freq_getUncoreFreqMin (const int socket_id) __attribute__((visibility("default")))
 Get the minimal Uncore frequency. More...
 
uint64_t freq_setCpuClockMax (const int cpu_id, const uint64_t freq) __attribute__((visibility("default")))
 Set the maximal clock frequency of a core. More...
 
uint64_t freq_setCpuClockMin (const int cpu_id, const uint64_t freq) __attribute__((visibility("default")))
 Set the minimal clock frequency of a core. More...
 
int freq_setGovernor (const int cpu_id, const char *gov) __attribute__((visibility("default")))
 Set the frequency governor of a core. More...
 
int freq_setTurbo (const int cpu_id, int turbo) __attribute__((visibility("default")))
 De/Activate turbo mode for core. More...
 
int freq_setUncoreFreqMax (const int socket_id, const uint64_t freq) __attribute__((visibility("default")))
 Set the maximal Uncore frequency. More...
 
int freq_setUncoreFreqMin (const int socket_id, const uint64_t freq) __attribute__((visibility("default")))
 Set the minimal Uncore frequency. More...
 

Detailed Description

Function Documentation

char* freq_getAvailFreq ( const int  cpu_id)

Get the available frequencies of a core.

Get the available frequencies of a core. The returned string must be freed by the caller.

Parameters
[in]cpu_idCPU ID
Returns
String with available frequencies or NULL in case of errors
char* freq_getAvailGovs ( const int  cpu_id)

Get the available frequency governors of a core.

Get the available frequency governors of a core. The returned string must be freed by the caller.

Parameters
[in]cpu_idCPU ID
Returns
String with available frequency governors or NULL in case of errors
uint64_t freq_getCpuClockCurrent ( const int  cpu_id)

Get the current clock frequency of a core.

Get the current clock frequency of a core

Parameters
[in]cpu_idCPU ID
Returns
Frequency or 0 in case of errors
uint64_t freq_getCpuClockMax ( const int  cpu_id)

Get the maximal clock frequency of a core.

Get the maximal clock frequency of a core

Parameters
[in]cpu_idCPU ID
Returns
Frequency or 0 in case of errors
uint64_t freq_getCpuClockMin ( const int  cpu_id)

Get the minimal clock frequency of a core.

Get the minimal clock frequency of a core

Parameters
[in]cpu_idCPU ID
Returns
Frequency or 0 in case of errors
char* freq_getGovernor ( const int  cpu_id)

Get the frequency governor of a core.

Get the frequency governor of a core. The returned string must be freed by the caller.

Parameters
[in]cpu_idCPU ID
Returns
Governor or NULL in case of errors
int freq_getTurbo ( const int  cpu_id)

Get state of turbo mode for core.

Get state of turbo mode for core

Parameters
[in]cpu_idCPU ID
Returns
1=Turbo active or 0=Turbo inactive
uint64_t freq_getUncoreFreqCur ( const int  socket_id)

Get the current Uncore frequency.

Get the current Uncore frequency.

Parameters
[in]socket_idID of socket
Returns
frequency in MHz or 0 at failure
uint64_t freq_getUncoreFreqMax ( const int  socket_id)

Get the maximal Uncore frequency.

Get the maximal Uncore frequency.

Parameters
[in]socket_idID of socket
Returns
frequency in MHz or 0 at failure
uint64_t freq_getUncoreFreqMin ( const int  socket_id)

Get the minimal Uncore frequency.

Get the minimal Uncore frequency.

Parameters
[in]socket_idID of socket
Returns
frequency in MHz or 0 at failure
uint64_t freq_setCpuClockMax ( const int  cpu_id,
const uint64_t  freq 
)

Set the maximal clock frequency of a core.

Set the maximal clock frequency of a core

Parameters
[in]cpu_idCPU ID
[in]freqFrequency in kHz
Returns
Frequency or 0 in case of errors
uint64_t freq_setCpuClockMin ( const int  cpu_id,
const uint64_t  freq 
)

Set the minimal clock frequency of a core.

Set the minimal clock frequency of a core

Parameters
[in]cpu_idCPU ID
[in]freqFrequency in kHz
Returns
Frequency or 0 in case of errors
int freq_setGovernor ( const int  cpu_id,
const char *  gov 
)

Set the frequency governor of a core.

Set the frequency governor of a core.

Parameters
[in]cpu_idCPU ID
[in]govGovernor
Returns
1 or 0 in case of errors
int freq_setTurbo ( const int  cpu_id,
int  turbo 
)

De/Activate turbo mode for core.

De/Activate turbo mode for core

Parameters
[in]cpu_idCPU ID
[in]turbo(0=off, 1=on)
Returns
1 or 0 in case of errors
int freq_setUncoreFreqMax ( const int  socket_id,
const uint64_t  freq 
)

Set the maximal Uncore frequency.

Set the maximal Uncore frequency. Since the ranges are not documented, valid frequencies are from minimal CPU clock to maximal Turbo clock. If selecting a frequency at the borders, please check the result with the UNCORE_CLOCK event to be effective.

Parameters
[in]socket_idID of socket
[in]freqFrequency in MHz
Returns
0 for success, -ERROR at failure
int freq_setUncoreFreqMin ( const int  socket_id,
const uint64_t  freq 
)

Set the minimal Uncore frequency.

Set the minimal Uncore frequency. Since the ranges are not documented, valid frequencies are from minimal CPU clock to maximal Turbo clock. If selecting a frequency at the borders, please check the result with the UNCORE_CLOCK event to be effective.

Parameters
[in]socket_idID of socket
[in]freqFrequency in MHz
Returns
0 for success, -ERROR at failure