19#define REFRESH_LAT 50000
21#define INVALID_RESULT -1000000L
22#define MICPOWER_NUMBER_OF_NATIVE_EVENTS 16
29 .description =
"Total power, win 0",
30 .resources.selector = 1
34 .description =
"Total power, win 1",
35 .resources.selector = 2
39 .description =
"PCI-E connector power",
40 .resources.selector = 3
44 .description =
"Instantaneous power",
45 .resources.selector = 4
49 .description =
"Max Instantaneous power",
50 .resources.selector = 5
54 .description =
"2x3 connector power",
55 .resources.selector = 6
59 .description =
"2x4 connector power",
60 .resources.selector = 7
64 .description =
"Core rail; Power reading",
65 .resources.selector = 8
69 .description =
"Core rail; Current",
70 .resources.selector = 9
72 { .name =
"vccp:volt",
74 .description =
"Core rail; Voltage",
75 .resources.selector = 10
79 .description =
"Uncore rail; Power reading",
80 .resources.selector = 11
84 .description =
"Uncore rail; Current",
85 .resources.selector = 12
87 { .name =
"vddg:volt",
89 .description =
"Uncore rail; Voltage",
90 .resources.selector = 13
94 .description =
"Memory subsystem rail; Power reading",
95 .resources.selector = 14
99 .description =
"Memory subsystem rail; Current",
100 .resources.selector = 15
102 { .name =
"vddq:volt",
104 .description =
"Memory subsystem rail; Voltage",
105 .resources.selector = 16
117From Intel docs, power readings are exported via sysfs at
118/sys/
class/micras/power
120typedeftruct mr_rsp_pws {
125typedef struct mr_rsp_vrr {
135I am assuming
for the purposes of
this component that only
136the readings are exported.
137typedef
struct mr_rsp_power {
157 fp = fopen(
"/sys/class/micras/power",
"r" );
165 retval&= fscanf(
fp,
"%lld %lld %lld", &counts[
i], &counts[
i+1], &counts[
i+2] );
202 if ( 0 != access(
"/sys/class/micras/power", R_OK ) ) {
256 long long **
events,
int flags)
391 switch ( modifier ) {
408 *EventCode = *EventCode + 1;
476 .short_name =
"micpower",
477 .description =
"Component for reading power on Intel Xeon Phi (MIC)",
488 .fast_real_timer = 0,
489 .fast_virtual_timer = 0,
491 .attach_must_ptrace = 0,
get real time counter value in microseconds
struct papi_vectors * _papi_hwd[]
char events[MAX_EVENTS][BUFSIZ]
static int _micpower_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
static int _micpower_ntv_code_to_name(unsigned int EventCode, char *name, int len)
static int _micpower_shutdown_component()
static int _micpower_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
papi_vector_t _micpower_vector
static int _micpower_init_control_state(hwd_control_state_t *ctl)
static int _micpower_ntv_enum_events(unsigned int *EventCode, int modifier)
static int is_initialized
static int _micpower_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
static int _micpower_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
static int _micpower_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
static int _micpower_init_component(int cidx)
#define MICPOWER_NUMBER_OF_NATIVE_EVENTS
static int _micpower_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
static int _micpower_init_thread(hwd_context_t *ctx)
static int _micpower_shutdown_thread(hwd_context_t *ctx)
static int _micpower_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
static int _micpower_set_domain(hwd_control_state_t *cntl, int domain)
static int read_sysfs_file(long long *counts)
static MICPOWER_native_event_entry_t _micpower_native_events[]
static int _micpower_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
Mic power component This file has the source code for a component that enables PAPI-C to access hardw...
#define MICPOWER_MAX_COUNTERS
#define PAPI_NATIVE_AND_MASK
Return codes and api definitions.
int fclose(FILE *__stream)
long long counts[MICPOWER_MAX_COUNTERS]
char units[PAPI_MIN_STR_LEN]
MICPOWER_register_t resources
char name[PAPI_MAX_STR_LEN]
char description[PAPI_MAX_STR_LEN]
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char units[PAPI_MIN_STR_LEN]
char symbol[PAPI_HUGE_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]
PAPI_component_info_t cmp_info