17#define OVER_FMT "handler(%d) Overflow at %p! vector=%#llx\n"
18#define OUT_FMT "%-12s : %16lld%16lld\n"
19#define INDEX_FMT "Overflows vector %#llx: \n"
45 for (
i = 0;
i < 3;
i++ ) {
54 for (
i = 0;
i < 3;
i++ ) {
68main(
int argc,
char **argv )
75 int index_array[2], number;
93 if (!
quiet) printf(
"Trouble adding events\n");
94 test_skip(__FILE__,__LINE__,
"Adding events",0);
130 printf(
"Test case: Overflow dispatch of 2nd event in set with 2 events.\n" );
131 printf(
"---------------------------------------------------------------\n" );
132 printf(
"Threshold for overflow is: %d\n",
THRESHOLD );
133 printf(
"Using %d iterations of c += a*b\n",
NUM_FLOPS );
134 printf(
"-----------------------------------------------\n" );
136 printf(
"Test type : %16d%16d\n", 1, 2 );
143 "one counter had no overflows", 1 );
146 for ( k = 0; k < 3; k++ ) {
151 index_array, &number );
154 "PAPI_get_overflow_event_index",
retval );
159 for (
i = 0;
i < number;
i++ )
160 printf(
" Event Index %d ", index_array[
i] );
167 printf(
"Case 2 %s Overflows: %d\n",
"Unknown",
total_unknown );
168 printf(
"-----------------------------------------------\n" );
172 test_fail( __FILE__, __LINE__,
"Unknown counter had overflows", 1 );
Empty and destroy an EventSet.
Convert a numeric hardware event code to a name.
converts an overflow vector into an array of indexes to overflowing events
initialize the PAPI library.
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.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
static void handler(int EventSet, void *address, long long overflow_vector, void *context)
static ocount_t overflow_counts[3]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
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)