19#define TOTAL_EVENTS 10
52 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
64 "PAPI_set_domain",
retval );
70 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
84 for (
i = 0; in_events[
i] != 0;
i++ ) {
89 out_events[real_len++] = in_events[
i];
91 if ( real_len == *len )
96 printf(
"%s does not exist\n", out );
100 if (!
TESTS_QUIET) printf(
"No counters available\n");
101 test_skip(__FILE__, __LINE__,
"No counters available", 0 );
113 pthread_attr_init( &attr );
114#ifdef PTHREAD_CREATE_UNDETACHED
115 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
117#ifdef PTHREAD_SCOPE_SYSTEM
118 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
124 rc = pthread_create( &
id[
i], &attr, fn, NULL );
129 pthread_join(
id[
i], NULL );
131 pthread_attr_destroy( &attr );
161 printf(
"Added %s\n", out );
175 printf(
"case1 thread %4x:", (
unsigned ) pthread_self( ) );
177 printf(
"case1 thread %4x:", (
unsigned ) pthread_self( ) );
215 test_fail(__FILE__, __LINE__,
"PAPI_assign_eventset_component",
retval );
220 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
226 printf(
"++case2 thread %4x:", (
unsigned ) pthread_self( ) );
237 printf(
"Added %s\n", out );
251 printf(
"case2 thread %4x:", (
unsigned ) pthread_self( ) );
253 printf(
"case2 thread %4x:", (
unsigned ) pthread_self( ) );
298 printf(
"Added %s\n", out );
303 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
320 printf(
"case3 thread %4x:", (
unsigned ) pthread_self( ) );
322 printf(
"case3 thread %4x:", (
unsigned ) pthread_self( ) );
365 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
388 printf(
"case4 thread %4x:", (
unsigned ) pthread_self( ) );
390 printf(
"case4 thread %4x:", (
unsigned ) pthread_self( ) );
476 printf(
"%s: Using %d threads\n\n", argv[0],
NUM_THREADS );
481 printf (
"case1: Does PAPI_multiplex_init() "
482 "not break regular operation?\n" );
491 printf(
"case2: Does setmpx/add work?\n" );
499 printf(
"case3: Does add/setmpx work?\n" );
507 printf(
"case4: Does add/setmpx/add work?\n" );
static const PAPI_hw_info_t * hw_info
add PAPI preset or native hardware event to an event set
Assign a component index to an existing but empty EventSet.
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Convert a numeric hardware event code to a name.
get information about the system hardware
initialize the PAPI library.
Initialize multiplex support in the PAPI library.
Query if PAPI event exists.
Notify PAPI that a thread has 'appeared'.
Set the default counting domain for new event sets bound to the cpu component.
Convert a standard event set to a multiplexed event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Initialize thread support in the PAPI library.
Notify PAPI that a thread has 'disappeared'.
static long long values[NUM_EVENTS]
static int preset_PAPI_events[TOTAL_EVENTS]
static void * case1_pthreads(void *arg)
static int power6_preset_PAPI_events[TOTAL_EVENTS]
static int solaris_preset_PAPI_events[TOTAL_EVENTS]
static int PAPI_events_len
static int PAPI_events[TOTAL_EVENTS]
static void init_papi_pthreads(int *out_events, int *len)
static void * case3_pthreads(void *arg)
static void * case4_pthreads(void *arg)
static int do_pthreads(void *(*fn)(void *))
static void * case2_pthreads(void *arg)
Return codes and api definitions.
unsigned long int pthread_t
int tests_quiet(int argc, char **argv)
void test_print_event_header(const char *call, int evset)
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)
char model_string[PAPI_MAX_STR_LEN]