PAPI  5.3.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 * CVS: $Id$
4 * Author: Dan Terpstra
5 * terpstra@cs.utk.edu
6 * Mods: Maynard Johnson
7 * maynardj@us.ibm.com
8 * Mods: <your name here>
9 * <your email address>
10 */
11 
12 /* This file contains utility definitions useful for all profiling tests
13  It should be #included in:
14  - profile.c,
15  - sprofile.c,
16  - profile_pthreads.c,
17  - profile_twoevents.c,
18  - earprofile.c,
19  - future profiling tests.
20 */
21 
22 /* value for scale parameter that sets scale to 1 */
23 #define FULL_SCALE 65536
24 
25 /* Internal prototype */
26 void prof_init(int argc, char **argv, const PAPI_exe_info_t **prginfo);
27 int prof_events(int num_tests);
28 void prof_print_address(char *title, const PAPI_exe_info_t *prginfo);
29 void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name);
30 void prof_alloc(int num, unsigned long plength);
31 void prof_head(unsigned long blength, int bucket_size, int num_buckets, char *header);
32 void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale);
33 unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets);
34 int prof_check(int n, int bucket, int num_buckets);
35 int prof_buckets(int bucket);
36 void do_no_profile(void);
37 
38 /* variables global to profiling tests */
39 extern long long **values;
40 extern char event_name[PAPI_MAX_STR_LEN];
41 extern int PAPI_event;
42 extern int EventSet;
43 extern void *profbuf[5];
44 
45 /* Itanium returns function descriptors instead of function addresses.
46  I couldn't find the following structure in a header file,
47  so I duplicated it below.
48 */
49 #if (defined(ITANIUM1) || defined(ITANIUM2))
50  struct fdesc {
51  void *ip; /* entry point (code address) */
52  void *gp; /* global-pointer */
53  };
54 #elif defined(__powerpc64__)
55  struct fdesc {
56  void * ip; // function entry point
57  void * toc;
58  void * env;
59  };
60 #endif
char event_name[2][PAPI_MAX_STR_LEN]
Definition: data_range.c:23
int PAPI_event[2]
Definition: data_range.c:24
void prof_print_address(char *title, const PAPI_exe_info_t *prginfo)
Definition: prof_utils.c:82
void prof_head(unsigned long blength, int bucket, int num_buckets, char *header)
Definition: prof_utils.c:194
struct in_addr * ip
Definition: iozone.c:20416
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
start
Definition: iozone.c:22736
get the executable&#39;s info
Definition: papi.h:702
int int argc
Definition: iozone.c:1609
char ** argv
Definition: iozone.c:1610
void do_no_profile(void)
Definition: prof_utils.c:126
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
Definition: prof_utils.c:321
void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale)
Definition: prof_utils.c:213
void int num
Definition: iozone.c:22151
void * profbuf[5]
Definition: prof_utils.c:28
int threshold
int num_tests
Definition: zero_fork.c:46
int EventSet
int prof_buckets(int bucket)
Definition: prof_utils.c:171
void prof_init(int argc, char **argv, const PAPI_exe_info_t **prginfo)
Definition: prof_utils.c:39
void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name)
Definition: prof_utils.c:106
int prof_check(int n, int bucket, int num_buckets)
Definition: prof_utils.c:283
int prof_events(int num_tests)
Definition: prof_utils.c:59
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
void prof_alloc(int num, unsigned long blength)
Definition: prof_utils.c:151
int n
Definition: mendes-alt.c:164