38{
41 unsigned short **
buf = (
unsigned short ** )
profbuf;
42 unsigned long length, blength;
43 int num_buckets;
49
50
52
56 }
57
59 test_fail( __FILE__, __LINE__,
"PAPI_get_executable_info", 1 );
60 }
61
66 }
69 prof_print_address(
"Test case sprofile: POSIX compatible profiling over multiple regions.\n",
70 prginfo );
71 }
72
74 &num_buckets );
76
77
81#if defined(linux) && defined(__ia64__)
83 fprintf(
stderr,
"do_flops is at %p %p\n", &
do_flops, sprof[0].pr_off );
84#endif
86
90#if defined(linux) && defined(__ia64__)
92 fprintf(
stderr,
"do_reads is at %p %p\n", &
do_reads, sprof[1].pr_off );
93#endif
95
100
102
104
109 if (!
quiet) printf(
"Trouble creating events\n");
111 }
113 }
114
116
119
121
124
125
130
132
133
134
136 printf( "Test case: PAPI_sprofil()\n" );
137 printf( "---------Buffer 1--------\n" );
140 printf(
"%#lx\t%d\n",
DO_FLOPS + 2 * (
unsigned long )
i,
142 }
143 printf( "---------Buffer 2--------\n" );
146 printf(
"%#lx\t%d\n",
DO_READS + 2 * (
unsigned long )
i,
148 }
149 printf( "-------------------------\n" );
150 printf(
"%u samples fell outside the regions.\n", *
buf[2] );
151 }
153
154 for (
i = 0;
i < 3;
i++ ) {
156 }
158 test_fail( __FILE__, __LINE__,
"No information in buffers", 1 );
159 }
160
162
163 return 0;
164}
Get the executable's address space info.
initialize the PAPI library.
Generate PC histogram data from multiple code regions where hardware counter overflow occurs.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
#define PAPI_PROFIL_POSIX
#define PAPI_PROFIL_BUCKET_16
static long long values[NUM_EVENTS]
static struct timeval start
int tests_quiet(int argc, char **argv)
int add_test_events(int *number, int *mask, int allow_derived)
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 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)
unsigned long prof_size(unsigned long plength, unsigned scale, int bucket, int *num_buckets)
void prof_alloc(int num, unsigned long blength)
void prof_print_address(const char *title, const PAPI_exe_info_t *prginfo)
get the executable's info
PAPI_address_map_t address_info