25int main (
int argc,
char **argv)
47 printf(
"Trying all appio events\n");
52 for(cid=0; cid<numcmp; cid++) {
55 test_fail(__FILE__, __LINE__,
"PAPI_get_component_info failed\n",-1);
59 printf(
"Component %d - %d events - %s\n", cid,
63 if ( strstr(cmpinfo->
name,
"appio") == NULL) {
86 printf(
"Added event %s (code=%#x)\n",
event_names[total_events], code);
88 event_codes[total_events++] = code;
95 const char* infile =
"/etc/group";
96 printf(
"This program will read %s and write it to /dev/null\n", infile);
110 fdin=
open(infile, O_RDONLY);
111 if (fdin < 0) perror(
"Could not open file for reading: \n");
112 fdout =
open(
"/dev/null", O_WRONLY);
113 if (fdout < 0) perror(
"Could not open /dev/null for writing: \n");
115 while ((bytes =
read(fdin,
buf, 1024)) > 0) {
128 for (
i=0;
i<total_events;
i++ ) {
129 printf(
"%#x %-24s = %lld\n",
144 if (total_events==0) {
145 test_skip(__FILE__,__LINE__,
"No appio events found", 0);
static const char * event_names[2]
int open(const char *pathname, int flags, mode_t mode)
ssize_t write(int fd, const void *buf, size_t count)
ssize_t read(int fd, void *buf, size_t count)
#define MAX_EVENTS
Prints the value of every appio event (by code)
add multiple PAPI presets or native hardware events 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.
get information about a specific software component
initialize the PAPI library.
Get the number of components available on the system.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
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 PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
char name[PAPI_MAX_STR_LEN]