src/components/sde/sde.c
/** Triggered by eventset operations like add or remove */
Triggered by eventset operations like add or remove
Triggered by eventset operations like add or remove
static int
_sde_update_control_state( hwd_control_state_t *ctl, 
        NativeInfo_t *native,
        int count, 
        hwd_context_t *ctx )
{
    (void) ctx;
    int i, index;
    SUBDBG( "_sde_update_control_state %p %p...\n", ctl, ctx );
    sde_control_state_t *sde_ctl = ( sde_control_state_t * ) ctl;   
    for( i = 0; i < count; i++ ) {
        index = native[i].ni_event & PAPI_NATIVE_AND_MASK;
        if( index < 0 ){
            PAPIERROR("_sde_update_control_state(): Event at index %d has a negative native event code = %d.\n",i,index);
            return PAPI_EINVAL;
        }
        SUBDBG("_sde_update_control_state: i=%d index=%u\n", i, index );
        sde_ctl->which_counter[i] = (unsigned)index;
        native[i].ni_position = i;
    }
    sde_ctl->num_events=count;
    return PAPI_OK;
}
static int _sde_update_control_state ( hwd_control_state_t * ctl , NativeInfo_t * native , int count , hwd_context_t * ctx ) { ( void ) ctx ; int i , index ; SUBDBG ( " \n " , ctl , ctx ) ; sde_control_state_t * sde_ctl = ( sde_control_state_t * ) ctl ; for ( i = 0 ; i < count ; i ++ ) { index = native [ i ] . ni_event & PAPI_NATIVE_AND_MASK ; if ( index < 0 ) { PAPIERROR ( " \n " , i , index ) ; return PAPI_EINVAL ; } SUBDBG ( " \n " , i , index ) ; sde_ctl -> which_counter [ i ] = ( unsigned ) index ; native [ i ] . ni_position = i ; } sde_ctl -> num_events = count ; return PAPI_OK ; }
Triggered by eventset operations like add or remove
Triggered by eventset operations like add or remove
// If an event for which overflowing was set is being removed from the eventset, then the // framework will turn overflowing off (by calling PAPI_overflow() with threshold=0), // so we don't need to do anything here.