This file has the source code for a component that enables PAPI-C to access hardware monitoring counters for BG/Q through the bgpm library.
More...
Go to the source code of this file.
|
| void | user_signal_handler_IOUNIT (int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext) |
| |
| int | IOUNIT_init_thread (hwd_context_t *ctx) |
| |
| int | IOUNIT_init_component (int cidx) |
| |
| int | IOUNIT_init_control_state (hwd_control_state_t *ptr) |
| |
| int | IOUNIT_start (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | IOUNIT_stop (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | IOUNIT_read (hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags) |
| |
| int | IOUNIT_shutdown_thread (hwd_context_t *ctx) |
| |
| int | IOUNIT_set_overflow (EventSetInfo_t *ESI, int EventIndex, int threshold) |
| |
| int | IOUNIT_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| |
| int | IOUNIT_update_control_state (hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| |
| int | IOUNIT_set_domain (hwd_control_state_t *cntrl, int domain) |
| |
| int | IOUNIT_reset (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | IOUNIT_cleanup_eventset (hwd_control_state_t *ctrl) |
| |
| 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_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| |
| int | IOUNIT_ntv_code_to_descr (unsigned int EventCode, char *name, int len) |
| |
| int | IOUNIT_ntv_code_to_bits (unsigned int EventCode, hwd_register_t *bits) |
| |
- Author
- Heike Jagode jagod.nosp@m.e@ee.nosp@m.cs.ut.nosp@m.k.ed.nosp@m.u Mods: < your name here > < your email address > BGPM / IOunit component
Tested version of bgpm (early access)
Definition in file linux-IOunit.c.
◆ IOUNIT_cleanup_eventset()
Definition at line 471 of file linux-IOunit.c.
474 printf(
"IOUNIT_cleanup_eventset\n" );
int _common_deleteRecreate(int *EventGroup_ptr)
◆ IOUNIT_ctl()
◆ IOUNIT_init_component()
| int IOUNIT_init_component |
( |
int |
cidx | ) |
|
Definition at line 52 of file linux-IOunit.c.
55 printf(
"IOUNIT_init_component\n" );
60 printf(
"IOUNIT_init_component cidx = %d\n",
cidx );
PAPI_component_info_t cmp_info
papi_vector_t _IOunit_vector
◆ IOUNIT_init_control_state()
Definition at line 72 of file linux-IOunit.c.
75 printf(
"IOUNIT_init_control_state\n" );
81 this_state->
EventGroup = Bgpm_CreateEventSet();
int _check_BGPM_error(int err, char *bgpmfunc)
◆ IOUNIT_init_thread()
Definition at line 36 of file linux-IOunit.c.
39 printf(
"IOUNIT_init_thread\n" );
◆ IOUNIT_ntv_code_to_bits()
| int IOUNIT_ntv_code_to_bits |
( |
unsigned int |
EventCode, |
|
|
hwd_register_t * |
bits |
|
) |
| |
Definition at line 614 of file linux-IOunit.c.
617 printf(
"IOUNIT_ntv_code_to_bits\n" );
◆ IOUNIT_ntv_code_to_descr()
| int IOUNIT_ntv_code_to_descr |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 593 of file linux-IOunit.c.
600 index = ( EventCode ) +
OFFSET;
602 retval = Bgpm_GetLongDesc( index,
name, &len );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ IOUNIT_ntv_code_to_name()
| int IOUNIT_ntv_code_to_name |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 564 of file linux-IOunit.c.
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" );
◆ IOUNIT_ntv_enum_events()
| int IOUNIT_ntv_enum_events |
( |
unsigned int * |
EventCode, |
|
|
int |
modifier |
|
) |
| |
Definition at line 498 of file linux-IOunit.c.
504 switch ( modifier ) {
513 int index = ( *EventCode ) +
OFFSET;
516 *EventCode = *EventCode + 1;
#define IOUNIT_MAX_EVENTS
◆ IOUNIT_ntv_name_to_code()
| int IOUNIT_ntv_name_to_code |
( |
const char * |
name, |
|
|
unsigned int * |
event_code |
|
) |
| |
Definition at line 534 of file linux-IOunit.c.
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" );
#define IOUNIT_MAX_EVENTS
◆ IOUNIT_read()
Definition at line 139 of file linux-IOunit.c.
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++ )
long long counts[IOUNIT_MAX_COUNTERS]
char events[MAX_EVENTS][BUFSIZ]
long_long _common_getEventValue(unsigned event_id, int EventGroup)
◆ IOUNIT_reset()
Definition at line 440 of file linux-IOunit.c.
443 printf(
"IOUNIT_reset\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ IOUNIT_set_domain()
◆ IOUNIT_set_overflow()
| int IOUNIT_set_overflow |
( |
EventSetInfo_t * |
ESI, |
|
|
int |
EventIndex, |
|
|
int |
threshold |
|
) |
| |
Definition at line 277 of file linux-IOunit.c.
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" );
PAPI_component_info_t cmp_info
#define SUBDBG(format, args...)
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
EventInfo_t * EventInfoArray
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
hwd_control_state_t * ctl_state
IOUNIT_overflow_t overflow_list[512]
papi_vector_t _IOunit_vector
◆ IOUNIT_shutdown_thread()
Definition at line 171 of file linux-IOunit.c.
174 printf(
"IOUNIT_shutdown_thread\n" );
◆ IOUNIT_start()
Definition at line 97 of file linux-IOunit.c.
100 printf(
"IOUNIT_start\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ IOUNIT_stop()
Definition at line 118 of file linux-IOunit.c.
121 printf(
"IOUNIT_stop\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ IOUNIT_update_control_state()
Definition at line 349 of file linux-IOunit.c.
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 );
int _common_deleteRecreate(int *EventGroup_ptr)
int _check_BGPM_error(int err, char *bgpmfunc)
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
IOUNIT_overflow_t overflow_list[512]
◆ user_signal_handler_IOUNIT()
| void user_signal_handler_IOUNIT |
( |
int |
hEvtSet, |
|
|
uint64_t |
address, |
|
|
uint64_t |
ovfVector, |
|
|
const ucontext_t * |
pContext |
|
) |
| |
Definition at line 189 of file linux-IOunit.c.
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);
PAPI_component_info_t cmp_info
EventSetOverflowInfo_t overflow
#define PAPI_OVERFLOW_HARDWARE
hwd_ucontext_t * ucontext
void PAPIERROR(char *format,...)
#define PAPI_OVERFLOW_FORCE_SW
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
#define GET_OVERFLOW_ADDRESS(ctx)
papi_vector_t _IOunit_vector
◆ _IOunit_vector