43 for (
i = 0;
i <
N;
i++ ) {
59 for ( j = 0; j <
T; j++ ) {
60 for (
i = 0;
i <
N;
i++ ) {
64 memset(
aa, 0,
sizeof (
aa ) );
65 for (
i = 0;
i <
N;
i++ ) {
74 int bucket,
unsigned int mask ) {
77 unsigned long blength;
86 strncpy(header,
"address\t\t",BUFSIZ);
95 strncat(header,
"\tcyc",BUFSIZ-1);
98 strncat(header,
"\tins",BUFSIZ-1);
101 strncat(header,
"\tfp_ins",BUFSIZ-1);
104 strncat(header,
"\tfp_ops",BUFSIZ-1);
107 strncat(header,
"\tl2_tcm",BUFSIZ-1);
115 strncat(header,
"\n",BUFSIZ-1);
119 blength =
prof_size( plength, scale, bucket, &num_buckets );
122 if ( !
TESTS_QUIET ) printf(
"Overall event counts:\n" );
130 test_warn( __FILE__, __LINE__,
"Trying to profile with derived event", 1);
135 printf(
"Failed with event %d %#x\n",
i,
events[
i]);
150 printf(
TAB1,
"PAPI_TOT_CYC:", (
values[0] )[--event] );
152 printf(
TAB1,
"PAPI_TOT_INS:", (
values[0] )[--event] );
154#if defined(__powerpc__)
155 printf(
TAB1,
"PAPI_FP_INS", (
values[0] )[--event] );
158 printf(
TAB1,
"PAPI_FP_OPS:", (
values[0] )[--event] );
159 printf(
TAB1,
"PAPI_L2_TCM:", (
values[0] )[--event] );
173 prof_head( blength, bucket, num_buckets, header );
177 for (
i = 0;
i < num_bufs;
i++ ) {
204 test_fail( __FILE__, __LINE__,
"PAPI_get_executable_info", 1 );
209 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
214#if defined(__powerpc__)
226 if (!
quiet) printf(
"Trouble adding events\n");
227 test_skip(__FILE__,__LINE__,
"add_test_events",2);
238#if defined(ITANIUM1) || defined(ITANIUM2) \
239 || (defined(__powerpc64__) && (_CALL_ELF != 2))
241 end = (
vptr_t ) ( ( (
struct fdesc * ) end )->ip );
253 test_fail( __FILE__, __LINE__,
"Profile length < 0!", (
int )
length );
257 "Multi-event profiling at byte resolution.\n",
269 test_fail( __FILE__, __LINE__,
"No information in buffers", 1 );
static const PAPI_hw_info_t * hw_info
static void cleara(double a[N])
static int my_dummy(int i)
static void my_main(void)
static int do_profile(vptr_t start, unsigned long plength, unsigned scale, int thresh, int bucket, unsigned int mask)
Get the executable's address space info.
get information about the system hardware
initialize the PAPI library.
Generate a histogram of hardware counter overflows vs. PC addresses.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_PROFIL_BUCKET_32
#define PAPI_PROFIL_POSIX
char events[MAX_EVENTS][BUFSIZ]
static long long values[NUM_EVENTS]
static struct timeval start
static double a[MATRIX_SIZE][MATRIX_SIZE]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
int add_test_events(int *number, int *mask, int allow_derived)
struct test_events_t test_events[]
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
long long ** allocate_test_space(int num_tests, int num_events)
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)
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)
get the executable's info
char model_string[PAPI_MAX_STR_LEN]