PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-coretemp.c
Go to the documentation of this file.
1 #include <string.h>
2 
3 /* Headers required by PAPI */
4 #include "papi.h"
5 #include "papi_internal.h"
6 #include "papi_vector.h"
7 #include "papi_memory.h"
8 
9 #include "linux-coretemp.h"
10 
11 /* this is what I found on my core2 machine
12  * but I have not explored this widely yet*/
13 #define REFRESH_LAT 4000
14 
15 #define INVALID_RESULT -1000000L
16 
18 
19 /* temporary event */
20 struct temp_event {
25  char path[PATH_MAX];
26  int stone;
27  long count;
28  struct temp_event *next;
29 };
30 
31 
33 static int num_events = 0;
34 static int is_initialized = 0;
35 
36 /***************************************************************************/
37 /****** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT *******/
38 /***************************************************************************/
39 
40 static struct temp_event* root = NULL;
41 static struct temp_event *last = NULL;
42 
43 static int
44 insert_in_list(char *name, char *units,
45  char *description, char *filename) {
46 
47 
48  struct temp_event *temp;
49 
50 
51  /* new_event path, events->d_name */
52  temp = (struct temp_event *) papi_calloc(sizeof(struct temp_event),1);
53  if (temp==NULL) {
54  PAPIERROR("out of memory!");
55  /* We should also free any previously allocated data */
56  return PAPI_ENOMEM;
57  }
58 
59  temp->next = NULL;
60 
61  if (root == NULL) {
62  root = temp;
63  }
64  else if (last) {
65  last->next = temp;
66  }
67  else {
68  /* Because this is a function, it is possible */
69  /* we are called with root!=NULL but no last */
70  /* so add this to keep coverity happy */
71  free(temp);
72  PAPIERROR("This shouldn't be possible\n");
73 
74  return PAPI_ECMP;
75  }
76 
77  last = temp;
78 
79  snprintf(temp->name, PAPI_MAX_STR_LEN, "%s", name);
80  snprintf(temp->units, PAPI_MIN_STR_LEN, "%s", units);
81  snprintf(temp->description, PAPI_MAX_STR_LEN, "%s", description);
82  snprintf(temp->path, PATH_MAX, "%s", filename);
83 
84  return PAPI_OK;
85 }
86 
87 /*
88  * find all coretemp information reported by the kernel
89  */
90 static int
91 generateEventList(char *base_dir)
92 {
94  char modulename[PAPI_MIN_STR_LEN],
99  DIR *dir,*d;
100  FILE *fff;
101  int count = 0;
102  struct dirent *hwmonx;
103  int i,pathnum;
104 
105 #define NUM_PATHS 2
106  char paths[NUM_PATHS][PATH_MAX]={
107  "device","."
108  };
109 
110  /* Open "/sys/class/hwmon" */
111  dir = opendir(base_dir);
112  if ( dir == NULL ) {
113  SUBDBG("Can't find %s, are you sure the coretemp module is loaded?\n",
114  base_dir);
115  return 0;
116  }
117 
118  /* Iterate each /sys/class/hwmonX/device directory */
119  while( (hwmonx = readdir(dir) ) ) {
120  if ( !strncmp("hwmon", hwmonx->d_name, 5) ) {
121 
122  /* Found a hwmon directory */
123 
124  /* Sometimes the files are in ./, sometimes in device/ */
125  for(pathnum=0;pathnum<NUM_PATHS;pathnum++) {
126 
127  snprintf(path, PATH_MAX, "%s/%s/%s",
128  base_dir, hwmonx->d_name,paths[pathnum]);
129 
130  SUBDBG("Trying to open %s\n",path);
131  d = opendir(path);
132  if (d==NULL) {
133  continue;
134  }
135 
136  /* Get the name of the module */
137 
138  snprintf(filename, PAPI_MAX_STR_LEN, "%s/name",path);
139  fff=fopen(filename,"r");
140  if (fff==NULL) {
141  snprintf(modulename, PAPI_MIN_STR_LEN, "Unknown");
142  } else {
143  if (fgets(modulename,PAPI_MIN_STR_LEN,fff)!=NULL) {
144  modulename[strlen(modulename)-1]='\0';
145  }
146  fclose(fff);
147  }
148 
149  SUBDBG("Found module %s\n",modulename);
150 
151  /******************************************************/
152  /* Try handling all events starting with in (voltage) */
153  /******************************************************/
154 
155 
156  /* arbitrary maximum */
157  /* the problem is the numbering can be sparse */
158  /* should probably go back to dirent listing */
159 
160  for(i=0;i<32;i++) {
161 
162  /* Try looking for a location label */
163  snprintf(filename, PAPI_MAX_STR_LEN, "%s/in%d_label",
164  path,i);
165  fff=fopen(filename,"r");
166  if (fff==NULL) {
167  strncpy(location,"?",PAPI_MIN_STR_LEN);
168  }
169  else {
170  if (fgets(location,PAPI_MIN_STR_LEN,fff)!=NULL) {
171  location[strlen(location)-1]='\0';
172  }
173  fclose(fff);
174  }
175 
176  /* Look for input temperature */
177  snprintf(filename, PAPI_MAX_STR_LEN, "%s/in%d_input",
178  path,i);
179  fff=fopen(filename,"r");
180  if (fff==NULL) continue;
181  fclose(fff);
182 
183  snprintf(name, PAPI_MAX_STR_LEN, "%s:in%i_input",
184  hwmonx->d_name, i);
185  snprintf(units, PAPI_MIN_STR_LEN, "V");
186  snprintf(description, PAPI_MAX_STR_LEN, "%s, %s module, label %s",
187  units,modulename,
188  location);
189 
190  if (insert_in_list(name,units,description,filename)!=PAPI_OK) {
191  goto done_error;
192  }
193 
194  count++;
195 
196  }
197 
198  /************************************************************/
199  /* Try handling all events starting with temp (temperature) */
200  /************************************************************/
201 
202  for(i=0;i<32;i++) {
203 
204  /* Try looking for a location label */
205  snprintf(filename, PAPI_MAX_STR_LEN, "%s/temp%d_label",
206  path,i);
207  fff=fopen(filename,"r");
208  if (fff==NULL) {
209  strncpy(location,"?",PAPI_MIN_STR_LEN);
210  }
211  else {
212  if (fgets(location,PAPI_MIN_STR_LEN,fff)!=NULL) {
213  location[strlen(location)-1]='\0';
214  }
215  fclose(fff);
216  }
217 
218  /* Look for input temperature */
219  snprintf(filename, PAPI_MAX_STR_LEN, "%s/temp%d_input",
220  path,i);
221  fff=fopen(filename,"r");
222  if (fff==NULL) continue;
223  fclose(fff);
224 
225  snprintf(name, PAPI_MAX_STR_LEN, "%s:temp%i_input",
226  hwmonx->d_name, i);
227  snprintf(units, PAPI_MIN_STR_LEN, "degrees C");
228  snprintf(description, PAPI_MAX_STR_LEN, "%s, %s module, label %s",
229  units,modulename,
230  location);
231 
232  if (insert_in_list(name,units,description,filename)!=PAPI_OK) {
233  goto done_error;
234  }
235 
236  count++;
237  }
238 
239  /************************************************************/
240  /* Try handling all events starting with fan (fan) */
241  /************************************************************/
242 
243  for(i=0;i<32;i++) {
244 
245  /* Try looking for a location label */
246  snprintf(filename, PAPI_MAX_STR_LEN, "%s/fan%d_label",
247  path,i);
248  fff=fopen(filename,"r");
249  if (fff==NULL) {
250  strncpy(location,"?",PAPI_MIN_STR_LEN);
251  }
252  else {
253  if (fgets(location,PAPI_MIN_STR_LEN,fff)!=NULL) {
254  location[strlen(location)-1]='\0';
255  }
256  fclose(fff);
257  }
258 
259  /* Look for input fan */
260  snprintf(filename, PAPI_MAX_STR_LEN, "%s/fan%d_input",
261  path,i);
262  fff=fopen(filename,"r");
263  if (fff==NULL) continue;
264  fclose(fff);
265 
266  snprintf(name, PAPI_MAX_STR_LEN, "%s:fan%i_input",
267  hwmonx->d_name, i);
268  snprintf(units, PAPI_MIN_STR_LEN, "RPM");
269  snprintf(description, PAPI_MAX_STR_LEN, "%s, %s module, label %s",
270  units,modulename,
271  location);
272 
273  if (insert_in_list(name,units,description,filename)!=PAPI_OK) {
274  goto done_error;
275  }
276 
277  count++;
278 
279  }
280  closedir(d);
281  }
282  }
283  }
284 
285  closedir(dir);
286  return count;
287 
288 done_error:
289  closedir(d);
290  closedir(dir);
291  return PAPI_ECMP;
292 }
293 
294 static long long
295 getEventValue( int index )
296 {
297  char buf[PAPI_MAX_STR_LEN];
298  FILE* fp;
299  long result;
300 
301  if (_coretemp_native_events[index].stone) {
302  return _coretemp_native_events[index].value;
303  }
304 
305  fp = fopen(_coretemp_native_events[index].path, "r");
306  if (fp==NULL) {
307  return INVALID_RESULT;
308  }
309 
310  if (fgets(buf, PAPI_MAX_STR_LEN, fp)==NULL) {
311  result=INVALID_RESULT;
312  }
313  else {
314  result=strtoll(buf, NULL, 10);
315  }
316  fclose(fp);
317 
318  return result;
319 }
320 
321 /*****************************************************************************
322  ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS *************
323  *****************************************************************************/
324 
325 /*
326  * This is called whenever a thread is initialized
327  */
328 int
330 {
331  ( void ) ctx;
332  return PAPI_OK;
333 }
334 
335 
336 
337 /* Initialize hardware counters, setup the function vector table
338  * and get hardware information, this routine is called when the
339  * PAPI process is initialized (IE PAPI_library_init)
340  */
341 int
343 {
344  int i = 0;
345  struct temp_event *t,*last;
346 
347  if ( is_initialized )
348  return (PAPI_OK );
349 
350  is_initialized = 1;
351 
352  /* This is the prefered method, all coretemp sensors are symlinked here
353  * see $(kernel_src)/Documentation/hwmon/sysfs-interface */
354 
355  num_events = generateEventList("/sys/class/hwmon");
356 
357  if ( num_events < 0 ) {
358  strncpy(_coretemp_vector.cmp_info.disabled_reason,
359  "Cannot open /sys/class/hwmon",PAPI_MAX_STR_LEN);
360  return PAPI_ENOCMP;
361  }
362 
363  if ( num_events == 0 ) {
364  strncpy(_coretemp_vector.cmp_info.disabled_reason,
365  "No coretemp events found",PAPI_MAX_STR_LEN);
366  return PAPI_ENOCMP;
367  }
368 
369  t = root;
370 
371  _coretemp_native_events = (CORETEMP_native_event_entry_t*)
373 
374  do {
375  strncpy(_coretemp_native_events[i].name,t->name,PAPI_MAX_STR_LEN);
376  strncpy(_coretemp_native_events[i].path,t->path,PATH_MAX);
377  strncpy(_coretemp_native_events[i].units,t->units,PAPI_MIN_STR_LEN);
378  strncpy(_coretemp_native_events[i].description,t->description,
380  _coretemp_native_events[i].stone = 0;
381  _coretemp_native_events[i].resources.selector = i + 1;
382  last = t;
383  t = t->next;
384  papi_free(last);
385  i++;
386  } while (t != NULL);
387  root = NULL;
388 
389  /* Export the total number of events available */
390  _coretemp_vector.cmp_info.num_native_events = num_events;
391 
392  /* Export the component id */
393  _coretemp_vector.cmp_info.CmpIdx = cidx;
394 
395  return PAPI_OK;
396 }
397 
398 
399 
400 
401 /*
402  * Control of counters (Reading/Writing/Starting/Stopping/Setup)
403  * functions
404  */
405 int
407 {
408  int i;
409 
411 
412  for ( i=0; i < num_events; i++ ) {
413  coretemp_ctl->counts[i] = getEventValue(i);
414  }
415 
416  /* Set last access time for caching results */
417  coretemp_ctl->lastupdate = PAPI_get_real_usec();
418 
419  return PAPI_OK;
420 }
421 
422 int
424 {
425  ( void ) ctx;
426  ( void ) ctl;
427 
428  return PAPI_OK;
429 }
430 
431 int
433  long long ** events, int flags)
434 {
435  (void) flags;
436  (void) ctx;
437 
439  long long now = PAPI_get_real_usec();
440  int i;
441 
442  /* Only read the values from the kernel if enough time has passed */
443  /* since the last read. Otherwise return cached values. */
444 
445  if ( now - control->lastupdate > REFRESH_LAT ) {
446  for ( i = 0; i < num_events; i++ ) {
447  control->counts[i] = getEventValue( i );
448  }
449  control->lastupdate = now;
450  }
451 
452  /* Pass back a pointer to our results */
453  *events = control->counts;
454 
455  return PAPI_OK;
456 }
457 
458 int
460 {
461  (void) ctx;
462  /* read values */
464  int i;
465 
466  for ( i = 0; i < num_events; i++ ) {
467  control->counts[i] = getEventValue( i );
468  }
469 
470  return PAPI_OK;
471 }
472 
473 /* Shutdown a thread */
474 int
476 {
477  ( void ) ctx;
478  return PAPI_OK;
479 }
480 
481 
482 /*
483  * Clean up what was setup in coretemp_init_component().
484  */
485 int
487 {
488  if ( is_initialized ) {
489  is_initialized = 0;
490  papi_free(_coretemp_native_events);
491  _coretemp_native_events = NULL;
492  }
493  return PAPI_OK;
494 }
495 
496 
497 /* This function sets various options in the component
498  * The valid codes being passed in are PAPI_SET_DEFDOM,
499  * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
500  */
501 int
503 {
504  ( void ) ctx;
505  ( void ) code;
506  ( void ) option;
507 
508  return PAPI_OK;
509 }
510 
511 
512 int
514  NativeInfo_t * native, int count,
515  hwd_context_t * ctx )
516 {
517  int i, index;
518  ( void ) ctx;
519  ( void ) ptr;
520 
521  for ( i = 0; i < count; i++ ) {
522  index = native[i].ni_event;
523  native[i].ni_position = _coretemp_native_events[index].resources.selector - 1;
524  }
525  return PAPI_OK;
526 }
527 
528 
529 /*
530  * This function has to set the bits needed to count different domains
531  * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER
532  * By default return PAPI_EINVAL if none of those are specified
533  * and PAPI_OK with success
534  * PAPI_DOM_USER is only user context is counted
535  * PAPI_DOM_KERNEL is only the Kernel/OS context is counted
536  * PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses)
537  * PAPI_DOM_ALL is all of the domains
538  */
539 int
541 {
542  int found = 0;
543  ( void ) cntl;
544 
545  if ( PAPI_DOM_USER & domain )
546  found = 1;
547 
548  if ( PAPI_DOM_KERNEL & domain )
549  found = 1;
550 
551  if ( PAPI_DOM_OTHER & domain )
552  found = 1;
553 
554  if ( !found )
555  return PAPI_EINVAL;
556 
557  return PAPI_OK;
558 }
559 
560 
561 int
563 {
564  ( void ) ctx;
565  ( void ) ctl;
566 
567  return PAPI_OK;
568 }
569 
570 
571 /*
572  * Native Event functions
573  */
574 int
575 _coretemp_ntv_enum_events( unsigned int *EventCode, int modifier )
576 {
577 
578  int index;
579 
580  switch ( modifier ) {
581 
582  case PAPI_ENUM_FIRST:
583 
584  if (num_events==0) {
585  return PAPI_ENOEVNT;
586  }
587  *EventCode = 0;
588 
589  return PAPI_OK;
590 
591 
592  case PAPI_ENUM_EVENTS:
593 
594  index = *EventCode;
595 
596  if ( index < num_events - 1 ) {
597  *EventCode = *EventCode + 1;
598  return PAPI_OK;
599  } else {
600  return PAPI_ENOEVNT;
601  }
602  break;
603 
604  default:
605  return PAPI_EINVAL;
606  }
607  return PAPI_EINVAL;
608 }
609 
610 /*
611  *
612  */
613 int
614 _coretemp_ntv_code_to_name( unsigned int EventCode, char *name, int len )
615 {
616  int index = EventCode;
617 
618  if ( index >= 0 && index < num_events ) {
619  strncpy( name, _coretemp_native_events[index].name, len );
620  return PAPI_OK;
621  }
622  return PAPI_ENOEVNT;
623 }
624 
625 /*
626  *
627  */
628 int
629 _coretemp_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
630 {
631  int index = EventCode;
632 
633  if ( index >= 0 && index < num_events ) {
634  strncpy( name, _coretemp_native_events[index].description, len );
635  return PAPI_OK;
636  }
637  return PAPI_ENOEVNT;
638 }
639 
640 int
641 _coretemp_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
642 {
643 
644  int index = EventCode;
645 
646  if ( ( index < 0) || (index >= num_events )) return PAPI_ENOEVNT;
647 
648  strncpy( info->symbol, _coretemp_native_events[index].name,
649  sizeof(info->symbol));
650 
651  strncpy( info->long_descr, _coretemp_native_events[index].description,
652  sizeof(info->long_descr));
653 
654  strncpy( info->units, _coretemp_native_events[index].units,
655  sizeof(info->units));
656 
657 
658  return PAPI_OK;
659 }
660 
661 
662 
663 /*
664  *
665  */
666 papi_vector_t _coretemp_vector = {
667  .cmp_info = {
668  /* default component information (unspecified values are initialized to 0) */
669  .name = "coretemp",
670  .short_name = "coretemp",
671  .description = "Linux hwmon temperature and other info",
672  .version = "4.2.1",
673  .num_mpx_cntrs = CORETEMP_MAX_COUNTERS,
674  .num_cntrs = CORETEMP_MAX_COUNTERS,
675  .default_domain = PAPI_DOM_USER,
676  //.available_domains = PAPI_DOM_USER,
677  .default_granularity = PAPI_GRN_THR,
678  .available_granularities = PAPI_GRN_THR,
679  .hardware_intr_sig = PAPI_INT_SIGNAL,
680 
681  /* component specific cmp_info initializations */
682  .fast_real_timer = 0,
683  .fast_virtual_timer = 0,
684  .attach = 0,
685  .attach_must_ptrace = 0,
686  .available_domains = PAPI_DOM_USER | PAPI_DOM_KERNEL,
687  }
688  ,
689 
690  /* sizes of framework-opaque component-private structures */
691  .size = {
692  .context = sizeof ( CORETEMP_context_t ),
693  .control_state = sizeof ( CORETEMP_control_state_t ),
694  .reg_value = sizeof ( CORETEMP_register_t ),
695  .reg_alloc = sizeof ( CORETEMP_reg_alloc_t ),
696  }
697  ,
698  /* function pointers in this component */
699  .init_thread = _coretemp_init_thread,
700  .init_component = _coretemp_init_component,
701  .init_control_state = _coretemp_init_control_state,
702  .start = _coretemp_start,
703  .stop = _coretemp_stop,
704  .read = _coretemp_read,
705  .shutdown_thread = _coretemp_shutdown_thread,
706  .shutdown_component = _coretemp_shutdown_component,
707  .ctl = _coretemp_ctl,
708 
709  .update_control_state = _coretemp_update_control_state,
710  .set_domain = _coretemp_set_domain,
711  .reset = _coretemp_reset,
712 
713  .ntv_enum_events = _coretemp_ntv_enum_events,
714  .ntv_code_to_name = _coretemp_ntv_code_to_name,
715  .ntv_code_to_descr = _coretemp_ntv_code_to_descr,
716  .ntv_code_to_info = _coretemp_ntv_code_to_info,
717 };
char description[PAPI_MAX_STR_LEN]
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:625
#define PAPI_ENOMEM
Definition: fpapi.h:107
int _coretemp_init_thread(hwd_context_t *ctx)
long long flags
Definition: iozone.c:12330
#define papi_free(a)
Definition: papi_memory.h:35
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
int _coretemp_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
#define PAPI_MIN_STR_LEN
Definition: fpapi.h:41
int coretemp_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
#define PAPI_ENOEVNT
Definition: fpapi.h:112
#define INVALID_RESULT
static int num_events
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:964
int _coretemp_set_domain(hwd_control_state_t *cntl, int domain)
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:961
int _coretemp_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
static struct temp_event * root
#define PAPI_ENOCMP
Definition: fpapi.h:122
char filename[MAXNAMESIZE]
Definition: iozone.c:1360
#define PAPI_DOM_OTHER
Definition: fpapi.h:23
fclose(thread_wqfd)
static CORETEMP_native_event_entry_t * _coretemp_native_events
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int _coretemp_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Return codes and api definitions.
FILE * fff[MAX_EVENTS]
unsigned int selector
struct temp_event * next
int _coretemp_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
char name[PAPI_MAX_STR_LEN]
coretemp component This file has the source code for a component that enables PAPI-C to access hardwa...
t
Definition: iozone.c:23562
char disabled_reason[PAPI_MAX_STR_LEN]
Definition: papi.h:632
int _coretemp_ntv_enum_events(unsigned int *EventCode, int modifier)
int i
Definition: fileop.c:140
char buf[200]
Definition: iozone.c:19609
int _coretemp_ntv_code_to_name(unsigned int EventCode, char *name, int len)
char units[PAPI_MIN_STR_LEN]
long long counts[CORETEMP_MAX_COUNTERS]
long long found
Definition: libasync.c:735
free(dummyfile[xx])
static int cidx
Definition: event_info.c:40
#define PAPI_ECMP
Definition: fpapi.h:109
CORETEMP_register_t resources
static int native
Definition: event_info.c:39
char units[PAPI_MIN_STR_LEN]
char description[PAPI_MAX_STR_LEN]
#define CORETEMP_MAX_COUNTERS
int _coretemp_init_component(int cidx)
int stone
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define NUM_PATHS
static FILE * fp
void PAPIERROR(char *format,...)
char events[MAX_EVENTS][BUFSIZ]
static struct temp_event * last
#define PAPI_INT_SIGNAL
Definition: papi_internal.h:53
int _coretemp_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
char location[PAPI_MAX_STR_LEN]
static int is_initialized
int _coretemp_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
#define REFRESH_LAT
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)
Definition: papi.c:6125
static long long getEventValue(int index)
#define PATH_MAX
Definition: fileop.c:68
int _coretemp_init_control_state(hwd_control_state_t *ctl)
char * name
Definition: iozone.c:23648
int temp
Definition: iozone.c:22158
int _coretemp_shutdown_component()
long value
#define PAPI_DOM_USER
Definition: fpapi.h:21
int _coretemp_shutdown_thread(hwd_context_t *ctx)
int _coretemp_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
char path[PATH_MAX]
int _coretemp_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
char units[PAPI_MIN_STR_LEN]
Definition: papi.h:970
#define PAPI_GRN_THR
Definition: fpapi.h:67
#define papi_calloc(a, b)
Definition: papi_memory.h:37
char name[PAPI_MAX_STR_LEN]
char * ptr
Definition: iozone.c:23586