PAPI  5.6.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
prof_utils.h
Go to the documentation of this file.
1 /*
2 * File: prof_utils.h
3 * Author: Dan Terpstra
4 * terpstra@cs.utk.edu
5 * Mods: Maynard Johnson
6 * maynardj@us.ibm.com
7 */
8 
9 /* This file contains utility definitions useful for all profiling tests
10  It should be #included in:
11  - profile.c,
12  - sprofile.c,
13  - profile_pthreads.c,
14  - profile_twoevents.c,
15  - earprofile.c,
16  - future profiling tests.
17 */
18 
19 /* value for scale parameter that sets scale to 1 */
20 #define FULL_SCALE 65536
21 
22 /* Internal prototype */
23 int prof_events(int num_tests);
24 void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo);
25 void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name);
26 void prof_alloc(int num, unsigned long plength);
27 void prof_head(unsigned long blength, int bucket_size, int num_buckets, const char *header);
28 void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale);
29 unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets);
30 int prof_check(int n, int bucket, int num_buckets);
31 int prof_buckets(int bucket);
32 void do_no_profile(int quiet);
33 
34 /* variables global to profiling tests */
35 extern long long **values;
36 extern char event_name[PAPI_MAX_STR_LEN];
37 extern int PAPI_event;
38 extern int EventSet;
39 extern void *profbuf[5];
40 
41 /* Itanium returns function descriptors instead of function addresses.
42  I couldn't find the following structure in a header file,
43  so I duplicated it below.
44 */
45 #if (defined(ITANIUM1) || defined(ITANIUM2))
46  struct fdesc {
47  void *ip; /* entry point (code address) */
48  void *gp; /* global-pointer */
49  };
50 #elif defined(__powerpc64__)
51  struct fdesc {
52  void * ip; // function entry point
53  void * toc;
54  void * env;
55  };
56 #endif
char event_name[2][PAPI_MAX_STR_LEN]
Definition: data_range.c:29
int PAPI_event[2]
Definition: data_range.c:30
struct in_addr * ip
Definition: iozone.c:20416
start
Definition: iozone.c:22736
int EventSet
get the executable's info
Definition: papi.h:707
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
Definition: prof_utils.c:310
void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale)
Definition: prof_utils.c:202
int quiet
Definition: rapl_overflow.c:18
void int num
Definition: iozone.c:22151
void * profbuf[5]
Definition: prof_utils.c:33
static int threshold
int num_tests
Definition: zero_fork.c:53
void prof_head(unsigned long blength, int bucket, int num_buckets, const char *header)
Definition: prof_utils.c:183
int prof_buckets(int bucket)
Definition: prof_utils.c:160
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
Definition: prof_utils.c:69
void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name)
Definition: prof_utils.c:93
void do_no_profile(int quiet)
Definition: prof_utils.c:113
int prof_check(int n, int bucket, int num_buckets)
Definition: prof_utils.c:272
int prof_events(int num_tests)
Definition: prof_utils.c:42
#define PAPI_MAX_STR_LEN
Definition: papi.h:465
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
void prof_alloc(int num, unsigned long blength)
Definition: prof_utils.c:140