20 test_fail( __FILE__, __LINE__,
"PAPI_thread_init", ret );
24 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", ret );
27 test_fail( __FILE__, __LINE__,
"PAPI_destroy_eventset", ret );
30 test_fail( __FILE__, __LINE__,
"PAPI_unregister_thread", ret );
36main(
int argc,
char *argv[] )
49 test_fail( __FILE__, __LINE__,
"PAPI_library_init", ret );
53 long ( * )(
void ) ) ( pthread_self ) ) ) !=
55 test_fail( __FILE__, __LINE__,
"PAPI_thread_init", ret );
57 pthread_attr_init( &attr );
58#ifdef PTHREAD_CREATE_UNDETACHED
59 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
61#ifdef PTHREAD_SCOPE_SYSTEM
62 ret=pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
64 test_skip( __FILE__, __LINE__,
"pthread_attr_setscope", ret );
69 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 0 );
74 printf(
"Creating %ld threads for %d iterations each of:\n", nthr,
76 printf(
"\tregister\n" );
77 printf(
"\tcreate_eventset\n" );
78 printf(
"\tdestroy_eventset\n" );
79 printf(
"\tunregister\n" );
86 for ( j = 0; j < nthr; j++ ) {
87 ret = pthread_create( &th[j], &attr, &
Thread, NULL );
94 for ( j = 0; j < nthr; j++ ) {
95 pthread_join( th[j], NULL );
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
get information about the system hardware
initialize the PAPI library.
Notify PAPI that a thread has 'appeared'.
Initialize thread support in the PAPI library.
Notify PAPI that a thread has 'disappeared'.
Return codes and api definitions.
unsigned long int pthread_t
int tests_quiet(int argc, char **argv)
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)
void * Thread(void *data)