21{
29
33 }
34
35 profbuf = (
unsigned short * ) malloc(
length *
sizeof (
unsigned short ) );
37 test_fail(__FILE__, __LINE__,
"Allocate memory",0);
38 }
39
41
42
43
44
46
48
52 }
53
55
57
62 }
63
67 }
68
70
74 }
75
77
79
80
85 }
86
88
91 printf( "Thread %#x PAPI_TOT_INS : \t%lld\n",
92 (
int ) pthread_self( ), (
values[0] )[0] );
93 } else {
94 printf( "Thread %#x PAPI_FP_INS : \t%lld\n",
95 (
int ) pthread_self( ), (
values[0] )[0] );
96 }
97 printf( "Thread %#x PAPI_TOT_CYC: \t%lld\n", ( int ) pthread_self( ),
99 printf( "Thread %#x Real usec : \t%lld\n", ( int ) pthread_self( ),
101 printf( "Thread %#x Real cycles : \t%lld\n", ( int ) pthread_self( ),
103
104 printf( "Test case: PAPI_profil() for pthreads\n" );
105 printf( "----Profile buffer for Thread %#x---\n",
106 ( int ) pthread_self( ) );
109 printf(
"%#lx\t%d\n", (
unsigned long ) (
my_start + 2 *
i ),
111 }
112 }
115 break;
116
118 test_fail( __FILE__, __LINE__,
"No information in buffers", 1 );
119 }
121
125 }
126
127 return NULL;
128}
Convert a numeric hardware event code to a name.
Generate a histogram of hardware counter overflows vs. PC addresses.
Notify PAPI that a thread has 'appeared'.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Notify PAPI that a thread has 'disappeared'.
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_PROFIL_POSIX
static long long values[NUM_EVENTS]
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
void free_test_space(long long **values, int num_tests)
long long ** allocate_test_space(int num_tests, int num_events)
int remove_test_events(int *EventSet, int mask)