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

Go to the source code of this file.

Functions

char * get_offcore_event (char *event, int size)
 
char * get_instructions_event (char *event, int size)
 

Function Documentation

char* get_instructions_event ( char *  event,
int  size 
)

Definition at line 64 of file event_name_lib.c.

64  {
65 
66  const PAPI_hw_info_t *hwinfo;
67 
68  hwinfo = PAPI_get_hardware_info();
69  if ( hwinfo == NULL ) {
70  return NULL;
71  }
72 
73  if (hwinfo->vendor == PAPI_VENDOR_INTEL) {
74 
75  if ( hwinfo->cpuid_family == 6) {
76  strncpy(event,"INSTRUCTIONS_RETIRED",size);
77  return event;
78  }
79 
80  if ( hwinfo->cpuid_family == 15) {
81  strncpy(event,"INSTR_RETIRED:NBOGUSNTAG",size);
82  return event;
83  }
84 
85 
86  return NULL;
87  }
88  else if (hwinfo->vendor == PAPI_VENDOR_AMD) {
89  strncpy(event,"RETIRED_INSTRUCTIONS",size);
90  return event;
91  }
92 
93  return NULL;
94 }
Hardware info structure.
Definition: papi.h:777
char *long long size
Definition: iozone.c:12023
int cpuid_family
Definition: papi.h:789
#define PAPI_VENDOR_INTEL
Definition: papi.h:346
int vendor
Definition: papi.h:784
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6176
#define PAPI_VENDOR_AMD
Definition: papi.h:347

Here is the call graph for this function:

Here is the caller graph for this function:

char* get_offcore_event ( char *  event,
int  size 
)

Definition at line 7 of file event_name_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,"OFFCORE_RESPONSE_0:DMND_DATA_RD:LOCAL_DRAM",size);
25  return event;
26  break;
27  case 37:
28  case 44: /* Westmere */
29  case 47: /* Westmere EX */
30  strncpy(event,"OFFCORE_RESPONSE_0:DMND_DATA_RD:LOCAL_DRAM",size);
31  return event;
32  break;
33 
34  case 45: /* SandyBridge EP */
35  case 42: /* SandyBridge */
36  strncpy(event,"OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE",size);
37  return event;
38  break;
39 
40  case 58: /* IvyBridge */
41  case 62: /* Ivy Trail */
42  strncpy(event,"OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE",size);
43  return event;
44  break;
45 
46  case 60: /* Haswell */
47  case 69:
48  case 70:
49  strncpy(event,"OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE",size);
50  return event;
51  break;
52 
53  }
54  }
55  return NULL;
56  }
57  else if (hwinfo->vendor == PAPI_VENDOR_AMD) {
58  return NULL;
59  }
60 
61  return NULL;
62 }
Hardware info structure.
Definition: papi.h:777
char *long long size
Definition: iozone.c:12023
int cpuid_model
Definition: papi.h:790
int cpuid_family
Definition: papi.h:789
#define PAPI_VENDOR_INTEL
Definition: papi.h:346
int vendor
Definition: papi.h:784
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6176
#define PAPI_VENDOR_AMD
Definition: papi.h:347

Here is the call graph for this function:

Here is the caller graph for this function: