77 unsigned long blength;
86 strncpy(header,
"address\t\t",BUFSIZ);
95 strncat(header,
"\tcyc",BUFSIZ-1);
98 strncat(header,
"\tins",BUFSIZ-1);
101 strncat(header,
"\tfp_ins",BUFSIZ-1);
104 strncat(header,
"\tfp_ops",BUFSIZ-1);
107 strncat(header,
"\tl2_tcm",BUFSIZ-1);
115 strncat(header,
"\n",BUFSIZ-1);
119 blength =
prof_size( plength, scale, bucket, &num_buckets );
122 if ( !
TESTS_QUIET ) printf(
"Overall event counts:\n" );
130 test_warn( __FILE__, __LINE__,
"Trying to profile with derived event", 1);
135 printf(
"Failed with event %d %#x\n",
i,
events[
i]);
150 printf(
TAB1,
"PAPI_TOT_CYC:", (
values[0] )[--event] );
152 printf(
TAB1,
"PAPI_TOT_INS:", (
values[0] )[--event] );
154 #if defined(__powerpc__) 155 printf(
TAB1,
"PAPI_FP_INS", (
values[0] )[--event] );
158 printf(
TAB1,
"PAPI_FP_OPS:", (
values[0] )[--event] );
159 printf(
TAB1,
"PAPI_L2_TCM:", (
values[0] )[--event] );
173 prof_head( blength, bucket, num_buckets, header );
177 for (
i = 0;
i < num_bufs;
i++ ) {
int PAPI_stop(int EventSet, long long *values)
static void my_main(void)
#define PAPI_PROFIL_POSIX
static struct timeval start
void test_warn(const char *file, int line, const char *call, int retval)
char events[MAX_EVENTS][BUFSIZ]
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale)
char model_string[PAPI_MAX_STR_LEN]
void prof_head(unsigned long blength, int bucket, int num_buckets, const char *header)
struct test_events_t test_events[]
void test_fail(const char *file, int line, const char *call, int retval)
int prof_check(int n, int bucket, int num_buckets)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]
static const PAPI_hw_info_t * hw_info
void prof_alloc(int num, unsigned long blength)