PAPI  5.7.0.0
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);
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
int PAPI_event
Definition: data_range.c:30
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
Definition: prof_utils.c:69
char event_name[PAPI_MAX_STR_LEN]
Definition: data_range.c:29
get the executable's info
Definition: papi.h:708
int EventSet
static struct timeval start
int prof_buckets(int bucket)
Definition: prof_utils.c:160
void prof_alloc(int num, unsigned long plength)
Definition: prof_utils.c:140
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
int quiet
Definition: rapl_overflow.c:18
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
static int threshold
void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale)
Definition: prof_utils.c:202
int num_tests
Definition: zero_fork.c:53
void prof_head(unsigned long blength, int bucket_size, int num_buckets, const char *header)
Definition: prof_utils.c:183
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
Definition: prof_utils.c:310
char * caddr_t
long long ** values
Definition: prof_utils.c:29
void * profbuf[5]
Definition: prof_utils.c:33
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43