libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Classes | Functions
msr_clocks.h File Reference
#include <stdint.h>
#include "master.h"
Include dependency graph for msr_clocks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  clock_mod
 Structure containing data for IA32_CLOCK_MODULATION. More...
 
struct  clocks_data
 Structure containing data for IA32_APERF, IA32_MPERF, and IA32_TIME_STAMP_COUNTER. More...
 
struct  perf_data
 Structure containing data for IA32_PERF_STATUS and IA32_PERF_CTL. More...
 

Functions

void clocks_storage (struct clocks_data **cd)
 Allocate array for storing raw register data from IA32_APERF, IA32_MPERF, and IA32_TIME_STAMP_COUNTER.
 
void perf_storage (struct perf_data **pd)
 Allocate array for storing raw register data from IA32_PERF_STATUS and IA32_PERF_CTL.
 
void dump_clocks_data_terse_label (FILE *writedest)
 Print the label for the abbreviated clocks data print out.
 
void dump_clocks_data_terse (FILE *writedest)
 Print abbreviated clocks data.
 
void dump_p_state (FILE *writedest)
 Print current p-state.
 
void set_p_state (unsigned socket, uint64_t pstate)
 Request new current p-state.
 
void dump_clocks_data_readable (FILE *writedest)
 Print detailed clocks data.
 
void dump_clock_mod (struct clock_mod *s, FILE *writedest)
 Print clock modulation data.
 
void get_clock_mod (int socket, int core, struct clock_mod *s)
 Get contents of IA32_CLOCK_MODULATION.
 
int set_clock_mod (int socket, int core, struct clock_mod *s)
 Change value of IA32_CLOCK_MODULATION.
 

Function Documentation

void clocks_storage ( struct clocks_data **  cd)

Allocate array for storing raw register data from IA32_APERF, IA32_MPERF, and IA32_TIME_STAMP_COUNTER.

There are plans to use a struct to make the indirection less crazy.

Parameters
[in]cdPointer to clock-related data.
void dump_clock_mod ( struct clock_mod s,
FILE *  writedest 
)

Print clock modulation data.

Parameters
[in]sData for clock modulation.
[in]writedestFile stream where output will be written to.
void dump_clocks_data_readable ( FILE *  writedest)

Print detailed clocks data.

Parameters
[in]writedestFile stream where output will be written to.
void dump_clocks_data_terse ( FILE *  writedest)

Print abbreviated clocks data.

Parameters
[in]writedestFile stream where output will be written to.
void dump_clocks_data_terse_label ( FILE *  writedest)

Print the label for the abbreviated clocks data print out.

Parameters
[in]writedestFile stream where output will be written to.
void dump_p_state ( FILE *  writedest)

Print current p-state.

Parameters
[in]writedestFile stream where output will be written to.
void get_clock_mod ( int  socket,
int  core,
struct clock_mod s 
)

Get contents of IA32_CLOCK_MODULATION.

Parameters
[in]socketUnique socket/package identifier.
[in]coreUnique core identifier.
[out]sData for clock modulation.
void perf_storage ( struct perf_data **  pd)

Allocate array for storing raw register data from IA32_PERF_STATUS and IA32_PERF_CTL.

Parameters
[in]pdPointer to perf-related data.
int set_clock_mod ( int  socket,
int  core,
struct clock_mod s 
)

Change value of IA32_CLOCK_MODULATION.

Parameters
[in]socketUnique socket/package identifier.
[in]coreUnique core identifier.
[in]sData for clock modulation.
void set_p_state ( unsigned  socket,
uint64_t  pstate 
)

Request new current p-state.

Parameters
[in]socketUnique socket/package identifier.
[in]pstateDesired p-state.