Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
◆ NUM_EVENTS
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 24 of file appio_test_read_write.c.
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"};
29 char *infile =
"/etc/group";
36 fprintf(stderr,
"PAPI_library_init version mismatch\n");
41 if (!
TESTS_QUIET) printf(
"This program will read %s and write it to /dev/null\n", infile);
47 fprintf(stderr,
"Error getting code for %s\n",
names[e]);
54 fprintf(stderr,
"Error in PAPI_start_counters\n");
58 fdin=
open(infile, O_RDONLY);
59 if (fdin < 0) perror(
"Could not open file for reading: \n");
61 fdout=
open(
"/dev/null", O_WRONLY);
62 if (fdout < 0) perror(
"Could not open file for writing: \n");
71 while ((bytes =
read(fdin,
buf, 1024)) > 0) {
84 fprintf(stderr,
"Error in PAPI_stop_counters\n");
ssize_t read(int fd, void *buf, size_t count)
void test_pass(const char *filename)
static int Events[NUM_EVENTS]
int PAPI_event_name_to_code(const char *in, int *out)
int open(const char *pathname, int flags, mode_t mode)
int PAPI_library_init(int version)
ssize_t write(int fd, const void *buf, size_t count)
int PAPI_stop_counters(long long *values, int array_len)
int tests_quiet(int argc, char **argv)
int PAPI_start_counters(int *events, int array_len)
static long long values[NUM_EVENTS]
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
const char * names[NUM_EVENTS]