libmsr
0.3.0
A friendlier interface to accessing MSRs on Intel platforms
|
#include <inttypes.h>
#include <stdio.h>
#include "msr_core.h"
#include "msr_clocks.h"
#include "memhdlr.h"
#include "cpuid.h"
#include "libmsr_debug.h"
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. | |
#define __STDC_FORMAT_MACROS |
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.
[in] | cd | Pointer to clock-related data. |
void dump_clock_mod | ( | struct clock_mod * | s, |
FILE * | writedest | ||
) |
Print clock modulation data.
[in] | s | Data for clock modulation. |
[in] | writedest | File stream where output will be written to. |
void dump_clocks_data_readable | ( | FILE * | writedest | ) |
Print detailed clocks data.
[in] | writedest | File stream where output will be written to. |
void dump_clocks_data_terse | ( | FILE * | writedest | ) |
Print abbreviated clocks data.
[in] | writedest | File 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.
[in] | writedest | File stream where output will be written to. |
void dump_p_state | ( | FILE * | writedest | ) |
Print current p-state.
[in] | writedest | File 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.
[in] | socket | Unique socket/package identifier. |
[in] | core | Unique core identifier. |
[out] | s | Data 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.
[in] | pd | Pointer to perf-related data. |
int set_clock_mod | ( | int | socket, |
int | core, | ||
struct clock_mod * | s | ||
) |
Change value of IA32_CLOCK_MODULATION.
[in] | socket | Unique socket/package identifier. |
[in] | core | Unique core identifier. |
[in] | s | Data for clock modulation. |
void set_p_state | ( | unsigned | socket, |
uint64_t | pstate | ||
) |
Request new current p-state.
[in] | socket | Unique socket/package identifier. |
[in] | pstate | Desired p-state. |