29int 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);
int open(const char *pathname, int flags, mode_t mode)
ssize_t write(int fd, const void *buf, size_t count)
ssize_t read(int fd, void *buf, size_t count)
#define NUM_EVENTS
Prints the values of several (but not all) appio events specified by names.
add multiple PAPI presets or native hardware events to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an 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.
char event_name[2][PAPI_MAX_STR_LEN]
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)