|
Packit Service |
a1973e |
/*
|
|
Packit Service |
a1973e |
* File: prof_utils.h
|
|
Packit Service |
a1973e |
* Author: Dan Terpstra
|
|
Packit Service |
a1973e |
* terpstra@cs.utk.edu
|
|
Packit Service |
a1973e |
* Mods: Maynard Johnson
|
|
Packit Service |
a1973e |
* maynardj@us.ibm.com
|
|
Packit Service |
a1973e |
*/
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
/* This file contains utility definitions useful for all profiling tests
|
|
Packit Service |
a1973e |
It should be #included in:
|
|
Packit Service |
a1973e |
- profile.c,
|
|
Packit Service |
a1973e |
- sprofile.c,
|
|
Packit Service |
a1973e |
- profile_pthreads.c,
|
|
Packit Service |
a1973e |
- profile_twoevents.c,
|
|
Packit Service |
a1973e |
- earprofile.c,
|
|
Packit Service |
a1973e |
- future profiling tests.
|
|
Packit Service |
a1973e |
*/
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
/* value for scale parameter that sets scale to 1 */
|
|
Packit Service |
a1973e |
#define FULL_SCALE 65536
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
/* Internal prototype */
|
|
Packit Service |
a1973e |
int prof_events(int num_tests);
|
|
Packit Service |
a1973e |
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo);
|
|
Packit Service |
a1973e |
void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name);
|
|
Packit Service |
a1973e |
void prof_alloc(int num, unsigned long plength);
|
|
Packit Service |
a1973e |
void prof_head(unsigned long blength, int bucket_size, int num_buckets, const char *header);
|
|
Packit Service |
a1973e |
void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale);
|
|
Packit Service |
a1973e |
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets);
|
|
Packit Service |
a1973e |
int prof_check(int n, int bucket, int num_buckets);
|
|
Packit Service |
a1973e |
int prof_buckets(int bucket);
|
|
Packit Service |
a1973e |
void do_no_profile(int quiet);
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
/* variables global to profiling tests */
|
|
Packit Service |
a1973e |
extern long long **values;
|
|
Packit Service |
a1973e |
extern char event_name[PAPI_MAX_STR_LEN];
|
|
Packit Service |
a1973e |
extern int PAPI_event;
|
|
Packit Service |
a1973e |
extern int EventSet;
|
|
Packit Service |
a1973e |
extern void *profbuf[5];
|
|
Packit Service |
a1973e |
|
|
Packit Service |
a1973e |
/* Itanium returns function descriptors instead of function addresses.
|
|
Packit Service |
a1973e |
I couldn't find the following structure in a header file,
|
|
Packit Service |
a1973e |
so I duplicated it below.
|
|
Packit Service |
a1973e |
*/
|
|
Packit Service |
a1973e |
#if (defined(ITANIUM1) || defined(ITANIUM2))
|
|
Packit Service |
a1973e |
struct fdesc {
|
|
Packit Service |
a1973e |
void *ip; /* entry point (code address) */
|
|
Packit Service |
a1973e |
void *gp; /* global-pointer */
|
|
Packit Service |
a1973e |
};
|
|
Packit Service |
a1973e |
#elif defined(__powerpc64__)
|
|
Packit Service |
a1973e |
struct fdesc {
|
|
Packit Service |
a1973e |
void * ip; // function entry point
|
|
Packit Service |
a1973e |
void * toc;
|
|
Packit Service |
a1973e |
void * env;
|
|
Packit Service |
a1973e |
};
|
|
Packit Service |
a1973e |
#endif
|