39 printf(
"IOUNIT_init_thread\n" );
55 printf(
"IOUNIT_init_component\n" );
60 printf(
"IOUNIT_init_component cidx = %d\n",
cidx );
75 printf(
"IOUNIT_init_control_state\n" );
81 this_state->
EventGroup = Bgpm_CreateEventSet();
100 printf(
"IOUNIT_start\n" );
121 printf(
"IOUNIT_stop\n" );
143 printf(
"IOUNIT_read\n" );
150 numEvts = Bgpm_NumEvents( this_state->
EventGroup );
151 if ( numEvts == 0 ) {
153 printf (
"Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
158 for (
i = 0;
i < numEvts;
i++ )
174 printf(
"IOUNIT_shutdown_thread\n" );
192 printf(
"user_signal_handler_IOUNIT\n" );
207 unsigned ovfIdxs[BGPM_MAX_OVERFLOW_EVENTS];
208 unsigned len = BGPM_MAX_OVERFLOW_EVENTS;
210 retval = Bgpm_GetOverflowEventIndices( hEvtSet, ovfVector, ovfIdxs, &len );
213 printf (
"Error: ret value is %d for BGPM API function Bgpm_GetOverflowEventIndices.\n",
220 PAPIERROR(
"thread == NULL in user_signal_handler!" );
225 PAPIERROR(
"ESI == NULL in user_signal_handler!");
230 PAPIERROR(
"ESI->overflow.flags == 0 in user_signal_handler!");
234 for (
i = 0;
i < len;
i++ ) {
236 Bgpm_GetEventUser1( hEvtSet, ovfIdxs[
i], &hProf );
238 overflow_bit ^= 1 << ovfIdxs[
i];
246 printf(
"OVERFLOW_SOFTWARE\n");
254 printf(
"OVERFLOW_HARDWARE\n");
261 printf(
"OVERFLOW_NONE\n");
263 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);
280 printf(
"BEGIN IOUNIT_set_overflow\n");
287 SUBDBG(
"Hardware counter %d (vs %d) used in overflow, threshold %d\n",
290 printf(
"Hardware counter %d (vs %d) used in overflow, threshold %d\n",
307 printf(
"IOUNIT_set_overflow: Enable the signal handler\n" );
335 printf(
"IOUNIT_ctl\n" );
354 printf(
"IOUNIT_update_control_state: count = %d\n",
count );
365 printf(
"IOUNIT_update_control_state: EventGroup=%d, overflow = %d\n",
376 printf(
"IOUNIT_update_control_state: ADD event: i = %d, index = %d\n",
i, index );
415 printf(
"IOUNIT_set_domain\n" );
443 printf(
"IOUNIT_reset\n" );
474 printf(
"IOUNIT_cleanup_eventset\n" );
504 switch ( modifier ) {
513 int index = ( *EventCode ) +
OFFSET;
516 *EventCode = *EventCode + 1;
537 printf(
"IOUNIT_ntv_name_to_code\n" );
542 ret = Bgpm_GetEventIdFromLabel (
name );
546 printf (
"Error: ret value is %d for BGPM API function '%s'.\n",
547 ret,
"Bgpm_GetEventIdFromLabel" );
554 *event_code = ( ret -
OFFSET ) ;
571 index = ( EventCode ) +
OFFSET;
576 strncpy(
name, Bgpm_GetEventIdLabel( index ), len );
578 if (
name == NULL ) {
580 printf (
"Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" );
600 index = ( EventCode ) +
OFFSET;
602 retval = Bgpm_GetLongDesc( index,
name, &len );
617 printf(
"IOUNIT_ntv_code_to_bits\n" );
631 .
name =
"bgpm/IOUnit",
632 .short_name =
"IOUnit",
633 .description =
"Blue Gene/Q IOUnit component",
645 .kernel_multiplex = 0,
648 .fast_real_timer = 0,
649 .fast_virtual_timer = 0,
651 .attach_must_ptrace = 0,
#define GET_OVERFLOW_ADDRESS(ctx)
#define PAPI_OVERFLOW_FORCE_SW
#define PAPI_OVERFLOW_HARDWARE
char events[MAX_EVENTS][BUFSIZ]
int IOUNIT_shutdown_thread(hwd_context_t *ctx)
int IOUNIT_ntv_code_to_bits(unsigned int EventCode, hwd_register_t *bits)
int IOUNIT_init_control_state(hwd_control_state_t *ptr)
int IOUNIT_stop(hwd_context_t *ctx, hwd_control_state_t *ptr)
papi_vector_t _IOunit_vector
int IOUNIT_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
int IOUNIT_read(hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags)
int IOUNIT_cleanup_eventset(hwd_control_state_t *ctrl)
int IOUNIT_ntv_code_to_name(unsigned int EventCode, char *name, int len)
int IOUNIT_start(hwd_context_t *ctx, hwd_control_state_t *ptr)
int IOUNIT_set_overflow(EventSetInfo_t *ESI, int EventIndex, int threshold)
int IOUNIT_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
int IOUNIT_reset(hwd_context_t *ctx, hwd_control_state_t *ptr)
int IOUNIT_init_thread(hwd_context_t *ctx)
int IOUNIT_ntv_enum_events(unsigned int *EventCode, int modifier)
int IOUNIT_ntv_name_to_code(const char *name, unsigned int *event_code)
int IOUNIT_set_domain(hwd_control_state_t *cntrl, int domain)
int IOUNIT_init_component(int cidx)
int IOUNIT_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
This file has the source code for a component that enables PAPI-C to access hardware monitoring count...
#define IOUNIT_MAX_EVENTS
#define IOUNIT_MAX_COUNTERS
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
int _common_deleteRecreate(int *EventGroup_ptr)
long_long _common_getEventValue(unsigned event_id, int EventGroup)
int _check_BGPM_error(int err, char *bgpmfunc)
#define SUBDBG(format, args...)
void PAPIERROR(char *format,...)
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
EventInfo_t * EventInfoArray
hwd_control_state_t * ctl_state
EventSetOverflowInfo_t overflow
long long counts[IOUNIT_MAX_COUNTERS]
IOUNIT_overflow_t overflow_list[512]
char name[PAPI_MAX_STR_LEN]
hwd_ucontext_t * ucontext
PAPI_component_info_t cmp_info
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)