PAPI 7.1.0.0
Loading...
Searching...
No Matches
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 */
23int prof_events(int num_tests);
24void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo);
26void prof_alloc(int num, unsigned long plength);
27void prof_head(unsigned long blength, int bucket_size, int num_buckets, const char *header);
28void prof_out(vptr_t start, int n, int bucket, int num_buckets, unsigned int scale);
29unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets);
30int prof_check(int n, int bucket, int num_buckets);
31int prof_buckets(int bucket);
32void do_no_profile(int quiet);
33
34/* variables global to profiling tests */
35extern long long **values;
36extern char event_name[PAPI_MAX_STR_LEN];
37extern int PAPI_event;
38extern int EventSet;
39extern 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
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
static int threshold
static struct timeval start
void * vptr_t
Definition: papi.h:576
int prof_check(int n, int bucket, int num_buckets)
Definition: prof_utils.c:272
int PAPI_event
Definition: data_range.c:30
int EventSet
Definition: data_range.c:31
void prof_print_prof_info(vptr_t start, vptr_t end, int threshold, char *event_name)
Definition: prof_utils.c:93
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
Definition: prof_utils.c:310
int prof_events(int num_tests)
Definition: prof_utils.c:42
char event_name[PAPI_MAX_STR_LEN]
Definition: data_range.c:29
void prof_out(vptr_t start, int n, int bucket, int num_buckets, unsigned int scale)
Definition: prof_utils.c:202
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
Definition: prof_utils.c:69
void prof_alloc(int num, unsigned long plength)
Definition: prof_utils.c:140
int prof_buckets(int bucket)
Definition: prof_utils.c:160
void * profbuf[5]
Definition: prof_utils.c:33
void do_no_profile(int quiet)
Definition: prof_utils.c:113
long long ** values
Definition: prof_utils.c:29
void prof_head(unsigned long blength, int bucket_size, int num_buckets, const char *header)
Definition: prof_utils.c:183
int quiet
Definition: rapl_overflow.c:19
get the executable's info
Definition: papi.h:696
int num_tests
Definition: zero_fork.c:53