36 printf(
"handler(%d,%#lx,%llx) Overflow %d in thread %lx\n",
37 EventSet, (
unsigned long ) address, overflow_vector,
42 ( void ) overflow_vector;
55 int mask1, papi_event;
115 printf(
"Thread %#x %s : \t%lld\n", (
int ) pthread_self( ),
117 printf(
"Thread %#x PAPI_TOT_CYC: \t%lld\n", (
int ) pthread_self( ),
119 printf(
"Thread %#x Real usec : \t%lld\n", (
int ) pthread_self( ),
121 printf(
"Thread %#x Real cycles : \t%lld\n", (
int ) pthread_self( ),
155 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
172 pthread_attr_init( &attr );
173 #ifdef PTHREAD_CREATE_UNDETACHED 174 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
176 #ifdef PTHREAD_SCOPE_SYSTEM 177 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
184 rc = pthread_create( &
id[
i], &attr,
Thread, (
void * ) &flops[
i] );
189 pthread_join(
id[
i], NULL );
191 pthread_attr_destroy( &attr );
194 long long t = 0, r = 0;
200 printf(
"Expected total overflows: %lld\n", t );
201 printf(
"Received total overflows: %lld\n", r );
210 if (!
quiet) printf(
"Overflows thread %d: %d, expected %d\n",
221 pthread_exit( NULL );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
static int expected[NUM_THREADS]
int main(int argc, char **argv)
unsigned long int pthread_t
unsigned long PAPI_thread_id(void)
int PAPI_register_thread(void)
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
static int total[NUM_THREADS]
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
static void handler(int EventSet, void *address, long long overflow_vector, void *context)
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
void free_test_space(long long **values, int num_tests)
static pthread_t myid[NUM_THREADS]
int PAPI_event_code_to_name(int EventCode, char *out)
long long PAPI_get_real_usec(void)
int PAPI_unregister_thread(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
static void * Thread(void *arg)
static const PAPI_hw_info_t * hw_info
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
long long PAPI_get_real_cyc(void)
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]
long long ** allocate_test_space(int num_tests, int num_events)
int remove_test_events(int *EventSet, int mask)