PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
perf_event_uncore_lib.c File Reference
Include dependency graph for perf_event_uncore_lib.c:

Go to the source code of this file.

Functions

char * get_uncore_event (char *event, int size)
 

Function Documentation

char* get_uncore_event ( char *  event,
int  size 
)

Definition at line 7 of file perf_event_uncore_lib.c.

7  {
8 
9  const PAPI_hw_info_t *hwinfo;
10 
11  hwinfo = PAPI_get_hardware_info();
12  if ( hwinfo == NULL ) {
13  return NULL;
14  }
15 
16  if (hwinfo->vendor == PAPI_VENDOR_INTEL) {
17 
18  if ( hwinfo->cpuid_family == 6) {
19  switch(hwinfo->cpuid_model) {
20  case 26:
21  case 30:
22  case 31: /* Nehalem */
23  case 46: /* Nehalem EX */
24  strncpy(event,"nhm_unc::UNC_CLK_UNHALTED",size);
25  return event;
26  break;
27  case 37:
28  case 44: /* Westmere */
29  case 47: /* Westmere EX */
30  strncpy(event,"wsm_unc::UNC_CLK_UNHALTED",size);
31  return event;
32  break;
33 
34  case 62: /* Ivy Trail */
35  case 45: /* SandyBridge EP */
36  strncpy(event,"snbep_unc_imc0::UNC_M_CLOCKTICKS",size);
37  return event;
38  break;
39  case 42: /* SandyBridge */
40  strncpy(event,"snb_unc_cbo0::UNC_CLOCKTICKS",size);
41  return event;
42  break;
43  case 58: /* IvyBridge */
44  strncpy(event,"ivb_unc_cbo0::UNC_CLOCKTICKS",size);
45  return event;
46  break;
47  }
48  }
49  return NULL;
50  }
51  else if (hwinfo->vendor == PAPI_VENDOR_AMD) {
52  if ( hwinfo->cpuid_family == 21) {
53  /* For kernel 3.9 at least */
54  strncpy(event,"DRAM_ACCESSES:ALL",size);
55  return event;
56  }
57  return NULL;
58  }
59 
60  return NULL;
61 }
Hardware info structure.
Definition: papi.h:775
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
char *long long size
Definition: iozone.c:12023
int cpuid_model
Definition: papi.h:788
int cpuid_family
Definition: papi.h:787
#define PAPI_VENDOR_INTEL
Definition: papi.h:346
int vendor
Definition: papi.h:782
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6046
#define PAPI_VENDOR_AMD
Definition: papi.h:347

Here is the call graph for this function:

Here is the caller graph for this function: