PAPI  5.6.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-rapl.c File Reference

rapl component More...

Include dependency graph for linux-rapl.c:

Go to the source code of this file.

Data Structures

struct  _rapl_register_t
 
struct  _rapl_native_event_entry_t
 
struct  _rapl_reg_alloc_t
 
struct  _rapl_control_state_t
 
struct  _rapl_context_t
 
struct  fd_array_t
 

Macros

#define MSR_RAPL_POWER_UNIT   0x606
 
#define MSR_PKG_RAPL_POWER_LIMIT   0x610
 
#define MSR_PKG_ENERGY_STATUS   0x611
 
#define MSR_PKG_PERF_STATUS   0x613
 
#define MSR_PKG_POWER_INFO   0x614
 
#define MSR_PP0_POWER_LIMIT   0x638
 
#define MSR_PP0_ENERGY_STATUS   0x639
 
#define MSR_PP0_POLICY   0x63A
 
#define MSR_PP0_PERF_STATUS   0x63B
 
#define MSR_PP1_POWER_LIMIT   0x640
 
#define MSR_PP1_ENERGY_STATUS   0x641
 
#define MSR_PP1_POLICY   0x642
 
#define MSR_DRAM_POWER_LIMIT   0x618
 
#define MSR_DRAM_ENERGY_STATUS   0x619
 
#define MSR_DRAM_PERF_STATUS   0x61B
 
#define MSR_DRAM_POWER_INFO   0x61C
 
#define MSR_PLATFORM_ENERGY_STATUS   0x64d
 
#define POWER_UNIT_OFFSET   0
 
#define POWER_UNIT_MASK   0x0f
 
#define ENERGY_UNIT_OFFSET   0x08
 
#define ENERGY_UNIT_MASK   0x1f
 
#define TIME_UNIT_OFFSET   0x10
 
#define TIME_UNIT_MASK   0x0f
 
#define POWER_INFO_UNIT_MASK   0x7fff
 
#define THERMAL_SHIFT   0
 
#define MINIMUM_POWER_SHIFT   16
 
#define MAXIMUM_POWER_SHIFT   32
 
#define MAXIMUM_TIME_WINDOW_SHIFT   48
 
#define RAPL_MAX_COUNTERS   64
 
#define PACKAGE_ENERGY   0
 
#define PACKAGE_THERMAL   1
 
#define PACKAGE_MINIMUM   2
 
#define PACKAGE_MAXIMUM   3
 
#define PACKAGE_TIME_WINDOW   4
 
#define PACKAGE_ENERGY_CNT   5
 
#define PACKAGE_THERMAL_CNT   6
 
#define PACKAGE_MINIMUM_CNT   7
 
#define PACKAGE_MAXIMUM_CNT   8
 
#define PACKAGE_TIME_WINDOW_CNT   9
 
#define DRAM_ENERGY   10
 
#define PLATFORM_ENERGY   11
 

Functions

static long long read_msr (int fd, int which)
 
static int open_fd (int offset)
 
static long long read_rapl_value (int index)
 
static long long convert_rapl_energy (int index, long long value)
 
static int get_kernel_nr_cpus (void)
 
static int _rapl_init_thread (hwd_context_t *ctx)
 
static int _rapl_init_component (int cidx)
 
static int _rapl_init_control_state (hwd_control_state_t *ctl)
 
