src/components/pcp/linux-pcp.c
//----------------------------------------------------------------------------
// Enumerate events. PAPI_NTV_ENUM_UMASKS has nothing to do; we don't have 
// qualifying masks or options on any of our events.
//----------------------------------------------------------------------------
Enumerate events. PAPI_NTV_ENUM_UMASKS has nothing to do; we don't have
qualifying masks or options on any of our events.
Enumerate events . PAPI_NTV_ENUM_UMASKS has nothing to do ; we don ' t have qualifying masks or options on any of our events .
static int _pcp_ntv_enum_events(unsigned int *EventCode, int modifier) 
{
   mRtnCnt(_pcp_ntv_enum_events);                                       
   int idx;
   switch (modifier) {                                                  
       case PAPI_ENUM_FIRST:                                            
           EventCode[0] = 0;                                            
           return PAPI_OK;                                              
           break;                                                       
       case PAPI_ENUM_EVENTS:                                           
           idx = EventCode[0] & PAPI_NATIVE_AND_MASK;                   
           if ((++idx) >= sEventCount) return PAPI_ENOEVNT;             
           EventCode[0] = idx | PAPI_NATIVE_MASK;                       
           return PAPI_OK;                                              
           break;                                                       
       case PAPI_NTV_ENUM_UMASKS:                                       
           return PAPI_ENOEVNT;                                         
       default:                                                         
           return PAPI_ENOEVNT;                                         
           break;                                                       
   } 
   return PAPI_EBUG;                                                    
}
static int _pcp_ntv_enum_events ( unsigned int * EventCode , int modifier ) { mRtnCnt ( _pcp_ntv_enum_events ) ; int idx ; switch ( modifier ) { case PAPI_ENUM_FIRST : EventCode [ 0 ] = 0 ; return PAPI_OK ; break ; case PAPI_ENUM_EVENTS : idx = EventCode [ 0 ] & PAPI_NATIVE_AND_MASK ; if ( ( ++ idx ) >= sEventCount ) return PAPI_ENOEVNT ; EventCode [ 0 ] = idx | PAPI_NATIVE_MASK ; return PAPI_OK ; break ; case PAPI_NTV_ENUM_UMASKS : return PAPI_ENOEVNT ; default : return PAPI_ENOEVNT ; break ; } return PAPI_EBUG ; }
Enumerate events.
Enumerate events .
// count this function. // modifier is type of enum operation desired. // Returns event code of first event created. // Return 0 as event code after a start. // EXIT. // END CASE. // return EventCode of next available event.                      // enum base events (which is all events). // Take off any hi order flag bits. // If we reach an invalid idx for pcp_event_info[], exit. Does nothing to EventCode. // If index was valid, we return it. // And exit. // END CASE. // Note we HAVE no qualifiers or masks. // There are no qualifiers to list. // If we don't understand the modifier, // .. Presets or other stuff, just say we have none. // END CASE. // end switch(modifier).                                            // Dummy return; should have exited from inside switch.