11#define ERROR_RETURN(retval) { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }
56 printf(
"There are %d events in the event set\n", number);
65 for (
i = 0;
i < 2000000;
i++)
75 printf(
"The total instructions executed for the first loop are %lld \n",
values[0] );
76 printf(
"The total cycles executed for the first loop are %lld \n",
values[1]);
80 for (
i = 0;
i < 2000000;
i++)
89 printf(
"Total instructions executed are %lld \n",
values[0] );
90 printf(
"Total cycles executed are %lld \n",
values[1]);
95 printf(
"Removing PAPI_TOT_INS from the eventset\n");
102 printf(
"There is only %d event left in the eventset now\n", number);
#define ERROR_RETURN(retval)
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
initialize the PAPI library.
list the events in an event set
Read hardware counters from an event set.
removes a hardware event from a PAPI event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]
Return codes and api definitions.