12long long int expectation[10] = {20674LL, 50122LL, 112964LL, 32904LL, 101565LL, 56993LL, 58388LL, 122543LL, 62312LL, 52433LL};
14int main(
int argc,
char **argv){
16 int discrepancies = 0;
18 long long counter_values[2];
20 if( (argc > 1) && !strcmp(argv[1],
"-verbose") )
29 test_fail( __FILE__, __LINE__,
"PAPI_start", ret );
38 test_fail( __FILE__, __LINE__,
"PAPI_read", ret );
41 long long *ptr = (
long long *)counter_values[1];
44 printf(
"The number of recordings is: %lld (ptr is: %p)\n",counter_values[0],(
void *)counter_values[1]);
45 for(j=0; j<counter_values[0]; j++){
46 printf(
"%lld ",*(ptr+j));
56 test_fail( __FILE__, __LINE__,
"PAPI_stop", ret );
59 if( counter_values[0] != 10 ){
62 long long *ptr = (
long long *)counter_values[1];
73 test_fail( __FILE__, __LINE__,
"SDE values in recorder are wrong!", 0 );
85 test_fail( __FILE__, __LINE__,
"PAPI_library_init", ret );
89 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", ret );
93 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
97 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
void setup_PAPI(int *event_set)
void recorder_init_(void)
long long int expectation[10]
void recorder_do_work_(void)
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
Read hardware counters from an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Return codes and api definitions.
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)