static int _rapl_start (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
static int _rapl_stop (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
static int _rapl_shutdown_thread (hwd_context_t *ctx)
 
int _rapl_read (hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
 
static int _rapl_shutdown_component (void)
 
static int _rapl_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option)
 
static int _rapl_update_control_state (hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
 
static int _rapl_set_domain (hwd_control_state_t *ctl, int domain)
 
static int _rapl_reset (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
static int _rapl_ntv_enum_events (unsigned int *EventCode, int modifier)
 
static int _rapl_ntv_code_to_name (unsigned int EventCode, char *name, int len)
 
static int _rapl_ntv_code_to_descr (unsigned int EventCode, char *name, int len)
 
static int _rapl_ntv_code_to_info (unsigned int EventCode, PAPI_event_info_t *info)
 

Variables

papi_vector_t _rapl_vector
 
static _rapl_native_event_entry_trapl_native_events =NULL
 
static int num_events = 0
 
struct fd_array_tfd_array =NULL
 
static int num_packages =0
 
static int num_cpus =0
 
int power_divisor
 
int time_divisor
 
int cpu_energy_divisor
 
int dram_energy_divisor
 

Detailed Description

Author
Vince Weaver

This component enables RAPL (Running Average Power Level) energy measurements on Intel SandyBridge/IvyBridge/Haswell

To work, either msr_safe kernel module from LLNL (https://github.com/scalability-llnl/msr-safe), or the x86 generic MSR driver must be installed (CONFIG_X86_MSR) and the /dev/cpu/?/<msr_safe | msr> files must have read permissions

Definition in file linux-rapl.c.

Macro Definition Documentation

#define DRAM_ENERGY   10

Definition at line 153 of file linux-rapl.c.

#define ENERGY_UNIT_MASK   0x1f

Definition at line 74 of file linux-rapl.c.

#define ENERGY_UNIT_OFFSET   0x08

Definition at line 73 of file linux-rapl.c.

#define MAXIMUM_POWER_SHIFT   32

Definition at line 83 of file linux-rapl.c.

#define MAXIMUM_TIME_WINDOW_SHIFT   48

Definition at line 84 of file linux-rapl.c.

#define MINIMUM_POWER_SHIFT   16

Definition at line 82 of file linux-rapl.c.

#define MSR_DRAM_ENERGY_STATUS   0x619

Definition at line 62 of file linux-rapl.c.

#define MSR_DRAM_PERF_STATUS   0x61B

Definition at line 63 of file linux-rapl.c.

#define MSR_DRAM_POWER_INFO   0x61C

Definition at line 64 of file linux-rapl.c.

#define MSR_DRAM_POWER_LIMIT   0x618

Definition at line 61 of file linux-rapl.c.

#define MSR_PKG_ENERGY_STATUS   0x611

Definition at line 45 of file linux-rapl.c.

#define MSR_PKG_PERF_STATUS   0x613

Definition at line 46 of file linux-rapl.c.

#define MSR_PKG_POWER_INFO   0x614

Definition at line 47 of file linux-rapl.c.

#define MSR_PKG_RAPL_POWER_LIMIT   0x610

Definition at line 44 of file linux-rapl.c.

#define MSR_PLATFORM_ENERGY_STATUS   0x64d

Definition at line 67 of file linux-rapl.c.

#define MSR_PP0_ENERGY_STATUS   0x639

Definition at line 51 of file linux-rapl.c.

#define MSR_PP0_PERF_STATUS   0x63B

Definition at line 53 of file linux-rapl.c.

#define MSR_PP0_POLICY   0x63A

Definition at line 52 of file linux-rapl.c.

#define MSR_PP0_POWER_LIMIT   0x638

Definition at line 50 of file linux-rapl.c.

#define MSR_PP1_ENERGY_STATUS   0x641

Definition at line 57 of file linux-rapl.c.

#define MSR_PP1_POLICY   0x642

Definition at line 58 of file linux-rapl.c.

#define MSR_PP1_POWER_LIMIT   0x640

Definition at line 56 of file linux-rapl.c.

#define MSR_RAPL_POWER_UNIT   0x606

Definition at line 41 of file linux-rapl.c.

#define PACKAGE_ENERGY   0

Definition at line 143 of file linux-rapl.c.

#define PACKAGE_ENERGY_CNT   5

Definition at line 148 of file linux-rapl.c.

#define PACKAGE_MAXIMUM   3

Definition at line 146 of file linux-rapl.c.

#define PACKAGE_MAXIMUM_CNT   8

Definition at line 151 of file linux-rapl.c.

#define PACKAGE_MINIMUM   2

Definition at line 145 of file linux-rapl.c.

#define PACKAGE_MINIMUM_CNT   7

Definition at line 150 of file linux-rapl.c.

#define PACKAGE_THERMAL   1

Definition at line 144 of file linux-rapl.c.

#define PACKAGE_THERMAL_CNT   6

Definition at line 149 of file linux-rapl.c.

#define PACKAGE_TIME_WINDOW   4

Definition at line 147 of file linux-rapl.c.

#define PACKAGE_TIME_WINDOW_CNT   9

Definition at line 152 of file linux-rapl.c.

#define PLATFORM_ENERGY   11

Definition at line 154 of file linux-rapl.c.

#define POWER_INFO_UNIT_MASK   0x7fff

Definition at line 80 of file linux-rapl.c.

#define POWER_UNIT_MASK   0x0f

Definition at line 71 of file linux-rapl.c.

#define POWER_UNIT_OFFSET   0

Definition at line 70 of file linux-rapl.c.

#define RAPL_MAX_COUNTERS   64

Definition at line 110 of file linux-rapl.c.

#define THERMAL_SHIFT   0

Definition at line 81 of file linux-rapl.c.

#define TIME_UNIT_MASK   0x0f

Definition at line 77 of file linux-rapl.c.

#define TIME_UNIT_OFFSET   0x10

Definition at line 76 of file linux-rapl.c.

Function Documentation

static int _rapl_ctl ( hwd_context_t ctx,
int  code,
_papi_int_option_t option 
)
static

Definition at line 934 of file linux-rapl.c.

935 {
936  ( void ) ctx;
937  ( void ) code;
938  ( void ) option;
939 
940  return PAPI_OK;
941 }
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
static int _rapl_init_component ( int  cidx)
static

Definition at line 307 of file linux-rapl.c.

308 {
309  int i,j,k,fd;
310  FILE *fff;
311  char filename[BUFSIZ];
312 
313  int package_avail, dram_avail, pp0_avail, pp1_avail, psys_avail;
314  int different_units;
315 
316  long long result;
317  int package;
318 
319  const PAPI_hw_info_t *hw_info;
320 
321  int nr_cpus = get_kernel_nr_cpus();
322  int packages[nr_cpus];
323  int cpu_to_use[nr_cpus];
324 
325  /* Fill with sentinel values */
326  for (i=0; i<nr_cpus; ++i) {
327  packages[i] = -1;
328  cpu_to_use[i] = -1;
329  }
330 
331 
332  /* check if Intel processor */
333  hw_info=&(_papi_hwi_system_info.hw_info);
334 
335  /* Ugh can't use PAPI_get_hardware_info() if
336  PAPI library not done initializing yet */
337 
338  if (hw_info->vendor!=PAPI_VENDOR_INTEL) {
340  "Not an Intel processor",PAPI_MAX_STR_LEN);
341  return PAPI_ENOSUPP;
342  }
343 
344  /* Make sure it is a family 6 Intel Chip */
345  if (hw_info->cpuid_family!=6) {
346  /* Not a family 6 machine */
348  "CPU family not supported",PAPI_MAX_STR_LEN);
349  return PAPI_ENOIMPL;
350  }
351 
352  /* Detect RAPL support */
353  switch(hw_info->cpuid_model) {
354 
355  /* Desktop / Laptops */
356 
357  case 42: /* SandyBridge */
358  case 58: /* IvyBridge */
359  package_avail=1;
360  pp0_avail=1;
361  pp1_avail=1;
362  dram_avail=0;
363  psys_avail=0;
364  different_units=0;
365  break;
366 
367  case 60: /* Haswell */
368  case 69: /* Haswell ULT */
369  case 70: /* Haswell GT3E */
370  case 92: /* Atom Goldmont */
371  case 122: /* Atom Gemini Lake */
372  case 95: /* Atom Denverton */
373  package_avail=1;
374  pp0_avail=1;
375  pp1_avail=1;
376  dram_avail=1;
377  psys_avail=0;
378  different_units=0;
379  break;
380 
381  case 61: /* Broadwell */
382  case 71: /* Broadwell-H (GT3E) */
383  case 86: /* Broadwell XEON_D */
384  package_avail=1;
385  pp0_avail=1;
386  pp1_avail=0;
387  dram_avail=1;
388  psys_avail=0;
389  different_units=0;
390  break;
391 
392  case 78: /* Skylake Mobile */
393  case 94: /* Skylake Desktop (H/S) */
394  case 142: /* Kabylake Mobile */
395  case 158: /* Kabylake Desktop */
396  package_avail=1;
397  pp0_avail=1;
398  pp1_avail=0;
399  dram_avail=1;
400  psys_avail=1;
401  different_units=0;
402  break;
403 
404  /* Server Class Machines */
405 
406  case 45: /* SandyBridge-EP */
407  case 62: /* IvyBridge-EP */
408  package_avail=1;
409  pp0_avail=1;
410  pp1_avail=0;
411  dram_avail=1;
412  psys_avail=0;
413  different_units=0;
414  break;
415 
416  case 63: /* Haswell-EP */
417  case 79: /* Broadwell-EP */
418  case 85: /* Skylake-X */
419  package_avail=1;
420  pp0_avail=1;
421  pp1_avail=0;
422  dram_avail=1;
423  psys_avail=0;
424  different_units=1;
425  break;
426 
427 
428  case 87: /* Knights Landing (KNL) */
429  case 133: /* Knights Mill (KNM) */
430  package_avail=1;
431  pp0_avail=0;
432  pp1_avail=0;
433  dram_avail=1;
434  psys_avail=0;
435  different_units=1;
436  break;
437 
438  default: /* not a supported model */
440  "CPU model not supported",
442  return PAPI_ENOIMPL;
443  }
444 
445  /* Detect how many packages */
446  j=0;
447  while(1) {
448  int num_read;
449 
450  sprintf(filename,
451  "/sys/devices/system/cpu/cpu%d/topology/physical_package_id",j);
452  fff=fopen(filename,"r");
453  if (fff==NULL) break;
454  num_read=fscanf(fff,"%d",&package);
455  fclose(fff);
456  if (num_read!=1) {
457  strcpy(_rapl_vector.cmp_info.disabled_reason, "Error reading file: ");
460  return PAPI_ESYS;
461  }
462 
463  /* Check if a new package */
464  if ((package >= 0) && (package < nr_cpus)) {
465  if (packages[package] == -1) {
466  SUBDBG("Found package %d out of total %d\n",package,num_packages);
467  packages[package]=package;
468  cpu_to_use[package]=j;
469  num_packages++;
470  }
471  } else {
472  SUBDBG("Package outside of allowed range\n");
474  "Package outside of allowed range",PAPI_MAX_STR_LEN);
475  return PAPI_ESYS;
476  }
477 
478  j++;
479  }
480  num_cpus=j;
481 
482  if (num_packages==0) {
483  SUBDBG("Can't access /dev/cpu/*/<msr_safe | msr>\n");
485  "Can't access /dev/cpu/*/<msr_safe | msr>",PAPI_MAX_STR_LEN);
486  return PAPI_ESYS;
487  }
488 
489  SUBDBG("Found %d packages with %d cpus\n",num_packages,num_cpus);
490 
491  /* Init fd_array */
492 
493  fd_array=papi_calloc(num_cpus, sizeof(struct fd_array_t));
494  if (fd_array==NULL) return PAPI_ENOMEM;
495 
496  fd=open_fd(cpu_to_use[0]);
497  if (fd<0) {
499  "Can't open fd for cpu0: %s",strerror(errno));
500  return PAPI_ESYS;
501  }
502 
503  /* Verify needed MSR is readable. In a guest VM it may not be readable*/
504  if (pread(fd, &result, sizeof result, MSR_RAPL_POWER_UNIT) != sizeof result ) {
506  "Unable to access RAPL registers",PAPI_MAX_STR_LEN);
507  return PAPI_ESYS;
508  }
509 
510  /* Calculate the units used */
511  result=read_msr(fd,MSR_RAPL_POWER_UNIT);
512 
513  /* units are 0.5^UNIT_VALUE */
514  /* which is the same as 1/(2^UNIT_VALUE) */
515 
519 
520  /* Note! On Haswell-EP DRAM energy is fixed at 15.3uJ */
521  /* see https://lkml.org/lkml/2015/3/20/582 */
522  /* Knights Landing is the same */
523  /* so is Broadwell-EP */
524  if ( different_units ) {
525  dram_energy_divisor=1<<16;
526  }
527  else {
529  }
530 
531  SUBDBG("Power units = %.3fW\n",1.0/power_divisor);
532  SUBDBG("CPU Energy units = %.8fJ\n",1.0/cpu_energy_divisor);
533  SUBDBG("DRAM Energy units = %.8fJ\n",1.0/dram_energy_divisor);
534  SUBDBG("Time units = %.8fs\n",1.0/time_divisor);
535 
536  /* Allocate space for events */
537  /* Include room for both counts and scaled values */
538 
539  num_events= ((package_avail*num_packages) +
540  (pp0_avail*num_packages) +
541  (pp1_avail*num_packages) +
542  (dram_avail*num_packages) +
543  (psys_avail*num_packages) +
544  (4*num_packages)) * 2;
545 
548 
549 
550  i = 0;
551  k = num_events/2;
552 
553  /* Create events for package power info */
554 
555  for(j=0;j<num_packages;j++) {
557  "THERMAL_SPEC_CNT:PACKAGE%d",j);
558  sprintf(rapl_native_events[i].description,
559  "Thermal specification in counts; package %d",j);
560  rapl_native_events[i].fd_offset=cpu_to_use[j];
565 
567  "THERMAL_SPEC:PACKAGE%d",j);
568  strncpy(rapl_native_events[k].units,"W",PAPI_MIN_STR_LEN);
569  sprintf(rapl_native_events[k].description,
570  "Thermal specification for package %d",j);
571  rapl_native_events[k].fd_offset=cpu_to_use[j];
576 
577  i++;
578  k++;
579  }
580 
581  for(j=0;j<num_packages;j++) {
583  "MINIMUM_POWER_CNT:PACKAGE%d",j);
584  sprintf(rapl_native_events[i].description,
585  "Minimum power in counts; package %d",j);
586  rapl_native_events[i].fd_offset=cpu_to_use[j];
591 
593  "MINIMUM_POWER:PACKAGE%d",j);
594  strncpy(rapl_native_events[k].units,"W",PAPI_MIN_STR_LEN);
595  sprintf(rapl_native_events[k].description,
596  "Minimum power for package %d",j);
597  rapl_native_events[k].fd_offset=cpu_to_use[j];
602 
603  i++;
604  k++;
605  }
606 
607  for(j=0;j<num_packages;j++) {
609  "MAXIMUM_POWER_CNT:PACKAGE%d",j);
610  sprintf(rapl_native_events[i].description,
611  "Maximum power in counts; package %d",j);
612  rapl_native_events[i].fd_offset=cpu_to_use[j];
617 
619  "MAXIMUM_POWER:PACKAGE%d",j);
620  strncpy(rapl_native_events[k].units,"W",PAPI_MIN_STR_LEN);
621  sprintf(rapl_native_events[k].description,
622  "Maximum power for package %d",j);
623  rapl_native_events[k].fd_offset=cpu_to_use[j];
628 
629  i++;
630  k++;
631  }
632 
633  for(j=0;j<num_packages;j++) {
635  "MAXIMUM_TIME_WINDOW_CNT:PACKAGE%d",j);
636  sprintf(rapl_native_events[i].description,
637  "Maximum time window in counts; package %d",j);
638  rapl_native_events[i].fd_offset=cpu_to_use[j];
643 
645  "MAXIMUM_TIME_WINDOW:PACKAGE%d",j);
646  strncpy(rapl_native_events[k].units,"s",PAPI_MIN_STR_LEN);
647  sprintf(rapl_native_events[k].description,
648  "Maximum time window for package %d",j);
649  rapl_native_events[k].fd_offset=cpu_to_use[j];
654 
655  i++;
656  k++;
657  }
658 
659  /* Create Events for energy measurements */
660 
661  if (package_avail) {
662  for(j=0;j<num_packages;j++) {
664  "PACKAGE_ENERGY_CNT:PACKAGE%d",j);
665  sprintf(rapl_native_events[i].description,
666  "Energy used in counts by chip package %d",j);
667  rapl_native_events[i].fd_offset=cpu_to_use[j];
672 
674  "PACKAGE_ENERGY:PACKAGE%d",j);
675  strncpy(rapl_native_events[k].units,"nJ",PAPI_MIN_STR_LEN);
676  sprintf(rapl_native_events[k].description,
677  "Energy used by chip package %d",j);
678  rapl_native_events[k].fd_offset=cpu_to_use[j];
683 
684  i++;
685  k++;
686  }
687  }
688 
689  if (pp1_avail) {
690  for(j=0;j<num_packages;j++) {
692  "PP1_ENERGY_CNT:PACKAGE%d",j);
693  sprintf(rapl_native_events[i].description,
694  "Energy used in counts by Power Plane 1 (Often GPU) on package %d",j);
695  rapl_native_events[i].fd_offset=cpu_to_use[j];
700 
702  "PP1_ENERGY:PACKAGE%d",j);
703  strncpy(rapl_native_events[k].units,"nJ",PAPI_MIN_STR_LEN);
704  sprintf(rapl_native_events[k].description,
705  "Energy used by Power Plane 1 (Often GPU) on package %d",j);
706  rapl_native_events[k].fd_offset=cpu_to_use[j];
711 
712  i++;
713  k++;
714  }
715  }
716 
717  if (dram_avail) {
718  for(j=0;j<num_packages;j++) {
720  "DRAM_ENERGY_CNT:PACKAGE%d",j);
721  sprintf(rapl_native_events[i].description,
722  "Energy used in counts by DRAM on package %d",j);
723  rapl_native_events[i].fd_offset=cpu_to_use[j];
728 
730  "DRAM_ENERGY:PACKAGE%d",j);
731  strncpy(rapl_native_events[k].units,"nJ",PAPI_MIN_STR_LEN);
732  sprintf(rapl_native_events[k].description,
733  "Energy used by DRAM on package %d",j);
734  rapl_native_events[k].fd_offset=cpu_to_use[j];
739 
740  i++;
741  k++;
742  }
743  }
744 
745  if (psys_avail) {
746  for(j=0;j<num_packages;j++) {
747 
749  "PSYS_ENERGY_CNT:PACKAGE%d",j);
750  sprintf(rapl_native_events[i].description,
751  "Energy used in counts by SoC on package %d",j);
752  rapl_native_events[i].fd_offset=cpu_to_use[j];
757 
759  "PSYS_ENERGY:PACKAGE%d",j);
760  strncpy(rapl_native_events[k].units,"nJ",PAPI_MIN_STR_LEN);
761  sprintf(rapl_native_events[k].description,
762  "Energy used by SoC on package %d",j);
763  rapl_native_events[k].fd_offset=cpu_to_use[j];
768 
769  i++;
770  k++;
771  }
772  }
773 
774  if (pp0_avail) {
775  for(j=0;j<num_packages;j++) {
777  "PP0_ENERGY_CNT:PACKAGE%d",j);
778  sprintf(rapl_native_events[i].description,
779  "Energy used in counts by all cores in package %d",j);
780  rapl_native_events[i].fd_offset=cpu_to_use[j];
785 
787  "PP0_ENERGY:PACKAGE%d",j);
788  strncpy(rapl_native_events[k].units,"nJ",PAPI_MIN_STR_LEN);
789  sprintf(rapl_native_events[k].description,
790  "Energy used by all cores in package %d",j);
791  rapl_native_events[k].fd_offset=cpu_to_use[j];
796 
797  i++;
798  k++;
799  }
800  }
801 
802  /* Export the total number of events available */
804 
807 
808 
809  /* Export the component id */
811 
812  return PAPI_OK;
813 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
#define TIME_UNIT_MASK
Definition: linux-rapl.c:77
#define PACKAGE_MAXIMUM
Definition: linux-rapl.c:146
int errno
static int num_events
Definition: linux-rapl.c:136
#define PLATFORM_ENERGY
Definition: linux-rapl.c:154
Hardware info structure.
Definition: papi.h:780
static long long read_msr(int fd, int which)
Definition: linux-rapl.c:161
#define PACKAGE_MAXIMUM_CNT
Definition: linux-rapl.c:151
#define PACKAGE_THERMAL
Definition: linux-rapl.c:144
#define PAPI_ENOSUPP
Definition: papi.h:271
int fd
Definition: iozone.c:1291
static int get_kernel_nr_cpus(void)
Definition: linux-rapl.c:271
static int num_packages
Definition: linux-rapl.c:138
#define ENERGY_UNIT_OFFSET
Definition: linux-rapl.c:73
return PAPI_OK
Definition: linux-nvml.c:497
char filename[MAXNAMESIZE]
Definition: iozone.c:1360
int type
Definition: linux-rapl.c:99
#define PACKAGE_ENERGY_CNT
Definition: linux-rapl.c:148
fclose(thread_wqfd)
#define DRAM_ENERGY
Definition: linux-rapl.c:153
char units[MAX_EVENTS][BUFSIZ]
Definition: powercap_plot.c:15
int power_divisor
Definition: linux-rapl.c:140
#define PACKAGE_TIME_WINDOW_CNT
Definition: linux-rapl.c:152
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define MSR_RAPL_POWER_UNIT
Definition: linux-rapl.c:41
#define MSR_PP1_ENERGY_STATUS
Definition: linux-rapl.c:57
FILE * fff[MAX_EVENTS]
#define PACKAGE_ENERGY
Definition: linux-rapl.c:143
struct fd_array_t * fd_array
Definition: linux-rapl.c:137
static int cidx
char disabled_reason[PAPI_MAX_STR_LEN]
Definition: papi.h:636
papi_vector_t _rapl_vector
Definition: linux-rapl.c:128
#define PACKAGE_MINIMUM_CNT
Definition: linux-rapl.c:150
int i
Definition: fileop.c:140
unsigned int selector
Definition: linux-rapl.c:89
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
int k
Definition: iozone.c:19136
static int open_fd(int offset)
Definition: linux-rapl.c:173
#define PACKAGE_MINIMUM
Definition: linux-rapl.c:145
#define MSR_PP0_ENERGY_STATUS
Definition: linux-rapl.c:51
#define PAPI_ESYS
Definition: papi.h:255
int cpu_energy_divisor
Definition: linux-rapl.c:141
int cpuid_model
Definition: papi.h:793
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PACKAGE_THERMAL_CNT
Definition: linux-rapl.c:149
#define ENERGY_UNIT_MASK
Definition: linux-rapl.c:74
#define POWER_UNIT_MASK
Definition: linux-rapl.c:71
int dram_energy_divisor
Definition: linux-rapl.c:141
int cpuid_family
Definition: papi.h:792
#define PAPI_ENOMEM
Definition: papi.h:254
#define PAPI_ENOIMPL
Definition: papi.h:272
#define MSR_PKG_ENERGY_STATUS
Definition: linux-rapl.c:45
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:56
strcpy(filename, default_filename)
PAPI_hw_info_t hw_info
#define MSR_PLATFORM_ENERGY_STATUS
Definition: linux-rapl.c:67
Definition: linux-rapl.c:92
#define PAPI_VENDOR_INTEL
Definition: papi.h:348
static int num_cpus
Definition: linux-rapl.c:138
int vendor
Definition: papi.h:787
char * name
Definition: iozone.c:23648
int time_divisor
Definition: linux-rapl.c:140
_rapl_register_t resources
Definition: linux-rapl.c:101
int return_type
Definition: linux-rapl.c:100
#define PAPI_MIN_STR_LEN
Definition: papi.h:464
int fd_offset
Definition: linux-rapl.c:97
#define TIME_UNIT_OFFSET
Definition: linux-rapl.c:76
#define PAPI_MAX_STR_LEN
Definition: papi.h:465
int msr
Definition: linux-rapl.c:98
long j
Definition: iozone.c:19135
#define MSR_DRAM_ENERGY_STATUS
Definition: linux-rapl.c:62
#define PACKAGE_TIME_WINDOW
Definition: linux-rapl.c:147
static const PAPI_hw_info_t * hw_info
Definition: byte_profile.c:28
#define POWER_UNIT_OFFSET
Definition: linux-rapl.c:70
#define MSR_PKG_POWER_INFO
Definition: linux-rapl.c:47
#define papi_calloc(a, b)
Definition: papi_memory.h:37

