/* * Test case for appio * Author: Tushar Mohan * tusharmohan@gmail.com * * Description: This test case reads from standard linux /etc/group * and writes the output to stdout. * Statistics are printed at the end of the run., */ #include #include #include #include #include #include #include #include #include "papi.h" #include "papi_test.h" #define NUM_EVENTS 12 int main(int argc, char** argv) { int Events[NUM_EVENTS]; 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"}; long long values[NUM_EVENTS]; /* Set TESTS_QUIET variable */ tests_quiet( argc, argv ); int version = PAPI_library_init (PAPI_VER_CURRENT); if (version != PAPI_VER_CURRENT) { fprintf(stderr, "PAPI_library_init version mismatch\n"); exit(1); } if (!TESTS_QUIET) fprintf(stderr, "This program will read from stdin and echo it to stdout\n"); int retval; int e; for (e=0; e 0) { write(1, buf, bytes); } /* Stop counting events */ if (PAPI_stop_counters(values, NUM_EVENTS) != PAPI_OK) { fprintf(stderr, "Error in PAPI_stop_counters\n"); } if (!TESTS_QUIET) { printf("----\n"); for (e=0; e