35 profbuf = (
unsigned short * ) malloc(
length *
sizeof (
unsigned short ) );
37 test_fail(__FILE__, __LINE__,
"Allocate memory",0);
91 printf(
"Thread %#x PAPI_TOT_INS : \t%lld\n",
92 (
int ) pthread_self( ), (
values[0] )[0] );
94 printf(
"Thread %#x PAPI_FP_INS : \t%lld\n",
95 (
int ) pthread_self( ), (
values[0] )[0] );
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( ),
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 ),
118 test_fail( __FILE__, __LINE__,
"No information in buffers", 1 );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
int PAPI_register_thread(void)
#define PAPI_PROFIL_POSIX
int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
void free_test_space(long long **values, int num_tests)
int PAPI_event_code_to_name(int EventCode, char *out)
long long PAPI_get_real_usec(void)
int PAPI_unregister_thread(void)
void test_fail(const char *file, int line, const char *call, int retval)
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
long long PAPI_get_real_cyc(void)
int PAPI_start(int EventSet)
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)