30int main (
int argc,
char **argv)
37 int numcmp,cid,example_cid=-1;
38 int code,maximum_code=0;
53 printf(
"Testing I/O component with PAPI %d.%d.%d\n",
62 for( cid=0; cid<numcmp; cid++) {
65 "PAPI_get_component_info failed\n", 0);
68 printf(
"\tComponent %d - %d events - %s\n", cid,
72 if (strstr(cmpinfo->
name,
"io")) {
81 "Example component not found\n", 0);
85 printf(
"\nFound io Component at id %d\n",example_cid);
86 printf(
"\nListing all events in this component:\n");
99 printf(
"Error translating %#x\n",code);
101 "PAPI_event_code_to_name",
retval );
105 printf(
"Error getting info for event %#x\n",code);
107 "PAPI_get_event_info()",
retval );
111 printf(
"\tEvent %#x: %s -- %s\n",
120 if (!
quiet) printf(
"\n");
129 "Failed to return PAPI_ENOEVNT on invalid event",
retval );
139 "PAPI_create_eventset() failed\n",
retval );
145 "io:::rchar not found\n",
retval );
151 "PAPI_add_events failed\n",
retval );
157 "PAPI_start failed\n",
retval );
165 if (!
quiet) printf(
"Testing io:::rchar: %lld\n",
values[0]);
168 test_fail( __FILE__, __LINE__,
"Result should be != 0!\n", 0);
191 "PAPI_create_eventset() failed\n",
retval );
197 "io:::wchar not found\n",
retval );
203 "PAPI_add_events failed\n",
retval );
209 "PAPI_start failed\n",
retval );
217 if (!
quiet) printf(
"Testing io:::wchar: %lld\n",
values[0]);
220 test_fail( __FILE__, __LINE__,
"Result should be != 0!\n", 0);
231 "PAPI_start failed\n",
retval );
260 "PAPI_reset() failed\n",
retval );
266 "PAPI_start failed\n",
retval );
272 "PAPI_reset() failed\n",
retval );
281 if (!
quiet) printf(
"Testing after PAPI_reset(): %lld\n",
285 test_fail( __FILE__, __LINE__,
"Result zero!\n", 0);
305 if (!
quiet) printf(
"Testing Multiple Events: ");
310 "PAPI_create_eventset() failed\n",
retval );
316 "io:::rchar not found\n",
retval );
322 "PAPI_add_events failed\n",
retval );
328 "io:::wchar not found\n",
retval );
334 "PAPI_add_events failed\n",
retval );
340 "io:::read_bytes not found\n",
retval );
346 "PAPI_add_events failed\n",
retval );
353 "PAPI_start failed\n",
retval );
369 test_fail( __FILE__, __LINE__,
"Result should be != 0!\n", 0);
388 if (!
quiet) printf(
"Testing Write\n");
393 "PAPI_create_eventset() failed\n",
retval );
399 "io:::rchar not found\n",
retval );
405 "PAPI_add_events failed\n",
retval );
411 "io:::read_bytes not found\n",
retval );
417 "PAPI_add_events failed\n",
retval );
423 "io:::wchar not found\n",
retval );
429 "PAPI_add_events failed\n",
retval );
436 "PAPI_start failed\n",
retval );
442 "PAPI_read failed\n",
retval );
446 printf(
"Before values: ");
460 "PAPI_write failed\n",
retval );
469 printf(
"After values: ");
478 test_fail( __FILE__, __LINE__,
"Result should be != 0!\n", 0);
498 if (!
quiet) printf(
"\n");
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Enumerate PAPI preset or native events for a given component.
Convert a numeric hardware event code to a name.
Convert a name to a numeric hardware event code.
get information about a specific software component
Get the event's name and description info.
initialize the PAPI library.
Get the number of components available on the system.
Read hardware counters from an event set.
Reset the hardware event counts in an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Write counter values into counters.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
static struct counter_info * event_info
Return codes and api definitions.
#define PAPI_VERSION_REVISION(x)
#define PAPI_VERSION_MAJOR(x)
#define PAPI_VERSION_MINOR(x)
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 PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
char name[PAPI_MAX_STR_LEN]