71 printf(
"%s\n", title );
73 (
"----------------------------------------------------------------\n" );
74 printf(
"Text start: %p, Text end: %p, Text length: %#x\n",
84 (
"----------------------------------------------------------------\n" );
96 printf(
"Profiling event : %s\n",
event_name );
97 printf(
"Profile Threshold: %d\n",
threshold );
98 printf(
"Profile Iters : %d\n",
99 ( getenv(
"NUM_ITERS" ) ? atoi( getenv(
"NUM_ITERS" ) ) :
101 printf(
"Profile Range : %p to %p\n",
start, end );
103 (
"----------------------------------------------------------------\n" );
120 do_flops( getenv(
"NUM_ITERS" ) ? atoi( getenv(
"NUM_ITERS" ) ) :
127 printf(
"Test type : \t%s\n",
"No profiling" );
129 printf(
TAB1,
"PAPI_TOT_CYC", (
values[0] )[1] );
144 for (
i = 0;
i < num;
i++ ) {
149 memset(
profbuf[
i], 0x00, blength );
165 bucket_size =
sizeof ( short );
168 bucket_size =
sizeof (
int );
171 bucket_size =
sizeof (
unsigned long long );
177 return ( bucket_size );
183prof_head(
unsigned long blength,
int bucket,
int num_buckets,
const char *header )
187 (
"\n------------------------------------------------------------\n" );
188 printf(
"PAPI_profil() hash table, Bucket size: %d bits.\n",
190 printf(
"Number of buckets: %d.\nLength of buffer: %ld bytes.\n",
191 num_buckets, blength );
192 printf(
"------------------------------------------------------------\n" );
193 printf(
"%s\n", header );
206 unsigned short buf_16;
208 unsigned long long buf_64;
209 unsigned short **buf16 = (
unsigned short ** )
profbuf;
210 unsigned int **buf32 = (
unsigned int ** )
profbuf;
211 unsigned long long **buf64 = (
unsigned long long ** )
profbuf;
218 for (
i = 0;
i < num_buckets;
i++ ) {
219 for ( j = 0, buf_16 = 0; j < n; j++ )
220 buf_16 |= ( buf16[j] )[
i];
225 (
long long) (
unsigned long)
start +
226 ( ( (
long long )
i * scale ) >> 15 ) );
227 for ( j = 0, buf_16 = 0; j < n; j++ )
228 printf(
"\t%d", ( buf16[j] )[
i] );
234 for (
i = 0;
i < num_buckets;
i++ ) {
235 for ( j = 0, buf_32 = 0; j < n; j++ )
236 buf_32 |= ( buf32[j] )[
i];
239 (
long long) (
unsigned long)
start +
240 ( ( (
long long )
i * scale ) >> 15 ) );
241 for ( j = 0, buf_32 = 0; j < n; j++ )
242 printf(
"\t%d", ( buf32[j] )[
i] );
248 for (
i = 0;
i < num_buckets;
i++ ) {
249 for ( j = 0, buf_64 = 0; j < n; j++ )
250 buf_64 |= ( buf64[j] )[
i];
253 (
long long) (
unsigned long)
start +
254 ( ( (
long long )
i * scale ) >> 15 ) );
255 for ( j = 0, buf_64 = 0; j < n; j++ )
256 printf(
"\t%lld", ( buf64[j] )[
i] );
263 (
"------------------------------------------------------------\n\n" );
276 unsigned short **buf16 = (
unsigned short ** )
profbuf;
277 unsigned int **buf32 = (
unsigned int ** )
profbuf;
278 unsigned long long **buf64 = (
unsigned long long ** )
profbuf;
282 for (
i = 0;
i < num_buckets;
i++ )
283 for ( j = 0; j < n; j++ )
287 for (
i = 0;
i < num_buckets;
i++ )
288 for ( j = 0; j < n; j++ )
292 for (
i = 0;
i < num_buckets;
i++ )
293 for ( j = 0; j < n; j++ )
310prof_size(
unsigned long plength,
unsigned scale,
int bucket,
int *num_buckets )
312 unsigned long blength;
313 long long llength = ( (
long long ) plength * scale );
315 *num_buckets = (
int ) ( llength / 65536 / 2 );
316 blength = (
unsigned long ) ( *num_buckets * bucket_size );
Convert a numeric hardware event code to a name.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_PROFIL_BUCKET_32
#define PAPI_PROFIL_BUCKET_16
#define PAPI_PROFIL_BUCKET_64
static struct timeval start
Return codes and api definitions.
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
long long ** allocate_test_space(int num_tests, int num_events)
int prof_check(int n, int bucket, int num_buckets)
void prof_head(unsigned long blength, int bucket, int num_buckets, const char *header)
void prof_print_prof_info(vptr_t start, vptr_t end, int threshold, char *event_name)
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
int prof_events(int num_tests)
char event_name[PAPI_MAX_STR_LEN]
void prof_alloc(int num, unsigned long blength)
void prof_out(vptr_t start, int n, int bucket, int num_buckets, unsigned int scale)
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
int prof_buckets(int bucket)
void do_no_profile(int quiet)
get the executable's info
PAPI_address_map_t address_info