Go to the source code of this file.
◆ NUM_EVENTS
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 24 of file appio_test_blocking.c.
24 {
26 const char*
names[
NUM_EVENTS] = {
"OPEN_CALLS",
"OPEN_FDS",
"READ_CALLS",
"READ_BYTES",
"READ_USEC",
"READ_ERR",
"READ_INTERRUPTED",
"READ_WOULD_BLOCK",
"WRITE_CALLS",
"WRITE_BYTES",
"WRITE_USEC",
"WRITE_WOULD_BLOCK"};
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) fprintf(
stderr,
"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 while ((bytes =
read(0,
buf, 1024)) > 0) {
77 }
78
79
80
82 fprintf(
stderr,
"Error in PAPI_stop\n");
83 }
84
86 printf("----\n");
89 }
91 return 0;
92}
ssize_t write(int fd, const void *buf, size_t count)
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)