74 {
75
77 unsigned long blength;
78 int num_buckets,j=0;
79
82
84 char header[BUFSIZ];
85
86 strncpy(header,"address\t\t",BUFSIZ);
87
88
89
93
95 strncat(header,"\tcyc",BUFSIZ-1);
96 }
98 strncat(header,"\tins",BUFSIZ-1);
99 }
101 strncat(header,"\tfp_ins",BUFSIZ-1);
102 }
104 strncat(header,"\tfp_ops",BUFSIZ-1);
105 }
107 strncat(header,"\tl2_tcm",BUFSIZ-1);
108 }
109
110 j++;
111
112 }
113 }
114
115 strncat(header,"\n",BUFSIZ-1);
116
117
118
119 blength =
prof_size( plength, scale, bucket, &num_buckets );
121
122 if ( !
TESTS_QUIET ) printf(
"Overall event counts:\n" );
123
130 test_warn( __FILE__, __LINE__,
"Trying to profile with derived event", 1);
132 break;
133 }
134 else {
135 printf(
"Failed with event %d %#x\n",
i,
events[
i]);
137 }
138 }
139 }
140
143
145
148
150 printf(
TAB1,
"PAPI_TOT_CYC:", (
values[0] )[--event] );
152 printf(
TAB1,
"PAPI_TOT_INS:", (
values[0] )[--event] );
153 }
154#if defined(__powerpc__)
155 printf(
TAB1,
"PAPI_FP_INS", (
values[0] )[--event] );
156#else
158 printf(
TAB1,
"PAPI_FP_OPS:", (
values[0] )[--event] );
159 printf(
TAB1,
"PAPI_L2_TCM:", (
values[0] )[--event] );
160 }
161#endif
162 }
163
170 }
171
173 prof_head( blength, bucket, num_buckets, header );
175 }
177 for (
i = 0;
i < num_bufs;
i++ ) {
179 }
181}
static const PAPI_hw_info_t * hw_info
static void my_main(void)
Generate a histogram of hardware counter overflows vs. PC addresses.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_PROFIL_POSIX
char events[MAX_EVENTS][BUFSIZ]
static long long values[NUM_EVENTS]
static struct timeval start
struct test_events_t test_events[]
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void test_warn(const char *file, int line, const char *call, int retval)
int prof_check(int n, int bucket, int num_buckets)
void prof_head(unsigned long blength, int bucket, int num_buckets, const char *header)
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
void prof_alloc(int num, unsigned long blength)
void prof_out(vptr_t start, int n, int bucket, int num_buckets, unsigned int scale)
char model_string[PAPI_MAX_STR_LEN]