30 #define OVER_FMT "handler(%d ) Overflow at %p! bit=%#llx \n" 31 #define OUT_FMT "%-12s : %16lld%16lld\n" 49 main(
int argc,
char **argv )
59 int using_perfmon = 0;
79 if (cid>=0) using_perfmon = 1;
82 if (cid>=0) using_aix = 1;
91 if (!
quiet) printf(
"No events found\n");
92 test_skip(__FILE__,__LINE__,
"No events found",0);
112 sizeof (
long long ) );
113 ovt = (
int * ) calloc( (
unsigned int )
num_events,
sizeof ( int ) );
138 if (!
quiet) printf(
"Testing that the events all work with no overflow\n");
158 if (!
quiet) printf(
"Testing with overflow set on %s\n",
190 printf(
"\nResults in Matrix-view:\n");
191 printf(
"Test Overflow on %d counters with %d events.\n",
193 printf(
"-----------------------------------------------\n" );
194 printf(
"Threshold for overflow is: %d\n",
mythreshold );
195 printf(
"Using %d iterations of c += a*b\n", num_flops );
196 printf(
"-----------------------------------------------\n" );
198 printf(
"Test type : " );
204 printf(
"%-27s : ",
names[j] );
210 printf(
"Overflows : %16s",
"" );
212 printf(
"%16d", ovt[
i] );
215 printf(
"-----------------------------------------------\n" );
221 printf(
"\nResults broken out for validation\n");
228 printf(
"Test results, no overflow:\n\t");
231 printf(
"Overflow of event %d, %s\n\t",j-1,
names[j-1]);
243 printf(
"\tOverflow should be %lld / %d = %lld\n",
247 printf(
"\tOverflow was %d\n",ovt[j-1]);
262 char error_string[BUFSIZ];
266 "perfmon component handles overflow differently than perf_events",
268 else if ( using_aix )
270 "AIX (pmapi) component handles overflow differently than various other components",
273 sprintf( error_string,
274 "Overflow value differs from expected %lld / %d should be %lld, we got %d",
278 test_fail( __FILE__, __LINE__, error_string, 1 );
int main(int argc, char **argv)
int PAPI_stop(int EventSet, long long *values)
void handler(int EventSet, void *address, long long overflow_vector, void *context)
void test_pass(const char *filename)
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
void test_warn(const char *file, int line, const char *call, int retval)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
char events[MAX_EVENTS][BUFSIZ]
int PAPI_library_init(int version)
int PAPI_get_component_index(const char *name)
int PAPI_cleanup_eventset(int EventSet)
int PAPI_event_code_to_name(int EventCode, char *out)
int enum_add_native_events(int *num_events, int **evtcodes, int need_interrupts, int no_software_events, int cidx)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_destroy_eventset(int *EventSet)
static long long mythreshold
int PAPI_start(int EventSet)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static long long values[NUM_EVENTS]
static const PAPI_hw_info_t * hw_info
const char * names[NUM_EVENTS]