PAPI  5.6.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(1, sizeof(struct temp_event));
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 static 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 static 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  _coretemp_native_events[i].name[PAPI_MAX_STR_LEN-1] = '\0';
377  strncpy(_coretemp_native_events[i].path,t->path,PATH_MAX);
378  _coretemp_native_events[i].path[PATH_MAX-1] = '\0';
379  strncpy(_coretemp_native_events[i].units,t->units,PAPI_MIN_STR_LEN);
380  _coretemp_native_events[i].units[PAPI_MIN_STR_LEN-1] = '\0';
381  strncpy(_coretemp_native_events[i].description,t->description,PAPI_MAX_STR_LEN);
382  _coretemp_native_events[i].description[PAPI_MAX_STR_LEN-1] = '\0';
383  _coretemp_native_events[i].stone = 0;
384  _coretemp_native_events[i].resources.selector = i + 1;
385  last = t;
386  t = t->next;
387  papi_free(last);
388  i++;
389  } while (t != NULL);
390  root = NULL;
391 
392  /* Export the total number of events available */
393  _coretemp_vector.cmp_info.num_native_events = num_events;
394 
395  /* Export the component id */
396  _coretemp_vector.cmp_info.CmpIdx = cidx;
397 
398  return PAPI_OK;
399 }
400 
401 
402 
403 
404 /*
405  * Control of counters (Reading/Writing/Starting/Stopping/Setup)
406  * functions
407  */
408 static int
410 {
411  int i;
412 
414 
415  for ( i=0; i < num_events; i++ ) {
416  coretemp_ctl->counts[i] = getEventValue(i);
417  }
418 
419  /* Set last access time for caching results */
420  coretemp_ctl->lastupdate = PAPI_get_real_usec();
421 
422  return PAPI_OK;
423 }
424 
425 static int
427 {
428  ( void ) ctx;
429  ( void ) ctl;
430 
431  return PAPI_OK;
432 }
433 
434 static int
436  long long ** events, int flags)
437 {
438  (void) flags;
439  (void) ctx;
440 
442  long long now = PAPI_get_real_usec();
443  int i;
444 
445  /* Only read the values from the kernel if enough time has passed */
446  /* since the last read. Otherwise return cached values. */
447 
448  if ( now - control->lastupdate > REFRESH_LAT ) {
449  for ( i = 0; i < num_events; i++ ) {
450  control->counts[i] = getEventValue( i );
451  }
452  control->lastupdate = now;
453  }
454 
455  /* Pass back a pointer to our results */
456  *events = control->counts;
457 
458  return PAPI_OK;
459 }
460 
461 static int
463 {
464  (void) ctx;
465  /* read values */
467  int i;
468 
469  for ( i = 0; i < num_events; i++ ) {
470  control->counts[i] = getEventValue( i );
471  }
472 
473  return PAPI_OK;
474 }
475 
476 /* Shutdown a thread */
477 static int
479 {
480  ( void ) ctx;
481  return PAPI_OK;
482 }
483 
484 
485 /*
486  * Clean up what was setup in coretemp_init_component().
487  */
488 static int
490 {
491  if ( is_initialized ) {
492  is_initialized = 0;
493  papi_free(_coretemp_native_events);
494  _coretemp_native_events = NULL;
495  }
496  return PAPI_OK;
497 }
498 
499 
500 /* This function sets various options in the component
501  * The valid codes being passed in are PAPI_SET_DEFDOM,
502  * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
503  */
504 static int
506 {
507  ( void ) ctx;
508  ( void ) code;
509  ( void ) option;
510 
511  return PAPI_OK;
512 }
513 
514 
515 static int
517  NativeInfo_t * native, int count,
518  hwd_context_t * ctx )
519 {
520  int i, index;
521  ( void ) ctx;
522  ( void ) ptr;
523 
524  for ( i = 0; i < count; i++ ) {
525  index = native[i].ni_event;
526  native[i].ni_position = _coretemp_native_events[index].resources.selector - 1;
527  }
528  return PAPI_OK;
529 }
530 
531 
532 /*
533  * This function has to set the bits needed to count different domains
534  * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER
535  * By default return PAPI_EINVAL if none of those are specified
536  * and PAPI_OK with success
537  * PAPI_DOM_USER is only user context is counted
538  * PAPI_DOM_KERNEL is only the Kernel/OS context is counted
539  * PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses)
540  * PAPI_DOM_ALL is all of the domains
541  */
542 static int
544 {
545  (void) cntl;
546  if ( PAPI_DOM_ALL != domain )
547  return PAPI_EINVAL;
548 
549  return PAPI_OK;
550 }
551 
552 
553 static int
555 {
556  ( void ) ctx;
557  ( void ) ctl;
558 
559  return PAPI_OK;
560 }
561 
562 
563 /*
564  * Native Event functions
565  */
566 static int
567 _coretemp_ntv_enum_events( unsigned int *EventCode, int modifier )
568 {
569 
570  int index;
571 
572  switch ( modifier ) {
573 
574  case PAPI_ENUM_FIRST:
575 
576  if (num_events==0) {
577  return PAPI_ENOEVNT;
578  }
579  *EventCode = 0;
580 
581  return PAPI_OK;
582 
583 
584  case PAPI_ENUM_EVENTS:
585 
586  index = *EventCode;
587 
588  if ( index < num_events - 1 ) {
589  *EventCode = *EventCode + 1;
590  return PAPI_OK;
591  } else {
592  return PAPI_ENOEVNT;
593  }
594  break;
595 
596  default:
597  return PAPI_EINVAL;
598  }
599  return PAPI_EINVAL;
600 }
601 
602 /*
603  *
604  */
605 static int
606 _coretemp_ntv_code_to_name( unsigned int EventCode, char *name, int len )
607 {
608  int index = EventCode;
609 
610  if ( index >= 0 && index < num_events ) {
611  strncpy( name, _coretemp_native_events[index].name, len );
612  return PAPI_OK;
613  }
614  return PAPI_ENOEVNT;
615 }
616 
617 /*
618  *
619  */
620 static int
621 _coretemp_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
622 {
623  int index = EventCode;
624 
625  if ( index >= 0 && index < num_events ) {
626  strncpy( name, _coretemp_native_events[index].description, len );
627  return PAPI_OK;
628  }
629  return PAPI_ENOEVNT;
630 }
631 
632 static int
633 _coretemp_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
634 {
635 
636  int index = EventCode;
637 
638  if ( ( index < 0) || (index >= num_events )) return PAPI_ENOEVNT;
639 
640  strncpy( info->symbol, _coretemp_native_events[index].name, sizeof(info->symbol));
641  strncpy( info->long_descr, _coretemp_native_events[index].description, sizeof(info->long_descr));
642  strncpy( info->units, _coretemp_native_events[index].units, sizeof(info->units));
643  info->units[sizeof(info->units)-1] = '\0';
644 
645  return PAPI_OK;
646 }
647 
648 
649 
650 /*
651  *
652  */
653 papi_vector_t _coretemp_vector = {
654  .cmp_info = {
655  /* default component information (unspecified values are initialized to 0) */
656  .name = "coretemp",
657  .short_name = "coretemp",
658  .description = "Linux hwmon temperature and other info",
659  .version = "4.2.1",
660  .num_mpx_cntrs = CORETEMP_MAX_COUNTERS,
661  .num_cntrs = CORETEMP_MAX_COUNTERS,
662  .default_domain = PAPI_DOM_ALL,
663  .available_domains = PAPI_DOM_ALL,
664  .default_granularity = PAPI_GRN_SYS,
665  .available_granularities = PAPI_GRN_SYS,
666  .hardware_intr_sig = PAPI_INT_SIGNAL,
667 
668  /* component specific cmp_info initializations */
669  .fast_real_timer = 0,
670  .fast_virtual_timer = 0,
671  .attach = 0,
672  .attach_must_ptrace = 0,
673  }
674  ,
675 
676  /* sizes of framework-opaque component-private structures */
677  .size = {
678  .context = sizeof ( CORETEMP_context_t ),
679  .control_state = sizeof ( CORETEMP_control_state_t ),
680  .reg_value = sizeof ( CORETEMP_register_t ),
681  .reg_alloc = sizeof ( CORETEMP_reg_alloc_t ),
682  }
683  ,
684  /* function pointers in this component */
685  .init_thread = _coretemp_init_thread,
686  .init_component = _coretemp_init_component,
687  .init_control_state = _coretemp_init_control_state,
688  .start = _coretemp_start,
689  .stop = _coretemp_stop,
690  .read = _coretemp_read,
691  .shutdown_thread = _coretemp_shutdown_thread,
692  .shutdown_component = _coretemp_shutdown_component,
693  .ctl = _coretemp_ctl,
694 
695  .update_control_state = _coretemp_update_control_state,
696  .set_domain = _coretemp_set_domain,
697  .reset = _coretemp_reset,
698 
699  .ntv_enum_events = _coretemp_ntv_enum_events,
700  .ntv_code_to_name = _coretemp_ntv_code_to_name,
701  .ntv_code_to_descr = _coretemp_ntv_code_to_descr,
702  .ntv_code_to_info = _coretemp_ntv_code_to_info,
703 };
char description[PAPI_MAX_STR_LEN]
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:629
#define PAPI_ENOEVNT
Definition: papi.h:260
static int _coretemp_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
long long flags
Definition: iozone.c:12330
#define papi_free(a)
Definition: papi_memory.h:35
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)
#define INVALID_RESULT
static int num_events
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:969
static int _coretemp_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:966
#define PAPI_DOM_ALL
Definition: papi.h:303
return PAPI_OK
Definition: linux-nvml.c:497
int count
Definition: iozone.c:22422
static struct temp_event * root
char filename[MAXNAMESIZE]
Definition: iozone.c:1360
fclose(thread_wqfd)
static CORETEMP_native_event_entry_t * _coretemp_native_events
void
Definition: iozone.c:18627
char units[MAX_EVENTS][BUFSIZ]
Definition: powercap_plot.c:15
return PAPI_EINVAL
Definition: linux-nvml.c:436
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static FILE * fp
Return codes and api definitions.
static int _coretemp_ntv_code_to_name(unsigned int EventCode, char *name, int len)
FILE * fff[MAX_EVENTS]
unsigned int selector
struct temp_event * next
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...
t
Definition: iozone.c:23562
static int cidx
char disabled_reason[PAPI_MAX_STR_LEN]
Definition: papi.h:636
static int _coretemp_shutdown_component()
int i
Definition: fileop.c:140
char buf[200]
Definition: iozone.c:19609
char units[PAPI_MIN_STR_LEN]
long long counts[CORETEMP_MAX_COUNTERS]
static int _coretemp_ntv_enum_events(unsigned int *EventCode, int modifier)
free(dummyfile[xx])
CORETEMP_register_t resources
char units[PAPI_MIN_STR_LEN]
char description[PAPI_MAX_STR_LEN]
#define CORETEMP_MAX_COUNTERS
int stone
static int native
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define NUM_PATHS
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)
#define PAPI_ECMP
Definition: papi.h:256
static struct temp_event * last
#define PAPI_INT_SIGNAL
Definition: papi_internal.h:53
char location[PAPI_MAX_STR_LEN]
#define PAPI_ENOMEM
Definition: papi.h:254
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)
#define REFRESH_LAT
#define PAPI_ENOCMP
Definition: papi.h:270
static int generateEventList(char *base_dir)
papi_vector_t _coretemp_vector
static int insert_in_list(char *name, char *units, char *description, char *filename)
char path[PATH_MAX]
long long PAPI_get_real_usec(void)
Definition: papi.c:6264
static long long getEventValue(int index)
#define PATH_MAX
Definition: fileop.c:68
char * name
Definition: iozone.c:23648
#define PAPI_MIN_STR_LEN
Definition: papi.h:464
int temp
Definition: iozone.c:22158
static int _coretemp_init_control_state(hwd_control_state_t *ctl)
long value
#define PAPI_MAX_STR_LEN
Definition: papi.h:465
#define PAPI_GRN_SYS
Definition: papi.h:366
char path[PATH_MAX]
static int _coretemp_ntv_code_to_info(unsigned int EventCode, PAPI_event_info_t *info)
char units[PAPI_MIN_STR_LEN]
Definition: papi.h:975
static int _coretemp_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
#define papi_calloc(a, b)
Definition: papi_memory.h:37
char name[PAPI_MAX_STR_LEN]
char * ptr
Definition: iozone.c:23586