int _ultra_hwd_init_control_state( hwd_control_state_t * ptr ) { ptr->counter_cmd.flags = 0x0; ptr->counter_cmd.cmd.ce_cpuver = cpuver; ptr->counter_cmd.cmd.ce_pcr = 0x0; ptr->counter_cmd.cmd.ce_pic[0] = 0; ptr->counter_cmd.cmd.ce_pic[1] = 0; _ultra_set_domain( ptr, _solaris_vector.cmp_info.default_domain ); set_granularity( ptr, _solaris_vector.cmp_info.default_granularity ); return PAPI_OK; }
//int _papi_hwd_ctl(EventSetInfo_t *zero, int code, _papi_int_option_t *option) int _papi_hwd_ctl(hwd_context_t *context, int code, _papi_int_option_t *option) { switch (code) { case PAPI_SET_DEFDOM: // return(set_default_domain(zero, option->domain.domain)); case PAPI_SET_DOMAIN: return(set_domain(&option->domain.ESI->machdep, option->domain.domain)); case PAPI_SET_DEFGRN: // return(set_default_granularity(zero, option->granularity.granularity)); case PAPI_SET_GRANUL: return(set_granularity(&option->granularity.ESI->machdep, option->granularity.granularity)); #if 0 case PAPI_SET_INHERIT: return(set_inherit(option->inherit.inherit)); #endif default: return(PAPI_EINVAL); } }
/* This function sets various options in the substrate * The valid codes being passed in are PAPI_SET_DEFDOM, * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT */ int _papi_hwd_ctl( EventSetInfo_t * zero, int code, _papi_int_option_t * option ) { switch ( code ) { case PAPI_SET_DEFDOM: return ( set_default_domain( zero, option->domain.domain ) ); case PAPI_SET_DOMAIN: return ( set_domain ( option->domain.ESI->machdep, option->domain.domain ) ); case PAPI_SET_DEFGRN: return ( set_default_granularity ( zero, option->granularity.granularity ) ); case PAPI_SET_GRANUL: return ( set_granularity ( option->granularity.ESI->machdep, option->granularity.g ranularity ) ); case PAPI_SET_INHERIT: return ( set_inherit( option->inherit.inherit ) ); default: return ( PAPI_EINVAL ); } }
int _ultra_hwd_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option ) { switch ( code ) { case PAPI_DEFDOM: return ( set_default_domain ( option->domain.ESI->ctl_state, option->domain.domain ) ); case PAPI_DOMAIN: return ( _ultra_set_domain ( option->domain.ESI->ctl_state, option->domain.domain ) ); case PAPI_DEFGRN: return ( set_default_granularity ( option->domain.ESI->ctl_state, option->granularity.granularity ) ); case PAPI_GRANUL: return ( set_granularity ( option->granularity.ESI->ctl_state, option->granularity.granularity ) ); default: return ( PAPI_EINVAL ); } }
static int set_default_granularity( hwd_control_state_t * current_state, int granularity ) { return ( set_granularity( current_state, granularity ) ); }
inline_static int set_default_granularity(EventSetInfo_t *zero, int granularity) { // hwd_control_state_t *current_state = (hwd_control_state_t *)zero->machdep; hwd_control_state_t *current_state = &zero->machdep; return(set_granularity(current_state,granularity)); }