68{
70 long long values0[2],values1[2],values2[2];
71 int num_flops = 30000000,
retval;
75 int cid,numcmp,rapl_cid;
78
79
81
82
86 }
87
89
90 for(cid=0; cid<numcmp; cid++) {
91
93 test_fail(__FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0);
94 }
95
96 if (strstr(cmpinfo->
name,
"rapl")) {
97 rapl_cid=cid;
98 if (!
TESTS_QUIET) printf(
"Found rapl component at cid %d\n",
99 rapl_cid);
101 test_skip(__FILE__,__LINE__,
"No rapl events found",0);
102 }
103 break;
104 }
105 }
106
107
108 if (cid==numcmp) {
109 test_skip(__FILE__,__LINE__,
"No rapl component found\n",0);
110 }
111
112
113
117 }
118
122 }
123
127 }
128
129
133 }
134
135
136
137 char raplEventBase[]="rapl:::PACKAGE_ENERGY_CNT:PACKAGE";
139 do {
140 char buffer[80];
141 sprintf(buffer,
"%s%d", raplEventBase,
i);
144
145
146 }
while ( 0 <
retval &&
i < 64 );
147
149
150
151
154 printf("Using %#x for the overflow event on PAPI_TOT_CYC, threshold %d\n",
156 }
157
158
162 }
163
166
167
171 }
172
173
175 printf("%15s %15s %18s %15s Elapsed\n", "PAPI_TOT_CYC", "PAPI_TOT_INS",
176 "PACKAGE_ENERGY_CNT", "--UNUSED--");
177 }
178
179
183 }
184
185
190 }
194 }
195
198
199
203 }
204
208 }
209
213 }
214
218 }
219
221 printf("%s: %lld(Calibration) %lld(OverflowRun)\n",event_name1,values0[0],values1[0]);
222 }
223
227 }
228
230 printf("%s: %lld(Calibration) %lld(OverflowRun)\n",event_name1,values0[1],values1[1]);
231 }
232
236 }
237
241 }
242
244 test_fail(__FILE__, __LINE__,
"RAPL counts went backward!",0);
245 }
246
248
249 return 0;
250}
add PAPI preset or native hardware event to an event set
add PAPI preset or native hardware event by name to an EventSet
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Convert a numeric hardware event code to a name.
get information about a specific software component
initialize the PAPI library.
Get the number of components available on the system.
Set up an event set to begin registering overflows.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long mythreshold
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)
void do_ints(int n, int quiet)
void handler(int EventSet, void *address, long long overflow_vector, void *context)
char name[PAPI_MAX_STR_LEN]