LIKWID
Enumerations | Functions
Retrieval and manipulation of processor features

Enumerations

enum  CpuFeature {
  FEAT_HW_PREFETCHER =0, FEAT_CL_PREFETCHER, FEAT_DCU_PREFETCHER, FEAT_IP_PREFETCHER,
  FEAT_FAST_STRINGS, FEAT_THERMAL_CONTROL, FEAT_PERF_MON, FEAT_FERR_MULTIPLEX,
  FEAT_BRANCH_TRACE_STORAGE, FEAT_XTPR_MESSAGE, FEAT_PEBS, FEAT_SPEEDSTEP,
  FEAT_MONITOR, FEAT_SPEEDSTEP_LOCK, FEAT_CPUID_MAX_VAL, FEAT_XD_BIT,
  FEAT_DYN_ACCEL, FEAT_TURBO_MODE, FEAT_TM2, CPUFEATURES_MAX
}
 Enumeration of all CPU related features. More...
 

Functions

int cpuFeatures_disable (int cpu, CpuFeature type, int print) __attribute__((visibility("default")))
 Disable a CPU feature for a specific CPU. More...
 
int cpuFeatures_enable (int cpu, CpuFeature type, int print) __attribute__((visibility("default")))
 Enable a CPU feature for a specific CPU. More...
 
int cpuFeatures_get (int cpu, CpuFeature type) __attribute__((visibility("default")))
 Get state of a CPU feature for a given CPU. More...
 
void cpuFeatures_init () __attribute__((visibility("default")))
 Initialize the internal feature variables for all CPUs. More...
 
char * cpuFeatures_name (CpuFeature type) __attribute__((visibility("default")))
 Get the name of a CPU feature. More...
 
void cpuFeatures_print (int cpu) __attribute__((visibility("default")))
 Print state of all CPU features for a given CPU. More...
 

Detailed Description

Enumeration Type Documentation

enum CpuFeature

Enumeration of all CPU related features.

Enumerator
FEAT_HW_PREFETCHER 

Hardware prefetcher.

FEAT_CL_PREFETCHER 

Adjacent cache line prefetcher.

FEAT_DCU_PREFETCHER 

DCU L1 data cache prefetcher.

FEAT_IP_PREFETCHER 

IP L1 data cache prefetcher.

FEAT_FAST_STRINGS 

Fast-strings feature.

FEAT_THERMAL_CONTROL 

Automatic Thermal Control Circuit.

FEAT_PERF_MON 

Hardware performance monitoring.

FEAT_FERR_MULTIPLEX 

FERR# Multiplexing, must be 1 for XAPIC interrupt model.

FEAT_BRANCH_TRACE_STORAGE 

Branch Trace Storage.

FEAT_XTPR_MESSAGE 

xTPR Message to set processor priority

FEAT_PEBS 

Precise Event Based Sampling (PEBS)

FEAT_SPEEDSTEP 

Enhanced Intel SpeedStep Technology to reduce energy consumption.

FEAT_MONITOR 

MONITOR/MWAIT feature to monitor write-back stores.

FEAT_SPEEDSTEP_LOCK 

Enhanced Intel SpeedStep Technology Select Lock.

FEAT_CPUID_MAX_VAL 

Limit CPUID Maxval.

FEAT_XD_BIT 

Execute Disable Bit.

FEAT_DYN_ACCEL 

Intel Dynamic Acceleration.

FEAT_TURBO_MODE 

Intel Turbo Mode.

FEAT_TM2 

Thermal Monitoring 2.

Function Documentation

int cpuFeatures_disable ( int  cpu,
CpuFeature  type,
int  print 
)

Disable a CPU feature for a specific CPU.

Disable a CPU feature for a specific CPU. Only the state of the prefetchers can be changed, all other features return -EINVAL

Parameters
[in]cpuCPU ID
[in]typeCPU feature
[in]printPrint outcome of operation
Returns
Status of operation (0=success, all others are erros, either by MSR access or invalid feature)
int cpuFeatures_enable ( int  cpu,
CpuFeature  type,
int  print 
)

Enable a CPU feature for a specific CPU.

Enable a CPU feature for a specific CPU. Only the state of the prefetchers can be changed, all other features return -EINVAL

Parameters
[in]cpuCPU ID
[in]typeCPU feature
[in]printPrint outcome of operation
Returns
Status of operation (0=success, all others are erros, either by MSR access or invalid feature)
int cpuFeatures_get ( int  cpu,
CpuFeature  type 
)

Get state of a CPU feature for a given CPU.

Get state of a CPU feature for a given CPU

Parameters
[in]cpuCPU ID
[in]typeCPU feature
Returns
State of CPU feature (1=enabled, 0=disabled)
void cpuFeatures_init ( )

Initialize the internal feature variables for all CPUs.

Initialize the internal feature variables for all CPUs

char* cpuFeatures_name ( CpuFeature  type)

Get the name of a CPU feature.

Get the name of a CPU feature

Parameters
[in]typeCPU feature
Returns
Name of the CPU feature or NULL if feature is not available
void cpuFeatures_print ( int  cpu)

Print state of all CPU features for a given CPU.

Print state of all CPU features for a given CPU

Parameters
[in]cpuCPU ID