Here is the call graph for this function:

static int _rapl_init_control_state ( hwd_control_state_t ctl)
static

Definition at line 821 of file linux-rapl.c.

822 {
823 
825  int i;
826 
827  for(i=0;i<RAPL_MAX_COUNTERS;i++) {
828  control->being_measured[i]=0;
829  }
830 
831  return PAPI_OK;
832 }
return PAPI_OK
Definition: linux-nvml.c:497
#define RAPL_MAX_COUNTERS
Definition: linux-rapl.c:110
int i
Definition: fileop.c:140
int being_measured[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:114
static int _rapl_init_thread ( hwd_context_t ctx)
static

Definition at line 294 of file linux-rapl.c.

295 {
296  ( void ) ctx;
297 
298  return PAPI_OK;
299 }
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
static int _rapl_ntv_code_to_descr ( unsigned int  EventCode,
char *  name,
int  len 
)
static

Definition at line 1073 of file linux-rapl.c.

1074 {
1075  int index = EventCode;
1076 
1077  if ( index >= 0 && index < num_events ) {
1078  strncpy( name, rapl_native_events[index].description, len );
1079  return PAPI_OK;
1080  }
1081  return PAPI_ENOEVNT;
1082 }
#define PAPI_ENOEVNT
Definition: papi.h:260
static int num_events
Definition: linux-rapl.c:136
return PAPI_OK
Definition: linux-nvml.c:497
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
char * name
Definition: iozone.c:23648
static int _rapl_ntv_code_to_info ( unsigned int  EventCode,
PAPI_event_info_t info 
)
static

Definition at line 1085 of file linux-rapl.c.

1086 {
1087 
1088  int index = EventCode;
1089 
1090  if ( ( index < 0) || (index >= num_events )) return PAPI_ENOEVNT;
1091 
1092  strncpy( info->symbol, rapl_native_events[index].name, sizeof(info->symbol)-1);
1093  info->symbol[sizeof(info->symbol)-1] = '\0';
1094 
1095  strncpy( info->long_descr, rapl_native_events[index].description, sizeof(info->long_descr)-1);
1096  info->long_descr[sizeof(info->long_descr)-1] = '\0';
1097 
1098  strncpy( info->units, rapl_native_events[index].units, sizeof(info->units)-1);
1099  info->units[sizeof(info->units)-1] = '\0';
1100 
1101  info->data_type = rapl_native_events[index].return_type;
1102 
1103  return PAPI_OK;
1104 }
#define PAPI_ENOEVNT
Definition: papi.h:260
char name[PAPI_MAX_STR_LEN]
Definition: linux-rapl.c:94
static int num_events
Definition: linux-rapl.c:136
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:969
char units[PAPI_MIN_STR_LEN]
Definition: linux-rapl.c:95
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:966
return PAPI_OK
Definition: linux-nvml.c:497
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
char description[PAPI_MAX_STR_LEN]
Definition: linux-rapl.c:96
int return_type
Definition: linux-rapl.c:100
char units[PAPI_MIN_STR_LEN]
Definition: papi.h:975
static int _rapl_ntv_code_to_name ( unsigned int  EventCode,
char *  name,
int  len 
)
static

Definition at line 1056 of file linux-rapl.c.

1057 {
1058 
1059  int index = EventCode & PAPI_NATIVE_AND_MASK;
1060 
1061  if ( index >= 0 && index < num_events ) {
1062  strncpy( name, rapl_native_events[index].name, len );
1063  return PAPI_OK;
1064  }
1065 
1066  return PAPI_ENOEVNT;
1067 }
#define PAPI_ENOEVNT
Definition: papi.h:260
static int num_events
Definition: linux-rapl.c:136
return PAPI_OK
Definition: linux-nvml.c:497
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
char * name
Definition: iozone.c:23648
#define PAPI_NATIVE_AND_MASK
static int _rapl_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)
static

