29{
30
35
38
42
43
45
46
47
48
49
50
51
52
53
55 {
56 printf("Library initialization error! \n");
57 exit(1);
58 }
59
60
62 {
63 fprintf(
stderr,
"Error in get executable information \n");
64 exit(1);
65 }
66
70
71
72
73
74
75
76
79 {
80 fprintf(
stderr,
"Not enough memory \n");
81 exit(1);
82 }
84
85
88
90
93
94
97
98
102
103
106
108
111
112
113
114
118
119 printf("-----------------------------------------------------------\n");
120 printf("Text start: %p, Text end: %p, \n",
122 printf("Data start: %p, Data end: %p\n",
124 printf("BSS start : %p, BSS end: %p\n",
126
127 printf("------------------------------------------\n");
128
129 printf("Test type : \tPAPI_PROFIL_POSIX\n");
130 printf("------------------------------------------\n\n\n");
131 printf("PAPI_profil() hash table.\n");
132 printf("address\t\tflat \n");
134 {
136 printf("%#lx\t%d \n",
138 }
139
140 printf("-----------------------------------------\n");
141
146 printf("Test succeeds! \n");
147 else
148 printf( "No information in buffers\n");
149
151
152 exit(0);
153}
#define ERROR_RETURN(retval)
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Get the executable's address space info.
initialize the PAPI library.
Generate a histogram of hardware counter overflows vs. PC addresses.
Finish using PAPI and free all related resources.
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_POSIX
#define PAPI_PROFIL_BUCKET_16
static long long values[NUM_EVENTS]
static struct timeval start
get the executable's info
PAPI_address_map_t address_info