30#define OVER_FMT "handler(%d ) Overflow at %p! bit=%#llx \n"
31#define OUT_FMT "%-12s : %16lld%16lld\n"
49main(
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 ) );
117 char *
tmp = getenv(
"THRESHOLD" );
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]);
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",
274 "Overflow value differs from expected %lld / %d should be %lld, we got %d",
const char * names[NUM_EVENTS]
static const PAPI_hw_info_t * hw_info
Empty and destroy an EventSet.
Empty and destroy an EventSet.
Convert a numeric hardware event code to a name.
returns the component index for the named component
get information about the system hardware
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.
static long long mythreshold
char events[MAX_EVENTS][BUFSIZ]
static long long values[NUM_EVENTS]
void handler(int EventSet, void *address, long long overflow_vector, void *context)
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
int enum_add_native_events(int *num_events, int **evtcodes, int need_interrupts, int no_software_events, int cidx)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void test_warn(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
char error_string[PAPI_MAX_STR_LEN]