Definition at line 1016 of file linux-rapl.c.

1017 {
1018 
1019  int index;
1020 
1021  switch ( modifier ) {
1022 
1023  case PAPI_ENUM_FIRST:
1024 
1025  if (num_events==0) {
1026  return PAPI_ENOEVNT;
1027  }
1028  *EventCode = 0;
1029 
1030  return PAPI_OK;
1031 
1032 
1033  case PAPI_ENUM_EVENTS:
1034 
1035  index = *EventCode & PAPI_NATIVE_AND_MASK;
1036 
1037  if ( index < num_events - 1 ) {
1038  *EventCode = *EventCode + 1;
1039  return PAPI_OK;
1040  } else {
1041  return PAPI_ENOEVNT;
1042  }
1043  break;
1044 
1045  default:
1046  return PAPI_EINVAL;
1047  }
1048 
1049  return PAPI_EINVAL;
1050 }
#define PAPI_ENOEVNT
Definition: papi.h:260
static int num_events
Definition: linux-rapl.c:136
return PAPI_OK
Definition: linux-nvml.c:497
return PAPI_EINVAL
Definition: linux-nvml.c:436
#define PAPI_NATIVE_AND_MASK
int _rapl_read ( hwd_context_t ctx,
hwd_control_state_t ctl,
long long **  events,
int  flags 
)

