18 #include <sys/types.h> 29 int main (
int argc,
char **argv)
46 int event_code[
NUM_EVENTS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0};
60 printf(
"Appio events by name\n");
74 const char* infile =
"/etc/group";
75 if (!
TESTS_QUIET) printf(
"This program will read %s and write it to /dev/null\n", infile);
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");
102 while ((bytes =
read(fdin,
buf, 1024)) > 0) {
115 printf(
"%#x %-24s = %lld\n",
130 if (total_events==0) {
131 test_skip(__FILE__,__LINE__,
"No appio events found", 0);
char event_name[2][PAPI_MAX_STR_LEN]
ssize_t read(int fd, void *buf, size_t count)
int PAPI_stop(int EventSet, long long *values)
int main(int argc, char **argv)
void test_pass(const char *filename)
int PAPI_event_name_to_code(const char *in, int *out)
int PAPI_add_events(int EventSet, int *Events, int number)
#define NUM_EVENTS
Prints the values of several (but not all) appio events specified by names.
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
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_cleanup_eventset(int EventSet)
int PAPI_create_eventset(int *EventSet)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_destroy_eventset(int *EventSet)
int PAPI_start(int EventSet)
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]