70 long long hard_min, hard_max, soft_min, soft_max;
89 if ( info.
count == 1 ||
90 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
97 if ( info.
count == 1 ||
98 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
105 if ( info.
count == 1 ||
106 !strcmp( info.
derived,
"DERIVED_CMPD" ) )
112 test_skip( __FILE__, __LINE__,
"No suitable event for this test found!",
117 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
139 "Platform does not support Hardware overflow", 0 );
204 memset( &itimer, 0,
sizeof ( itimer ) );
236 memset( &itimer, 0,
sizeof ( itimer ) );
271 (
"Test case: Software overflow of various types with 1 event in set.\n" );
273 (
"------------------------------------------------------------------------------\n" );
274 printf(
"Threshold for overflow is: %d\n",
mythreshold );
276 (
"------------------------------------------------------------------------------\n" );
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],
285 (
"------------------------------------------------------------------------------\n" );
287 printf(
"Verification:\n" );
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" );
307 if (
total[1] > hard_max ||
total[1] < hard_min )
308 test_fail( __FILE__, __LINE__,
"Hardware Overflows outside limits", 1 );
310 if (
total[2] > soft_max ||
total[3] > soft_max ||
total[4] > soft_max )
312 "Software Overflows exceed theoretical maximum", 1 );
314 if (
total[2] < soft_min ||
total[3] < soft_min ||
total[4] < soft_min )
315 printf(
"WARNING: Software Overflow occurring but suspiciously low\n" );
318 test_fail( __FILE__, __LINE__,
"Software Overflows", 1 );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
#define PAPI_COMPONENTINFO
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
static int total[MY_NUM_TESTS]
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
A pointer to the following is passed to PAPI_set/get_opt()
char derived[PAPI_MIN_STR_LEN]
int PAPI_set_opt(int option, PAPI_option_t *ptr)
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_library_init(int version)
Create a new empty PAPI EventSet.
int PAPI_get_opt(int option, PAPI_option_t *ptr)
char symbol[PAPI_HUGE_STR_LEN]
void handler(int EventSet, void *address, long long overflow_vector, void *context)
int PAPI_event_code_to_name(int EventCode, char *out)
int PAPI_query_event(int EventCode)
static long long values[MY_NUM_TESTS]
#define PAPI_OVERFLOW_FORCE_SW
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
static long long mythreshold
int PAPI_start(int EventSet)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static const PAPI_hw_info_t * hw_info
PAPI_itimer_option_t itimer