Definition at line 895 of file linux-rapl.c.

897 {
898  (void) flags;
899 
900  _rapl_stop( ctx, ctl );
901 
902  /* Pass back a pointer to our results */
903  *events = ((_rapl_control_state_t*) ctl)->count;
904 
905  return PAPI_OK;
906 }
long long flags
Definition: iozone.c:12330
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
char events[MAX_EVENTS][BUFSIZ]
static int _rapl_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-rapl.c:854

Here is the call graph for this function:

static int _rapl_reset ( hwd_context_t ctx,
hwd_control_state_t ctl 
)
static

Definition at line 1003 of file linux-rapl.c.

1004 {
1005  ( void ) ctx;
1006  ( void ) ctl;
1007 
1008  return PAPI_OK;
1009 }
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
static int _rapl_set_domain ( hwd_control_state_t ctl,
int  domain 
)
static

Definition at line 989 of file linux-rapl.c.

990 {
991  ( void ) ctl;
992 
993  /* In theory we only support system-wide mode */
994  /* How to best handle that? */
995  if ( PAPI_DOM_ALL != domain )
996  return PAPI_EINVAL;
997 
998  return PAPI_OK;
999 }
#define PAPI_DOM_ALL
Definition: papi.h:303
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:436
static int _rapl_shutdown_component ( void  )
static

