libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Macros | Functions
msr_clocks.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include "msr_core.h"
#include "msr_clocks.h"
#include "memhdlr.h"
#include "cpuid.h"
#include "libmsr_debug.h"
Include dependency graph for msr_clocks.c:

Macros

#define __STDC_FORMAT_MACROS
 

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.
 

Macro Definition Documentation

#define __STDC_FORMAT_MACROS

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.