src/components/io/linux-io.c
/** Enumerate Native Events
 *   @param EventCode is the event of interest
 *   @param modifier is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS
 *  If your component has attribute masks then these need to
 *   be handled here as well.
 */
Enumerate Native Events
@param EventCode is the event of interest
@param modifier is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS
If your component has attribute masks then these need to
be handled here as well.
Enumerate Native Events @param EventCode is the event of interest @param modifier is one of PAPI_ENUM_FIRST PAPI_ENUM_EVENTS If your component has attribute masks then these need to be handled here as well .
static int
_io_ntv_enum_events( unsigned int *EventCode, int modifier )
{
    int index;
    switch ( modifier ) {
        case PAPI_ENUM_FIRST:
            *EventCode = 0;
            return PAPI_OK;
        case PAPI_ENUM_EVENTS:
            index = *EventCode;
            if ( index < (gEventCount-1) ) {
                *EventCode = *EventCode + 1;
                return PAPI_OK;
            } else {
                return PAPI_ENOEVNT;
            }
            break;
        default:
            return PAPI_EINVAL;
    }
    return PAPI_EINVAL;
}
static int _io_ntv_enum_events ( unsigned int * EventCode , int modifier ) { int index ; switch ( modifier ) { case PAPI_ENUM_FIRST : * EventCode = 0 ; return PAPI_OK ; case PAPI_ENUM_EVENTS : index = * EventCode ; if ( index < ( gEventCount - 1 ) ) { * EventCode = * EventCode + 1 ; return PAPI_OK ; } else { return PAPI_ENOEVNT ; } break ; default : return PAPI_EINVAL ; } return PAPI_EINVAL ; }
Enumerate Native Events
   @param EventCode is the event of interest
   @param modifier is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS
  If your component has attribute masks then these need to
   be handled here as well.
Enumerate Native Events @param EventCode is the event of interest @param modifier is one of PAPI_ENUM_FIRST PAPI_ENUM_EVENTS If your component has attribute masks then these need to be handled here as well .
/* return EventCode of first event */ /* return EventCode of next available event */ /* Make sure we have at least 1 more event after us */