PAPI  5.0.1.0
prof_utils.h
Go to the documentation of this file.
00001 /* 
00002 * File:    prof_utils.h
00003 * CVS:     $Id$
00004 * Author:  Dan Terpstra
00005 *          terpstra@cs.utk.edu
00006 * Mods:    Maynard Johnson
00007 *          maynardj@us.ibm.com
00008 * Mods:    <your name here>
00009 *          <your email address>
00010 */
00011 
00012 /* This file contains utility definitions useful for all profiling tests
00013    It should be #included in:
00014    - profile.c,
00015    - sprofile.c,
00016    - profile_pthreads.c,
00017    - profile_twoevents.c,
00018    - earprofile.c,
00019    - future profiling tests.
00020 */
00021 
00022 /* value for scale parameter that sets scale to 1 */
00023 #define FULL_SCALE 65536
00024 
00025 /* Internal prototype */
00026 void prof_init(int argc, char **argv, const PAPI_exe_info_t **prginfo);
00027 int prof_events(int num_tests);
00028 void prof_print_address(char *title, const PAPI_exe_info_t *prginfo);
00029 void prof_print_prof_info(caddr_t start, caddr_t end, int threshold, char *event_name);
00030 void prof_alloc(int num, unsigned long plength);
00031 void prof_head(unsigned long blength, int bucket_size, int num_buckets, char *header);
00032 void prof_out(caddr_t start, int n, int bucket, int num_buckets, unsigned int scale);
00033 unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets);
00034 int prof_check(int n, int bucket, int num_buckets);
00035 int prof_buckets(int bucket);
00036 void do_no_profile(void);
00037 
00038 /* variables global to profiling tests */
00039 extern long long **values;
00040 extern char event_name[PAPI_MAX_STR_LEN];
00041 extern int PAPI_event;
00042 extern int EventSet;
00043 extern void *profbuf[5];
00044 
00045 /* Itanium returns function descriptors instead of function addresses.
00046    I couldn't find the following structure in a header file,
00047    so I duplicated it below.
00048 */
00049 #if (defined(ITANIUM1) || defined(ITANIUM2))
00050    struct fdesc {
00051       void *ip; /* entry point (code address) */
00052       void *gp; /* global-pointer */
00053    };
00054 #elif defined(__powerpc64__)
00055     struct fdesc {
00056         void * ip;   // function entry point
00057         void * toc;
00058         void * env;
00059     };
00060 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines