68{
70 long long hard_min, hard_max, soft_min, soft_max;
78
80
84
85
89 if ( info.
count == 1 ||
90 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
92 }
93 }
97 if ( info.
count == 1 ||
98 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
100 }
101 }
105 if ( info.
count == 1 ||
106 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
108 }
109 }
110
112 test_skip( __FILE__, __LINE__,
"No suitable event for this test found!",
113 0 );
114
117 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
118
121 else
122#if defined(linux)
124#else
126#endif
127
131
135
139 "Platform does not support Hardware overflow", 0 );
140
142
143
144
148
150
155
156
157
161
165
167
172
176
177
178
184
188
190
195
201
202
203
204 memset( &itimer, 0, sizeof ( itimer ) );
207
210
216
220
222
227
233
234
235
236 memset( &itimer, 0, sizeof ( itimer ) );
241
247
251
253
258
264
269
270 printf
271 ( "Test case: Software overflow of various types with 1 event in set.\n" );
272 printf
273 ( "------------------------------------------------------------------------------\n" );
274 printf(
"Threshold for overflow is: %d\n",
mythreshold );
275 printf
276 ( "------------------------------------------------------------------------------\n" );
277
278 printf( "Test type : %11s%13s%13s%13s%13s\n", "Reference", "Hardware",
279 "ITIMER_PROF", "ITIMER_VIRT", "ITIMER_REAL" );
280 printf(
"%-12s: %11lld%13lld%13lld%13lld%13lld\n", info.
symbol,
282 printf(
"Overflows : %11d%13d%13d%13d%13d\n",
total[0],
total[1],
284 printf
285 ( "------------------------------------------------------------------------------\n" );
286
287 printf( "Verification:\n" );
288
289 printf
290 ( "Overflow in Column 2 greater than or equal to overflows in Columns 3, 4, 5\n" );
291 printf( "Overflow in Columns 3, 4, 5 greater than 0\n" );
292 }
293
294 hard_min =
297 hard_max =
300 soft_min =
303 soft_max =
306
307 if (
total[1] > hard_max ||
total[1] < hard_min )
308 test_fail( __FILE__, __LINE__,
"Hardware Overflows outside limits", 1 );
309
310 if (
total[2] > soft_max ||
total[3] > soft_max ||
total[4] > soft_max )
312 "Software Overflows exceed theoretical maximum", 1 );
313
314 if (
total[2] < soft_min ||
total[3] < soft_min ||
total[4] < soft_min )
315 printf( "WARNING: Software Overflow occurring but suspiciously low\n" );
316
318 test_fail( __FILE__, __LINE__,
"Software Overflows", 1 );
319
321
322 return 0;
323
324}
static const PAPI_hw_info_t * hw_info
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Convert a numeric hardware event code to a name.
Get the event's name and description info.
get information about the system hardware
Get PAPI library or event set options.
initialize the PAPI library.
Set up an event set to begin registering overflows.
Query if PAPI event exists.
Set PAPI library or event set options.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long mythreshold
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_OVERFLOW_FORCE_SW
#define PAPI_COMPONENTINFO
static long long values[MY_NUM_TESTS]
void handler(int EventSet, void *address, long long overflow_vector, void *context)
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 symbol[PAPI_HUGE_STR_LEN]
char derived[PAPI_MIN_STR_LEN]
A pointer to the following is passed to PAPI_set/get_opt()
PAPI_itimer_option_t itimer