30{
34 "READ_BYTES",
35 "READ_CALLS",
36 "READ_USEC",
37 "READ_EOF",
38 "READ_SHORT",
39 "READ_ERR",
40 "WRITE_BYTES",
41 "WRITE_CALLS",
42 "WRITE_USEC",
43 "WRITE_ERR",
44 "WRITE_SHORT"
45 };
46 int event_code[
NUM_EVENTS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0};
48 int total_events=0;
49
50
52
53
57 }
58
60 printf("Appio events by name\n");
61 }
62
63
68 }
69
70 total_events++;
71 }
72
73 int fdin,fdout;
74 const char* infile = "/etc/group";
75 if (!
TESTS_QUIET) printf(
"This program will read %s and write it to /dev/null\n", infile);
76 int bytes = 0;
78
79
81
85 }
86
90 }
91
95 }
96
97 fdin=
open(infile, O_RDONLY);
98 if (fdin < 0) perror("Could not open file for reading: \n");
99 fdout=
open(
"/dev/null", O_WRONLY);
100 if (fdout < 0) perror("Could not open /dev/null for writing: \n");
101
102 while ((bytes =
read(fdin,
buf, 1024)) > 0) {
104 }
107
111 }
112
115 printf("%#x %-24s = %lld\n",
117 }
118 }
119
123 }
124
128 }
129
130 if (total_events==0) {
131 test_skip(__FILE__,__LINE__,
"No appio events found", 0);
132 }
133
135
136 return 0;
137}
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 NUM_EVENTS
Prints the values of several (but not all) appio events specified by names.
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.
Convert a name to a numeric hardware event code.
initialize the PAPI library.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
char event_name[2][PAPI_MAX_STR_LEN]
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
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)