17 {
18
22 char *uncore_event=NULL;
24 int uncore_cidx=-1;
26
27
29
31 printf("Testing creating an uncore event using PAPI_set_opt() to specify CPU\n");
32 }
33
34
38 }
39
40
42 if (uncore_cidx<0) {
44 printf("perf_event_uncore component not found\n");
45 }
46 test_skip(__FILE__,__LINE__,
"perf_event_uncore component not found",0);
47 }
48
49
53 printf("perf_event_uncore component is disabled\n");
54 }
55 test_skip(__FILE__,__LINE__,
"uncore component disabled",0);
56 }
57
58
60 if (uncore_event==NULL) {
62 printf("uncore event name not available\n");
63 }
65 "PAPI does not support uncore on this processor",
67 }
68
69
73 }
74
75
77
78
79
81
84
88 printf("Could not cpu attach\n");
89 }
91 "this test; trying to PAPI_CPU_ATTACH; need to run as root",
93 }
94
95
96
98
102
106 "this test; trying to set PAPI_GRN_SYS",
108 }
109
110
111
113
117
121 printf("could not set PAPI_DOM_ALL\n");
122 }
124 "this test; trying to set PAPI_DOM_ALL; need to run as root",
126 }
127
128
132 printf("Error trying to use event %s\n", uncore_event);
133 }
135 }
136
137
141 }
142
143
145
146
150 }
151
153 printf("\tUsing event %s\n",uncore_event);
154 printf(
"\t%s: %lld\n",uncore_event,
values[0]);
155 }
156
158
159 return 0;
160}
add PAPI preset or native hardware event by name to an EventSet
Assign a component index to an existing but empty EventSet.
Create a new empty PAPI EventSet.
returns the component index for the named component
get information about a specific software component
initialize the PAPI library.
Set PAPI library or event set options.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
char * get_uncore_event(char *event, int size)
A pointer to the following is passed to PAPI_set/get_opt()