24 {
28
29
31
34 fprintf(
stderr,
"PAPI_library_init version mismatch\n");
35 exit(1);
36 }
37
38
40 fprintf(
stderr,
"Error creating event set\n");
41 exit(2);
42 }
43
44 if (!
TESTS_QUIET) printf(
"This program will read from stdin and echo it to stdout\n");
46 int e;
47 int event_code;
51 fprintf(
stderr,
"Error getting code for %s\n",
names[e]);
52 exit(2);
53 }
56 fprintf(
stderr,
"Error adding %s to event set\n",
names[e]);
57 exit(2);
58 }
59 }
60
61
63 fprintf(
stderr,
"Error in PAPI_start\n");
64 exit(1);
65 }
66
67 int bytes = 0;
69
70
71
72
73
74
75 int fdready;
77 FD_SET(0,&readfds);
78
79 while (
select(1,&readfds,NULL,NULL,NULL)) {
82 if (bytes == 0) break;
83 }
84
85
86
88 fprintf(
stderr,
"Error in PAPI_stop\n");
89 }
90
92 printf("----\n");
95 }
97 return 0;
98}
ssize_t write(int fd, const void *buf, size_t count)
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
ssize_t read(int fd, void *buf, size_t count)
const char * names[NUM_EVENTS]
add PAPI preset or native hardware event to an event set
Create a new empty PAPI 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.
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
static long long values[NUM_EVENTS]
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_pass(const char *filename)