C Interface
#include <papi.h>
int PAPI_enum_event(int *EventCode,int modifer);
Fortran Interface
#include fpapi.h
PAPIF_enum_event(C_INT EventCode, C_INT modifier, C_INT check)
int i = 0 | NATIVE_MASK;
int retval;
PAPI_event_info_t info;
/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT) {
fprintf(stderr,"PAPI library init error!\n");
exit(1); }
/* Scan for all supported native events on this platform */
printf("Name Code Description0);
do {
retval = PAPI_get_event_info(i, &info);
if (retval == PAPI_OK) {
printf("%-30s 0x%-10x0s0, info.symbol, info.event_code, info.long_descr);
}
} while (PAPI_enum_event(&i, PAPI_ENUM_ALL) == PAPI_OK);