23int main(
int argc,
char** argv) {
25 const char*
names[
NUM_EVENTS] = {
"READ_CALLS",
"READ_BYTES",
"READ_BLOCK_SIZE",
"READ_USEC",
"SEEK_CALLS",
"SEEK_USEC",
"SEEK_ABS_STRIDE_SIZE"};
28 char *infile =
"/etc/group";
35 fprintf(
stderr,
"PAPI_library_init version mismatch\n");
41 fprintf(
stderr,
"Error creating event set\n");
46 if (!
TESTS_QUIET) printf(
"This program will do a strided read %s and write it to stdout\n", infile);
53 fprintf(
stderr,
"Error getting code for %s\n",
names[e]);
58 fprintf(
stderr,
"Error adding %s to event set\n",
names[e]);
65 fprintf(
stderr,
"Error in PAPI_start\n");
69 fdin=
open(infile, O_RDONLY);
70 if (fdin < 0) perror(
"Could not open file for reading: \n");
79 while ((bytes =
read(fdin,
buf, 32)) > 0) {
81 lseek(fdin, 16, SEEK_CUR);
92 fprintf(
stderr,
"Error in PAPI_stop\n");
int open(const char *pathname, int flags, mode_t mode)
off_t lseek(int fd, off_t offset, int whence)
ssize_t write(int fd, const void *buf, size_t count)
ssize_t read(int fd, void *buf, size_t count)
const char * names[NUM_EVENTS]
add PAPI preset or native hardware event to an event set
Create a new empty PAPI 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.
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
static long long values[NUM_EVENTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_pass(const char *filename)