Definition at line 913 of file linux-rapl.c.

914 {
915  int i;
916 
918  if (fd_array) {
919  for(i=0;i<num_cpus;i++) {
920  if (fd_array[i].open) close(fd_array[i].fd);
921  }
923  }
924 
925  return PAPI_OK;
926 }
int close(int fd)
Definition: appio.c:175
#define papi_free(a)
Definition: papi_memory.h:35
int fd
Definition: iozone.c:1291
return PAPI_OK
Definition: linux-nvml.c:497
struct fd_array_t * fd_array
Definition: linux-rapl.c:137
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
int i
Definition: fileop.c:140
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
static int num_cpus
Definition: linux-rapl.c:138

Here is the call graph for this function:

static int _rapl_shutdown_thread ( hwd_context_t ctx)
static

Definition at line 888 of file linux-rapl.c.

889 {
890  ( void ) ctx;
891  return PAPI_OK;
892 }
return PAPI_OK
Definition: linux-nvml.c:497
void
Definition: iozone.c:18627
static int _rapl_start ( hwd_context_t ctx,
hwd_control_state_t ctl 
)
static

Definition at line 835 of file linux-rapl.c.

836 {
837  _rapl_context_t* context = (_rapl_context_t*) ctx;
839  long long now = PAPI_get_real_usec();
840  int i;
841 
842  for( i = 0; i < RAPL_MAX_COUNTERS; i++ ) {
843  if ((control->being_measured[i]) && (control->need_difference[i])) {
844  context->start_value[i]=read_rapl_value(i);
845  }
846  }
847 
848  control->lastupdate = now;
849 
850  return PAPI_OK;
851 }
return PAPI_OK
Definition: linux-nvml.c:497
#define RAPL_MAX_COUNTERS
Definition: linux-rapl.c:110
int i
Definition: fileop.c:140
static long long read_rapl_value(int index)
Definition: linux-rapl.c:197
long long PAPI_get_real_usec(void)
Definition: papi.c:6264
int being_measured[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:114
int need_difference[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:116
long long start_value[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:123

Here is the call graph for this function:

static int _rapl_stop ( hwd_context_t ctx,
hwd_control_state_t ctl 
)
static

Definition at line 854 of file linux-rapl.c.

855 {
856 
857  /* read values */
858  _rapl_context_t* context = (_rapl_context_t*) ctx;
860  long long now = PAPI_get_real_usec();
861  int i;
862  long long temp;
863 
864  for ( i = 0; i < RAPL_MAX_COUNTERS; i++ ) {
865  if (control->being_measured[i]) {
866  temp = read_rapl_value(i);
867  if (context->start_value[i])
868  if (control->need_difference[i]) {
869  /* test for wrap around */
870  if (temp < context->start_value[i] ) {
871  SUBDBG("Wraparound!\nstart:\t%#016x\ttemp:\t%#016x",
872  (unsigned)context->start_value[i], (unsigned)temp);
873  temp += (0x100000000 - context->start_value[i]);
874  SUBDBG("\tresult:\t%#016x\n", (unsigned)temp);
875  } else {
876  temp -= context->start_value[i];
877  }
878  }
879  control->count[i] = convert_rapl_energy( i, temp );
880  }
881  }
882  control->lastupdate = now;
883  return PAPI_OK;
884 }
static long long convert_rapl_energy(int index, long long value)
Definition: linux-rapl.c:206
return PAPI_OK
Definition: linux-nvml.c:497
#define RAPL_MAX_COUNTERS
Definition: linux-rapl.c:110
int i
Definition: fileop.c:140
static long long read_rapl_value(int index)
Definition: linux-rapl.c:197
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
long long PAPI_get_real_usec(void)
Definition: papi.c:6264
long long count[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:115
int being_measured[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:114
int temp
Definition: iozone.c:22158
int need_difference[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:116
long long start_value[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:123

Here is the call graph for this function:

Here is the caller graph for this function:

static int _rapl_update_control_state ( hwd_control_state_t ctl,
NativeInfo_t native,
int  count,
hwd_context_t ctx 
)
static

Definition at line 945 of file linux-rapl.c.

948 {
949  int i, index;
950  ( void ) ctx;
951 
953 
954  /* Ugh, what is this native[] stuff all about ?*/
955  /* Mostly remap stuff in papi_internal */
956 
957  for(i=0;i<RAPL_MAX_COUNTERS;i++) {
958  control->being_measured[i]=0;
959  }
960 
961  for( i = 0; i < count; i++ ) {
962  index=native[i].ni_event&PAPI_NATIVE_AND_MASK;
964  control->being_measured[index]=1;
965 
966  /* Only need to subtract if it's a PACKAGE_ENERGY or ENERGY_CNT type */
967  control->need_difference[index]=
972  }
973 
974  return PAPI_OK;
975 }
#define PLATFORM_ENERGY
Definition: linux-rapl.c:154
return PAPI_OK
Definition: linux-nvml.c:497
int count
Definition: iozone.c:22422
int type
Definition: linux-rapl.c:99
#define PACKAGE_ENERGY_CNT
Definition: linux-rapl.c:148
#define DRAM_ENERGY
Definition: linux-rapl.c:153
void
Definition: iozone.c:18627
#define RAPL_MAX_COUNTERS
Definition: linux-rapl.c:110
#define PACKAGE_ENERGY
Definition: linux-rapl.c:143
int i
Definition: fileop.c:140
unsigned int selector
Definition: linux-rapl.c:89
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
_rapl_register_t resources
Definition: linux-rapl.c:101
int being_measured[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:114
#define PAPI_NATIVE_AND_MASK
int need_difference[RAPL_MAX_COUNTERS]
Definition: linux-rapl.c:116
static long long convert_rapl_energy ( int  index,
long long  value 
)
static

Definition at line 206 of file linux-rapl.c.

206  {
207 
208  union {
209  long long ll;
210  double fp;
211  } return_val;
212 
213  return_val.ll = value; /* default case: return raw input value */
214 
215  if (rapl_native_events[index].type==PACKAGE_ENERGY) {
216  return_val.ll = (long long)(((double)value/cpu_energy_divisor)*1e9);
217  }
218 
219  if (rapl_native_events[index].type==DRAM_ENERGY) {
220  return_val.ll = (long long)(((double)value/dram_energy_divisor)*1e9);
221  }
222 
223  if (rapl_native_events[index].type==PLATFORM_ENERGY) {
224  return_val.ll = (long long)(((double)value/cpu_energy_divisor)*1e9);
225  }
226 
227  if (rapl_native_events[index].type==PACKAGE_THERMAL) {
228  return_val.fp = (double)
230  (double)power_divisor;
231  }
232 
233  if (rapl_native_events[index].type==PACKAGE_MINIMUM) {
234  return_val.fp = (double)
236  (double)power_divisor;
237  }
238 
239  if (rapl_native_events[index].type==PACKAGE_MAXIMUM) {
240  return_val.fp = (double)
242  (double)power_divisor;
243  }
244 
245  if (rapl_native_events[index].type==PACKAGE_TIME_WINDOW) {
246  return_val.fp = (double)
248  (double)time_divisor;
249  }
250 
251  if (rapl_native_events[index].type==PACKAGE_THERMAL_CNT) {
252  return_val.ll = ((value>>THERMAL_SHIFT)&POWER_INFO_UNIT_MASK);
253  }
254 
255  if (rapl_native_events[index].type==PACKAGE_MINIMUM_CNT) {
256  return_val.ll = ((value>>MINIMUM_POWER_SHIFT)&POWER_INFO_UNIT_MASK);
257  }
258 
259  if (rapl_native_events[index].type==PACKAGE_MAXIMUM_CNT) {
260  return_val.ll = ((value>>MAXIMUM_POWER_SHIFT)&POWER_INFO_UNIT_MASK);
261  }
262 
263  if (rapl_native_events[index].type==PACKAGE_TIME_WINDOW_CNT) {
265  }
266 
267  return return_val.ll;
268 }
#define PACKAGE_MAXIMUM
Definition: linux-rapl.c:146
#define POWER_INFO_UNIT_MASK
Definition: linux-rapl.c:80
#define PLATFORM_ENERGY
Definition: linux-rapl.c:154
#define PACKAGE_MAXIMUM_CNT
Definition: linux-rapl.c:151
#define PACKAGE_THERMAL
Definition: linux-rapl.c:144
#define DRAM_ENERGY
Definition: linux-rapl.c:153
int power_divisor
Definition: linux-rapl.c:140
#define PACKAGE_TIME_WINDOW_CNT
Definition: linux-rapl.c:152
static FILE * fp
void double value
Definition: iozone.c:18781
static double
Definition: fileop.c:1281
#define PACKAGE_ENERGY
Definition: linux-rapl.c:143
#define PACKAGE_MINIMUM_CNT
Definition: linux-rapl.c:150
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
#define PACKAGE_MINIMUM
Definition: linux-rapl.c:145
int cpu_energy_divisor
Definition: linux-rapl.c:141
long long
Definition: iozone.c:19827
#define PACKAGE_THERMAL_CNT
Definition: linux-rapl.c:149
int dram_energy_divisor
Definition: linux-rapl.c:141
#define MAXIMUM_TIME_WINDOW_SHIFT
Definition: linux-rapl.c:84
#define THERMAL_SHIFT
Definition: linux-rapl.c:81
int time_divisor
Definition: linux-rapl.c:140
#define MAXIMUM_POWER_SHIFT
Definition: linux-rapl.c:83
#define MINIMUM_POWER_SHIFT
Definition: linux-rapl.c:82
#define PACKAGE_TIME_WINDOW
Definition: linux-rapl.c:147

Here is the caller graph for this function:

static int get_kernel_nr_cpus ( void  )
static

Definition at line 271 of file linux-rapl.c.

272 {
273  FILE *fff;
274  int num_read, nr_cpus = 1;
275  fff=fopen("/sys/devices/system/cpu/kernel_max","r");
276  if (fff==NULL) return nr_cpus;
277  num_read=fscanf(fff,"%d",&nr_cpus);
278  fclose(fff);
279  if (num_read==1) {
280  nr_cpus++;
281  } else {
282  nr_cpus = 1;
283  }
284  return nr_cpus;
285 }
fclose(thread_wqfd)
FILE * fff[MAX_EVENTS]

Here is the call graph for this function:

Here is the caller graph for this function:

static int open_fd ( int  offset)
static

Definition at line 173 of file linux-rapl.c.

173  {
174 
175  int fd=-1;
176  char filename[BUFSIZ];
177 
178  if (fd_array[offset].open==0) {
179  sprintf(filename,"/dev/cpu/%d/msr_safe",offset);
180  fd = open(filename, O_RDONLY);
181  if (fd<0) {
182  sprintf(filename,"/dev/cpu/%d/msr",offset);
183  fd = open(filename, O_RDONLY);
184  }
185  if (fd>=0) {
186  fd_array[offset].fd=fd;
187  fd_array[offset].open=1;
188  }
189  }
190  else {
191  fd=fd_array[offset].fd;
192  }
193 
194  return fd;
195 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
off64_t offset
Definition: iozone.c:1279
int fd
Definition: iozone.c:1291
char filename[MAXNAMESIZE]
Definition: iozone.c:1360
struct fd_array_t * fd_array
Definition: linux-rapl.c:137
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184

Here is the call graph for this function:

Here is the caller graph for this function:

static long long read_msr ( int  fd,
int  which 
)
static

Definition at line 161 of file linux-rapl.c.

161  {
162 
163  uint64_t data;
164 
165  if ( fd<0 || pread(fd, &data, sizeof data, which) != sizeof data ) {
166  perror("rdmsr:pread");
167  exit(127);
168  }
169 
170  return (long long)data;
171 }
long which
Definition: iozone.c:19600
int fd
Definition: iozone.c:1291
void exit()

Here is the call graph for this function:

Here is the caller graph for this function:

static long long read_rapl_value ( int  index)
static

Definition at line 197 of file linux-rapl.c.

197  {
198 
199  int fd;
200 
201  fd=open_fd(rapl_native_events[index].fd_offset);
202  return read_msr(fd,rapl_native_events[index].msr);
203 
204 }
static long long read_msr(int fd, int which)
Definition: linux-rapl.c:161
int fd
Definition: iozone.c:1291
static _rapl_native_event_entry_t * rapl_native_events
Definition: linux-rapl.c:135
static int open_fd(int offset)
Definition: linux-rapl.c:173

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

papi_vector_t _rapl_vector

Definition at line 128 of file linux-rapl.c.

int cpu_energy_divisor

Definition at line 141 of file linux-rapl.c.

int dram_energy_divisor

Definition at line 141 of file linux-rapl.c.

struct fd_array_t* fd_array =NULL

Definition at line 137 of file linux-rapl.c.

int num_cpus =0
static

Definition at line 138 of file linux-rapl.c.

int num_events = 0
static

Definition at line 136 of file linux-rapl.c.

int num_packages =0
static

Definition at line 138 of file linux-rapl.c.

int power_divisor

Definition at line 140 of file linux-rapl.c.

_rapl_native_event_entry_t* rapl_native_events =NULL
static

Definition at line 135 of file linux-rapl.c.

int time_divisor

Definition at line 140 of file linux-rapl.c.