13 #define REFRESH_LAT 4000 15 #define INVALID_RESULT -1000000L 72 PAPIERROR(
"This shouldn't be possible\n");
102 struct dirent *hwmonx;
112 dir = opendir(base_dir);
114 SUBDBG(
"Can't find %s, are you sure the coretemp module is loaded?\n",
120 while( (hwmonx = readdir(dir) ) ) {
121 if ( !strncmp(
"hwmon", hwmonx->d_name, 5) ) {
126 for(pathnum=0;pathnum<
NUM_PATHS;pathnum++) {
128 snprintf(path,
PATH_MAX,
"%s/%s/%s",
129 base_dir, hwmonx->d_name,paths[pathnum]);
131 SUBDBG(
"Trying to open %s\n",path);
145 modulename[strlen(modulename)-1]=
'\0';
150 SUBDBG(
"Found module %s\n",modulename);
172 location[strlen(location)-1]=
'\0';
181 if (
fff==NULL)
continue;
186 SUBDBG(
"Unable to generate name %s:in%i_input\n", hwmonx->d_name,
i);
218 location[strlen(location)-1]=
'\0';
227 if (
fff==NULL)
continue;
232 SUBDBG(
"Unable to generate name %s:temp%i_input\n", hwmonx->d_name,
i);
263 location[strlen(location)-1]=
'\0';
271 SUBDBG(
"Unable to generate filename %s/fan%d_input\n", path,
i);
276 if (
fff==NULL)
continue;
281 SUBDBG(
"Unable to generate name %s:fan%i_input\n", hwmonx->d_name,
i);
331 result=strtoll(
buf, NULL, 10);
453 long long **
events,
int flags)
589 switch ( modifier ) {
606 *EventCode = *EventCode + 1;
625 int index = EventCode;
640 int index = EventCode;
653 int index = EventCode;
674 .short_name =
"coretemp",
675 .description =
"Linux hwmon temperature and other info",
686 .fast_real_timer = 0,
687 .fast_virtual_timer = 0,
689 .attach_must_ptrace = 0,
char description[PAPI_MAX_STR_LEN]
static int _coretemp_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
char disabled_reason[PAPI_MAX_STR_LEN]
char units[PAPI_MIN_STR_LEN]
static int _coretemp_set_domain(hwd_control_state_t *cntl, int domain)
int coretemp_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
static int _coretemp_shutdown_thread(hwd_context_t *ctx)
static int _coretemp_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
char long_descr[PAPI_HUGE_STR_LEN]
static struct temp_event * root
char filename[MAXNAMESIZE]
static CORETEMP_native_event_entry_t * _coretemp_native_events
char units[MAX_EVENTS][BUFSIZ]
PAPI_component_info_t cmp_info
Return codes and api definitions.
static int _coretemp_ntv_code_to_name(unsigned int EventCode, char *name, int len)
char events[MAX_EVENTS][BUFSIZ]
char name[PAPI_MAX_STR_LEN]
static int _coretemp_init_thread(hwd_context_t *ctx)
coretemp component This file has the source code for a component that enables PAPI-C to access hardwa...
static int _coretemp_shutdown_component()
char units[PAPI_MIN_STR_LEN]
long long counts[CORETEMP_MAX_COUNTERS]
static int _coretemp_ntv_enum_events(unsigned int *EventCode, int modifier)
char symbol[PAPI_HUGE_STR_LEN]
CORETEMP_register_t resources
char units[PAPI_MIN_STR_LEN]
char description[PAPI_MAX_STR_LEN]
#define CORETEMP_MAX_COUNTERS
#define SUBDBG(format, args...)
void PAPIERROR(char *format,...)
static int _coretemp_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
static int _coretemp_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
static int _coretemp_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
char name[PAPI_MAX_STR_LEN]
static struct temp_event * last
char location[PAPI_MAX_STR_LEN]
static int is_initialized
static int _coretemp_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
static int _coretemp_init_component(int cidx)
static int generateEventList(char *base_dir)
papi_vector_t _coretemp_vector
static int insert_in_list(char *name, char *units, char *description, char *filename)
long long PAPI_get_real_usec(void)
static long long getEventValue(int index)
static int _coretemp_init_control_state(hwd_control_state_t *ctl)
static int _coretemp_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
static int _coretemp_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
#define papi_calloc(a, b)
char name[PAPI_MAX_STR_LEN]