|
PAPI
5.3.0.0
|
00001 /****************************/ 00002 /* THIS IS OPEN SOURCE CODE */ 00003 /****************************/ 00004 00020 #include "linux-L2unit.h" 00021 00022 /* Declare our vector in advance */ 00023 papi_vector_t _L2unit_vector; 00024 00025 /* prototypes */ 00026 void user_signal_handler_L2UNIT( int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext ); 00027 00028 /***************************************************************************** 00029 ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS ************* 00030 *****************************************************************************/ 00031 00032 /* 00033 * This is called whenever a thread is initialized 00034 */ 00035 int 00036 L2UNIT_init_thread( hwd_context_t * ctx ) 00037 { 00038 #ifdef DEBUG_BGQ 00039 printf( "L2UNIT_init_thread\n" ); 00040 #endif 00041 00042 ( void ) ctx; 00043 return PAPI_OK; 00044 } 00045 00046 00047 /* Initialize hardware counters, setup the function vector table 00048 * and get hardware information, this routine is called when the 00049 * PAPI process is initialized (IE PAPI_library_init) 00050 */ 00051 int 00052 L2UNIT_init_component( int cidx ) 00053 { 00054 #ifdef DEBUG_BGQ 00055 printf( "L2UNIT_init_component\n" ); 00056 #endif 00057 00058 _L2unit_vector.cmp_info.CmpIdx = cidx; 00059 #ifdef DEBUG_BGQ 00060 printf( "L2UNIT_init_component cidx = %d\n", cidx ); 00061 #endif 00062 00063 return ( PAPI_OK ); 00064 } 00065 00066 00067 /* 00068 * Control of counters (Reading/Writing/Starting/Stopping/Setup) 00069 * functions 00070 */ 00071 int 00072 L2UNIT_init_control_state( hwd_control_state_t * ptr ) 00073 { 00074 #ifdef DEBUG_BGQ 00075 printf( "L2UNIT_init_control_state\n" ); 00076 #endif 00077 int retval; 00078 00079 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00080 00081 this_state->EventGroup = Bgpm_CreateEventSet(); 00082 retval = _check_BGPM_error( this_state->EventGroup, "Bgpm_CreateEventSet" ); 00083 if ( retval < 0 ) return retval; 00084 00085 // initialize overflow flag to OFF (0) 00086 this_state->overflow = 0; 00087 this_state->overflow_count = 0; 00088 // initialized BGPM eventGroup flag to NOT applied yet (0) 00089 this_state->bgpm_eventset_applied = 0; 00090 00091 return PAPI_OK; 00092 } 00093 00094 00095 /* 00096 * 00097 */ 00098 int 00099 L2UNIT_start( hwd_context_t * ctx, hwd_control_state_t * ptr ) 00100 { 00101 #ifdef DEBUG_BGQ 00102 printf( "L2UNIT_start\n" ); 00103 #endif 00104 ( void ) ctx; 00105 int retval; 00106 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00107 00108 retval = Bgpm_Apply( this_state->EventGroup ); 00109 retval = _check_BGPM_error( retval, "Bgpm_Apply" ); 00110 if ( retval < 0 ) return retval; 00111 00112 // set flag to 1: BGPM eventGroup HAS BEEN applied 00113 this_state->bgpm_eventset_applied = 1; 00114 00115 /* Bgpm_Apply() does an implicit reset; 00116 hence no need to use Bgpm_ResetStart */ 00117 retval = Bgpm_Start( this_state->EventGroup ); 00118 retval = _check_BGPM_error( retval, "Bgpm_Start" ); 00119 if ( retval < 0 ) return retval; 00120 00121 return ( PAPI_OK ); 00122 } 00123 00124 00125 /* 00126 * 00127 */ 00128 int 00129 L2UNIT_stop( hwd_context_t * ctx, hwd_control_state_t * ptr ) 00130 { 00131 #ifdef DEBUG_BGQ 00132 printf( "L2UNIT_stop\n" ); 00133 #endif 00134 ( void ) ctx; 00135 int retval; 00136 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00137 00138 retval = Bgpm_Stop( this_state->EventGroup ); 00139 retval = _check_BGPM_error( retval, "Bgpm_Stop" ); 00140 if ( retval < 0 ) return retval; 00141 00142 return ( PAPI_OK ); 00143 } 00144 00145 00146 /* 00147 * 00148 */ 00149 int 00150 L2UNIT_read( hwd_context_t * ctx, hwd_control_state_t * ptr, 00151 long_long ** events, int flags ) 00152 { 00153 #ifdef DEBUG_BGQ 00154 printf( "L2UNIT_read\n" ); 00155 #endif 00156 ( void ) ctx; 00157 ( void ) flags; 00158 int i, numEvts; 00159 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00160 00161 numEvts = Bgpm_NumEvents( this_state->EventGroup ); 00162 if ( numEvts == 0 ) { 00163 #ifdef DEBUG_BGPM 00164 printf ("Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts ); 00165 #endif 00166 //return ( EXIT_FAILURE ); 00167 } 00168 00169 for ( i = 0; i < numEvts; i++ ) 00170 this_state->counters[i] = _common_getEventValue( i, this_state->EventGroup ); 00171 00172 *events = this_state->counters; 00173 00174 return ( PAPI_OK ); 00175 } 00176 00177 00178 /* 00179 * 00180 */ 00181 int 00182 L2UNIT_shutdown_thread( hwd_context_t * ctx ) 00183 { 00184 #ifdef DEBUG_BGQ 00185 printf( "L2UNIT_shutdown_thread\n" ); 00186 #endif 00187 00188 ( void ) ctx; 00189 return ( PAPI_OK ); 00190 } 00191 00192 00193 00194 00195 /* 00196 * user_signal_handler 00197 * 00198 * This function is used when hardware overflows are working or when 00199 * software overflows are forced 00200 */ 00201 void 00202 user_signal_handler_L2UNIT( int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext ) 00203 { 00204 #ifdef DEBUG_BGQ 00205 printf( "user_signal_handler_L2UNIT\n" ); 00206 #endif 00207 ( void ) address; 00208 int retval; 00209 unsigned i; 00210 int isHardware = 1; 00211 int cidx = _L2unit_vector.cmp_info.CmpIdx; 00212 long_long overflow_bit = 0; 00213 caddr_t address1; 00214 _papi_hwi_context_t ctx; 00215 ctx.ucontext = ( hwd_ucontext_t * ) pContext; 00216 ThreadInfo_t *thread = _papi_hwi_lookup_thread( 0 ); 00217 EventSetInfo_t *ESI; 00218 ESI = thread->running_eventset[cidx]; 00219 // Get the indices of all events which have overflowed. 00220 unsigned ovfIdxs[BGPM_MAX_OVERFLOW_EVENTS]; 00221 unsigned len = BGPM_MAX_OVERFLOW_EVENTS; 00222 00223 retval = Bgpm_GetOverflowEventIndices( hEvtSet, ovfVector, ovfIdxs, &len ); 00224 if ( retval < 0 ) { 00225 #ifdef DEBUG_BGPM 00226 printf ( "Error: ret value is %d for BGPM API function Bgpm_GetOverflowEventIndices.\n", 00227 retval ); 00228 #endif 00229 return; 00230 } 00231 00232 if ( thread == NULL ) { 00233 PAPIERROR( "thread == NULL in user_signal_handler!" ); 00234 return; 00235 } 00236 00237 if ( ESI == NULL ) { 00238 PAPIERROR( "ESI == NULL in user_signal_handler!"); 00239 return; 00240 } 00241 00242 if ( ESI->overflow.flags == 0 ) { 00243 PAPIERROR( "ESI->overflow.flags == 0 in user_signal_handler!"); 00244 return; 00245 } 00246 00247 for ( i = 0; i < len; i++ ) { 00248 uint64_t hProf; 00249 Bgpm_GetEventUser1( hEvtSet, ovfIdxs[i], &hProf ); 00250 if ( hProf ) { 00251 overflow_bit ^= 1 << ovfIdxs[i]; 00252 break; 00253 } 00254 00255 } 00256 00257 if ( ESI->overflow.flags & PAPI_OVERFLOW_FORCE_SW ) { 00258 #ifdef DEBUG_BGQ 00259 printf("OVERFLOW_SOFTWARE\n"); 00260 #endif 00261 address1 = GET_OVERFLOW_ADDRESS( ctx ); 00262 _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address1, NULL, 0, 0, &thread, cidx ); 00263 return; 00264 } 00265 else if ( ESI->overflow.flags & PAPI_OVERFLOW_HARDWARE ) { 00266 #ifdef DEBUG_BGQ 00267 printf("OVERFLOW_HARDWARE\n"); 00268 #endif 00269 address1 = GET_OVERFLOW_ADDRESS( ctx ); 00270 _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address1, &isHardware, overflow_bit, 0, &thread, cidx ); 00271 } 00272 else { 00273 #ifdef DEBUG_BGQ 00274 printf("OVERFLOW_NONE\n"); 00275 #endif 00276 PAPIERROR( "ESI->overflow.flags is set to something other than PAPI_OVERFLOW_HARDWARE or PAPI_OVERFLOW_FORCE_SW (%#x)", thread->running_eventset[cidx]->overflow.flags); 00277 } 00278 } 00279 00280 00281 /* 00282 * Set Overflow 00283 * 00284 * This is commented out in BG/L/P - need to explore and complete... 00285 * However, with true 64-bit counters in BG/Q and all counters for PAPI 00286 * always starting from a true zero (we don't allow write...), the possibility 00287 * for overflow is remote at best... 00288 */ 00289 int 00290 L2UNIT_set_overflow( EventSetInfo_t * ESI, int EventIndex, int threshold ) 00291 { 00292 #ifdef DEBUG_BGQ 00293 printf("BEGIN L2UNIT_set_overflow\n"); 00294 #endif 00295 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ESI->ctl_state; 00296 int retval; 00297 int evt_idx; 00298 00299 /* 00300 * In case an BGPM eventGroup HAS BEEN applied or attached before 00301 * overflow is set, delete the eventGroup and create an new empty one, 00302 * and rebuild as it was prior to deletion 00303 */ 00304 #ifdef DEBUG_BGQ 00305 printf( "L2UNIT_set_overflow: bgpm_eventset_applied = %d, threshold = %d\n", 00306 this_state->bgpm_eventset_applied, threshold ); 00307 #endif 00308 if ( 1 == this_state->bgpm_eventset_applied && 0 != threshold ) { 00309 retval = _common_deleteRecreate( &this_state->EventGroup ); 00310 if ( retval < 0 ) return retval; 00311 retval = _common_rebuildEventgroup( this_state->count, 00312 this_state->EventGroup_local, 00313 &this_state->EventGroup ); 00314 if ( retval < 0 ) return retval; 00315 00316 /* set BGPM eventGroup flag back to NOT applied yet (0) 00317 * because the eventGroup has been recreated from scratch */ 00318 this_state->bgpm_eventset_applied = 0; 00319 } 00320 00321 evt_idx = ESI->EventInfoArray[EventIndex].pos[0]; 00322 SUBDBG( "Hardware counter %d (vs %d) used in overflow, threshold %d\n", 00323 evt_idx, EventIndex, threshold ); 00324 #ifdef DEBUG_BGQ 00325 printf( "Hardware counter %d (vs %d) used in overflow, threshold %d\n", 00326 evt_idx, EventIndex, threshold ); 00327 #endif 00328 /* If this counter isn't set to overflow, it's an error */ 00329 if ( threshold == 0 ) { 00330 /* Remove the signal handler */ 00331 retval = _papi_hwi_stop_signal( _L2unit_vector.cmp_info.hardware_intr_sig ); 00332 if ( retval != PAPI_OK ) 00333 return ( retval ); 00334 } 00335 else { 00336 this_state->overflow = 1; 00337 this_state->overflow_count++; 00338 this_state->overflow_list[this_state->overflow_count-1].threshold = threshold; 00339 this_state->overflow_list[this_state->overflow_count-1].EventIndex = evt_idx; 00340 00341 #ifdef DEBUG_BGQ 00342 printf( "L2UNIT_set_overflow: Enable the signal handler\n" ); 00343 #endif 00344 /* Enable the signal handler */ 00345 retval = _papi_hwi_start_signal( _L2unit_vector.cmp_info.hardware_intr_sig, 00346 NEED_CONTEXT, 00347 _L2unit_vector.cmp_info.CmpIdx ); 00348 if ( retval != PAPI_OK ) 00349 return ( retval ); 00350 00351 retval = _common_set_overflow_BGPM( this_state->EventGroup, 00352 this_state->overflow_list[this_state->overflow_count-1].EventIndex, 00353 this_state->overflow_list[this_state->overflow_count-1].threshold, 00354 user_signal_handler_L2UNIT ); 00355 if ( retval < 0 ) return retval; 00356 } 00357 00358 return ( PAPI_OK ); 00359 } 00360 00361 00362 00363 /* This function sets various options in the component 00364 * The valid codes being passed in are PAPI_SET_DEFDOM, 00365 * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT 00366 */ 00367 int 00368 L2UNIT_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option ) 00369 { 00370 #ifdef DEBUG_BGQ 00371 printf( "L2UNIT_ctl\n" ); 00372 #endif 00373 00374 ( void ) ctx; 00375 ( void ) code; 00376 ( void ) option; 00377 return ( PAPI_OK ); 00378 } 00379 00380 00381 /* 00382 * PAPI Cleanup Eventset 00383 * Destroy and re-create the BGPM / L2unit EventSet 00384 */ 00385 int 00386 L2UNIT_cleanup_eventset( hwd_control_state_t * ctrl ) 00387 { 00388 #ifdef DEBUG_BGQ 00389 printf( "L2UNIT_cleanup_eventset\n" ); 00390 #endif 00391 int retval; 00392 00393 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ctrl; 00394 00395 // create a new empty bgpm eventset 00396 // reason: bgpm doesn't permit to remove events from an eventset; 00397 // hence we delete the old eventset and create a new one 00398 retval = _common_deleteRecreate( &this_state->EventGroup ); 00399 if ( retval < 0 ) return retval; 00400 00401 // set overflow flag to OFF (0) 00402 this_state->overflow = 0; 00403 this_state->overflow_count = 0; 00404 // set BGPM eventGroup flag back to NOT applied yet (0) 00405 this_state->bgpm_eventset_applied = 0; 00406 00407 return ( PAPI_OK ); 00408 } 00409 00410 00411 /* 00412 * 00413 */ 00414 int 00415 L2UNIT_update_control_state( hwd_control_state_t * ptr, 00416 NativeInfo_t * native, int count, 00417 hwd_context_t * ctx ) 00418 { 00419 #ifdef DEBUG_BGQ 00420 printf( "L2UNIT_update_control_state: count = %d\n", count ); 00421 #endif 00422 00423 ( void ) ctx; 00424 int retval, index, i, k; 00425 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00426 00427 // Delete and re-create BGPM eventset 00428 retval = _common_deleteRecreate( &this_state->EventGroup ); 00429 if ( retval < 0 ) return retval; 00430 00431 #ifdef DEBUG_BGQ 00432 printf( "L2UNIT_update_control_state: EventGroup=%d, overflow = %d\n", 00433 this_state->EventGroup, this_state->overflow ); 00434 #endif 00435 00436 00437 // otherwise, add the events to the eventset 00438 for ( i = 0; i < count; i++ ) { 00439 index = ( native[i].ni_event ) + OFFSET; 00440 00441 native[i].ni_position = i; 00442 00443 #ifdef DEBUG_BGQ 00444 printf("L2UNIT_update_control_state: ADD event: i = %d, index = %d\n", i, index ); 00445 #endif 00446 00447 this_state->EventGroup_local[i] = index; 00448 00449 00450 /* Add events to the BGPM eventGroup */ 00451 retval = Bgpm_AddEvent( this_state->EventGroup, index ); 00452 retval = _check_BGPM_error( retval, "Bgpm_AddEvent" ); 00453 if ( retval < 0 ) return retval; 00454 } 00455 00456 // store how many events we added to an EventSet 00457 this_state->count = count; 00458 00459 // since update_control_state trashes overflow settings, this puts things 00460 // back into balance for BGPM 00461 if ( 1 == this_state->overflow ) { 00462 for ( k = 0; k < this_state->overflow_count; k++ ) { 00463 retval = _common_set_overflow_BGPM( this_state->EventGroup, 00464 this_state->overflow_list[k].EventIndex, 00465 this_state->overflow_list[k].threshold, 00466 user_signal_handler_L2UNIT ); 00467 if ( retval < 0 ) return retval; 00468 } 00469 } 00470 00471 return ( PAPI_OK ); 00472 } 00473 00474 00475 /* 00476 * This function has to set the bits needed to count different domains 00477 * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER 00478 * By default return PAPI_EINVAL if none of those are specified 00479 * and PAPI_OK with success 00480 * PAPI_DOM_USER is only user context is counted 00481 * PAPI_DOM_KERNEL is only the Kernel/OS context is counted 00482 * PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses) 00483 * PAPI_DOM_ALL is all of the domains 00484 */ 00485 int 00486 L2UNIT_set_domain( hwd_control_state_t * cntrl, int domain ) 00487 { 00488 #ifdef DEBUG_BGQ 00489 printf( "L2UNIT_set_domain\n" ); 00490 #endif 00491 int found = 0; 00492 ( void ) cntrl; 00493 00494 if ( PAPI_DOM_USER & domain ) 00495 found = 1; 00496 00497 if ( PAPI_DOM_KERNEL & domain ) 00498 found = 1; 00499 00500 if ( PAPI_DOM_OTHER & domain ) 00501 found = 1; 00502 00503 if ( !found ) 00504 return ( PAPI_EINVAL ); 00505 00506 return ( PAPI_OK ); 00507 } 00508 00509 00510 /* 00511 * 00512 */ 00513 int 00514 L2UNIT_reset( hwd_context_t * ctx, hwd_control_state_t * ptr ) 00515 { 00516 #ifdef DEBUG_BGQ 00517 printf( "L2UNIT_reset\n" ); 00518 #endif 00519 ( void ) ctx; 00520 int retval; 00521 L2UNIT_control_state_t * this_state = ( L2UNIT_control_state_t * ) ptr; 00522 00523 /* we can't simply call Bgpm_Reset() since PAPI doesn't have the 00524 restriction that an EventSet has to be stopped before resetting is 00525 possible. However, BGPM does have this restriction. 00526 Hence we need to stop, reset and start */ 00527 retval = Bgpm_Stop( this_state->EventGroup ); 00528 retval = _check_BGPM_error( retval, "Bgpm_Stop" ); 00529 if ( retval < 0 ) return retval; 00530 00531 retval = Bgpm_ResetStart( this_state->EventGroup ); 00532 retval = _check_BGPM_error( retval, "Bgpm_ResetStart" ); 00533 if ( retval < 0 ) return retval; 00534 00535 return ( PAPI_OK ); 00536 } 00537 00538 00539 /* 00540 * Native Event functions 00541 */ 00542 int 00543 L2UNIT_ntv_enum_events( unsigned int *EventCode, int modifier ) 00544 { 00545 #ifdef DEBUG_BGQ 00546 //printf( "L2UNIT_ntv_enum_events, EventCode = %#x\n", *EventCode ); 00547 #endif 00548 00549 switch ( modifier ) { 00550 case PAPI_ENUM_FIRST: 00551 *EventCode = 0; 00552 00553 return ( PAPI_OK ); 00554 break; 00555 00556 case PAPI_ENUM_EVENTS: 00557 { 00558 int index = ( *EventCode ) + OFFSET; 00559 00560 if ( index < L2UNIT_MAX_COUNTERS ) { 00561 *EventCode = *EventCode + 1; 00562 return ( PAPI_OK ); 00563 } else 00564 return ( PAPI_ENOEVNT ); 00565 00566 break; 00567 } 00568 default: 00569 return ( PAPI_EINVAL ); 00570 } 00571 return ( PAPI_EINVAL ); 00572 } 00573 00574 00575 /* 00576 * 00577 */ 00578 int 00579 L2UNIT_ntv_name_to_code( char *name, unsigned int *event_code ) 00580 { 00581 #ifdef DEBUG_BGQ 00582 printf( "L2UNIT_ntv_name_to_code\n" ); 00583 #endif 00584 int ret; 00585 00586 /* Return event id matching a given event label string */ 00587 ret = Bgpm_GetEventIdFromLabel ( name ); 00588 00589 if ( ret <= 0 ) { 00590 #ifdef DEBUG_BGPM 00591 printf ("Error: ret value is %d for BGPM API function '%s'.\n", 00592 ret, "Bgpm_GetEventIdFromLabel" ); 00593 #endif 00594 return PAPI_ENOEVNT; 00595 } 00596 else if ( ret < OFFSET || ret > L2UNIT_MAX_COUNTERS ) // not a L2Unit event 00597 return PAPI_ENOEVNT; 00598 else 00599 *event_code = ( ret - OFFSET ); 00600 00601 return PAPI_OK; 00602 } 00603 00604 00605 /* 00606 * 00607 */ 00608 int 00609 L2UNIT_ntv_code_to_name( unsigned int EventCode, char *name, int len ) 00610 { 00611 #ifdef DEBUG_BGQ 00612 //printf( "L2UNIT_ntv_code_to_name\n" ); 00613 #endif 00614 int index; 00615 00616 index = ( EventCode ) + OFFSET; 00617 00618 if ( index >= MAX_COUNTERS ) 00619 return PAPI_ENOEVNT; 00620 00621 strncpy( name, Bgpm_GetEventIdLabel( index ), len ); 00622 00623 if ( name == NULL ) { 00624 #ifdef DEBUG_BGPM 00625 printf ("Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" ); 00626 #endif 00627 return PAPI_ENOEVNT; 00628 } 00629 00630 return ( PAPI_OK ); 00631 } 00632 00633 00634 /* 00635 * 00636 */ 00637 int 00638 L2UNIT_ntv_code_to_descr( unsigned int EventCode, char *name, int len ) 00639 { 00640 #ifdef DEBUG_BGQ 00641 //printf( "L2UNIT_ntv_code_to_descr\n" ); 00642 #endif 00643 int retval, index; 00644 00645 index = ( EventCode ) + OFFSET; 00646 00647 retval = Bgpm_GetLongDesc( index, name, &len ); 00648 retval = _check_BGPM_error( retval, "Bgpm_GetLongDesc" ); 00649 if ( retval < 0 ) return retval; 00650 00651 return ( PAPI_OK ); 00652 } 00653 00654 00655 /* 00656 * 00657 */ 00658 int 00659 L2UNIT_ntv_code_to_bits( unsigned int EventCode, hwd_register_t * bits ) 00660 { 00661 #ifdef DEBUG_BGQ 00662 printf( "L2UNIT_ntv_code_to_bits\n" ); 00663 #endif 00664 ( void ) EventCode; 00665 ( void ) bits; 00666 return ( PAPI_OK ); 00667 } 00668 00669 00670 /* 00671 * 00672 */ 00673 papi_vector_t _L2unit_vector = { 00674 .cmp_info = { 00675 /* default component information (unspecified values are initialized to 0) */ 00676 .name = "bgpm/L2Unit", 00677 .short_name = "L2Unit", 00678 .description = "Blue Gene/Q L2Unit component", 00679 .num_cntrs = L2UNIT_MAX_COUNTERS, 00680 .num_mpx_cntrs = L2UNIT_MAX_COUNTERS, 00681 .default_domain = PAPI_DOM_USER, 00682 .available_domains = PAPI_DOM_USER | PAPI_DOM_KERNEL, 00683 .default_granularity = PAPI_GRN_THR, 00684 .available_granularities = PAPI_GRN_THR, 00685 00686 .hardware_intr_sig = PAPI_INT_SIGNAL, 00687 .hardware_intr = 1, 00688 00689 .kernel_multiplex = 0, 00690 00691 /* component specific cmp_info initializations */ 00692 .fast_real_timer = 0, 00693 .fast_virtual_timer = 0, 00694 .attach = 0, 00695 .attach_must_ptrace = 0, 00696 } 00697 , 00698 00699 /* sizes of framework-opaque component-private structures */ 00700 .size = { 00701 .context = sizeof ( L2UNIT_context_t ), 00702 .control_state = sizeof ( L2UNIT_control_state_t ), 00703 .reg_value = sizeof ( L2UNIT_register_t ), 00704 .reg_alloc = sizeof ( L2UNIT_reg_alloc_t ), 00705 } 00706 , 00707 /* function pointers in this component */ 00708 .init_thread = L2UNIT_init_thread, 00709 .init_component = L2UNIT_init_component, 00710 .init_control_state = L2UNIT_init_control_state, 00711 .start = L2UNIT_start, 00712 .stop = L2UNIT_stop, 00713 .read = L2UNIT_read, 00714 .shutdown_thread = L2UNIT_shutdown_thread, 00715 .set_overflow = L2UNIT_set_overflow, 00716 .cleanup_eventset = L2UNIT_cleanup_eventset, 00717 .ctl = L2UNIT_ctl, 00718 00719 .update_control_state = L2UNIT_update_control_state, 00720 .set_domain = L2UNIT_set_domain, 00721 .reset = L2UNIT_reset, 00722 00723 .ntv_name_to_code = L2UNIT_ntv_name_to_code, 00724 .ntv_enum_events = L2UNIT_ntv_enum_events, 00725 .ntv_code_to_name = L2UNIT_ntv_code_to_name, 00726 .ntv_code_to_descr = L2UNIT_ntv_code_to_descr, 00727 .ntv_code_to_bits = L2UNIT_ntv_code_to_bits 00728 };