45 unsigned long blength;
48 const char *profstr[5] = {
"PAPI_PROFIL_POSIX",
50 "PAPI_PROFIL_WEIGHTED",
51 "PAPI_PROFIL_COMPRESS",
64 blength =
prof_size( plength, scale, bucket, &num_buckets );
67 for (
i = 0;
i < 5;
i++ ) {
69 printf(
"Test type : \t%s\n", profstr[
i] );
76 profflags[
i] | bucket ) ) !=
PAPI_OK ) {
80 sprintf(warning,
"PAPI_profil %s not supported",
82 test_warn( __FILE__, __LINE__, warning, 1 );
104 do_flops( getenv(
"NUM_FLOPS" ) ? atoi( getenv(
"NUM_FLOPS" ) ) :
112 printf(
TAB1,
"PAPI_TOT_CYC", (
values[1] )[1] );
124 "address\t\t\tflat\trandom\tweight\tcomprs\tall\n" );
129 for (
i = 0;
i < 5;
i++ ) {
158 test_fail( __FILE__, __LINE__,
"PAPI_get_executable_info", 1 );
163 if (!
quiet) printf(
"No events found\n");
164 test_skip(__FILE__, __LINE__,
"No events found",1);
180#if defined(ITANIUM1) || defined(ITANIUM2) || defined(__powerpc64__)
182 end = (
vptr_t ) ( ( (
struct fdesc * ) end )->ip );
188 char *
tmp = getenv(
"THRESHOLD" );
196 test_fail( __FILE__, __LINE__,
"Profile length < 0!", (
int )
length );
201 "POSIX compatible profiling with hardware counters.\n",
Get the executable's address space info.
initialize the PAPI library.
Generate a histogram of hardware counter overflows vs. PC addresses.
Query if PAPI event exists.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long mythreshold
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_PROFIL_BUCKET_32
#define PAPI_PROFIL_WEIGHTED
#define PAPI_PROFIL_POSIX
#define PAPI_PROFIL_BUCKET_16
#define PAPI_PROFIL_FORCE_SW
#define PAPI_PROFIL_BUCKET_64
#define PAPI_PROFIL_COMPRESS
#define PAPI_PROFIL_RANDOM
static long long values[NUM_EVENTS]
static struct timeval start
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void test_warn(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
int remove_test_events(int *EventSet, int mask)
int prof_check(int n, int bucket, int num_buckets)
void prof_head(unsigned long blength, int bucket, int num_buckets, const char *header)
void prof_print_prof_info(vptr_t start, vptr_t end, int threshold, char *event_name)
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
int prof_events(int num_tests)
void prof_alloc(int num, unsigned long blength)
void prof_out(vptr_t start, int n, int bucket, int num_buckets, unsigned int scale)
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
void do_no_profile(int quiet)
static int do_profile(vptr_t start, unsigned long plength, unsigned scale, int thresh, int bucket)
get the executable's info
PAPI_address_map_t address_info