25 int main (
int argc,
char **argv)
47 printf(
"Trying all appio events\n");
52 for(cid=0; cid<numcmp; cid++) {
55 test_fail(__FILE__, __LINE__,
"PAPI_get_component_info failed\n",-1);
59 printf(
"Component %d - %d events - %s\n", cid,
63 if ( strstr(cmpinfo->
name,
"appio") == NULL) {
86 printf(
"Added event %s (code=%#x)\n", event_names[total_events], code);
88 event_codes[total_events++] = code;
95 const char* infile =
"/etc/group";
96 printf(
"This program will read %s and write it to /dev/null\n", infile);
110 fdin=
open(infile, O_RDONLY);
111 if (fdin < 0) perror(
"Could not open file for reading: \n");
112 fdout =
open(
"/dev/null", O_WRONLY);
113 if (fdout < 0) perror(
"Could not open /dev/null for writing: \n");
115 while ((bytes =
read(fdin,
buf, 1024)) > 0) {
128 for (
i=0;
i<total_events;
i++ ) {
129 printf(
"%#x %-24s = %lld\n",
130 event_codes[
i], event_names[
i], event_values[
i]);
144 if (total_events==0) {
145 test_skip(__FILE__,__LINE__,
"No appio events found", 0);
ssize_t read(int fd, void *buf, size_t count)
int PAPI_stop(int EventSet, long long *values)
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
void test_pass(const char *filename)
int main(int argc, char **argv)
int PAPI_num_components(void)
int PAPI_add_events(int EventSet, int *Events, int number)
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)
char name[PAPI_MAX_STR_LEN]
int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx)
int PAPI_cleanup_eventset(int EventSet)
int PAPI_create_eventset(int *EventSet)
int PAPI_event_code_to_name(int EventCode, char *out)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
#define MAX_EVENTS
Prints the value of every appio event (by code)
int PAPI_destroy_eventset(int *EventSet)
int PAPI_start(int EventSet)
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]