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_L2UNIT (int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext) |
| |
| int | L2UNIT_init_thread (hwd_context_t *ctx) |
| |
| int | L2UNIT_init_component (int cidx) |
| |
| int | L2UNIT_init_control_state (hwd_control_state_t *ptr) |
| |
| int | L2UNIT_start (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | L2UNIT_stop (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | L2UNIT_read (hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags) |
| |
| int | L2UNIT_shutdown_thread (hwd_context_t *ctx) |
| |
| int | L2UNIT_set_overflow (EventSetInfo_t *ESI, int EventIndex, int threshold) |
| |
| int | L2UNIT_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| |
| int | L2UNIT_cleanup_eventset (hwd_control_state_t *ctrl) |
| |
| int | L2UNIT_update_control_state (hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| |
| int | L2UNIT_set_domain (hwd_control_state_t *cntrl, int domain) |
| |
| int | L2UNIT_reset (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | L2UNIT_ntv_enum_events (unsigned int *EventCode, int modifier) |
| |
| int | L2UNIT_ntv_name_to_code (const char *name, unsigned int *event_code) |
| |
| int | L2UNIT_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| |
| int | L2UNIT_ntv_code_to_descr (unsigned int EventCode, char *name, int len) |
| |
| int | L2UNIT_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 / L2unit component
Tested version of bgpm (early access)
Definition in file linux-L2unit.c.
◆ L2UNIT_cleanup_eventset()
Definition at line 386 of file linux-L2unit.c.
389 printf(
"L2UNIT_cleanup_eventset\n" );
int _common_deleteRecreate(int *EventGroup_ptr)
int bgpm_eventset_applied
◆ L2UNIT_ctl()
◆ L2UNIT_init_component()
| int L2UNIT_init_component |
( |
int |
cidx | ) |
|
Definition at line 52 of file linux-L2unit.c.
55 printf(
"L2UNIT_init_component\n" );
60 printf(
"L2UNIT_init_component cidx = %d\n",
cidx );
PAPI_component_info_t cmp_info
papi_vector_t _L2unit_vector
◆ L2UNIT_init_control_state()
Definition at line 72 of file linux-L2unit.c.
75 printf(
"L2UNIT_init_control_state\n" );
81 this_state->
EventGroup = Bgpm_CreateEventSet();
int _check_BGPM_error(int err, char *bgpmfunc)
int bgpm_eventset_applied
◆ L2UNIT_init_thread()
Definition at line 36 of file linux-L2unit.c.
39 printf(
"L2UNIT_init_thread\n" );
◆ L2UNIT_ntv_code_to_bits()
| int L2UNIT_ntv_code_to_bits |
( |
unsigned int |
EventCode, |
|
|
hwd_register_t * |
bits |
|
) |
| |
Definition at line 659 of file linux-L2unit.c.
662 printf(
"L2UNIT_ntv_code_to_bits\n" );
◆ L2UNIT_ntv_code_to_descr()
| int L2UNIT_ntv_code_to_descr |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 638 of file linux-L2unit.c.
645 index = ( EventCode ) +
OFFSET;
647 retval = Bgpm_GetLongDesc( index,
name, &len );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ L2UNIT_ntv_code_to_name()
| int L2UNIT_ntv_code_to_name |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 609 of file linux-L2unit.c.
616 index = ( EventCode ) +
OFFSET;
621 strncpy(
name, Bgpm_GetEventIdLabel( index ), len );
623 if (
name == NULL ) {
625 printf (
"Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" );
◆ L2UNIT_ntv_enum_events()
| int L2UNIT_ntv_enum_events |
( |
unsigned int * |
EventCode, |
|
|
int |
modifier |
|
) |
| |
Definition at line 543 of file linux-L2unit.c.
549 switch ( modifier ) {
558 int index = ( *EventCode ) +
OFFSET;
561 *EventCode = *EventCode + 1;
#define L2UNIT_MAX_EVENTS
◆ L2UNIT_ntv_name_to_code()
| int L2UNIT_ntv_name_to_code |
( |
const char * |
name, |
|
|
unsigned int * |
event_code |
|
) |
| |
Definition at line 579 of file linux-L2unit.c.
582 printf(
"L2UNIT_ntv_name_to_code\n" );
587 ret = Bgpm_GetEventIdFromLabel (
name );
591 printf (
"Error: ret value is %d for BGPM API function '%s'.\n",
592 ret,
"Bgpm_GetEventIdFromLabel" );
#define L2UNIT_MAX_EVENTS
◆ L2UNIT_read()
Definition at line 150 of file linux-L2unit.c.
154 printf(
"L2UNIT_read\n" );
161 numEvts = Bgpm_NumEvents( this_state->
EventGroup );
162 if ( numEvts == 0 ) {
164 printf (
"Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
169 for (
i = 0;
i < numEvts;
i++ )
char events[MAX_EVENTS][BUFSIZ]
long_long _common_getEventValue(unsigned event_id, int EventGroup)
long long counters[L2UNIT_MAX_COUNTERS]
◆ L2UNIT_reset()
Definition at line 514 of file linux-L2unit.c.
517 printf(
"L2UNIT_reset\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ L2UNIT_set_domain()
◆ L2UNIT_set_overflow()
| int L2UNIT_set_overflow |
( |
EventSetInfo_t * |
ESI, |
|
|
int |
EventIndex, |
|
|
int |
threshold |
|
) |
| |
Definition at line 290 of file linux-L2unit.c.
293 printf(
"BEGIN L2UNIT_set_overflow\n");
305 printf(
"L2UNIT_set_overflow: bgpm_eventset_applied = %d, threshold = %d\n",
322 SUBDBG(
"Hardware counter %d (vs %d) used in overflow, threshold %d\n",
325 printf(
"Hardware counter %d (vs %d) used in overflow, threshold %d\n",
342 printf(
"L2UNIT_set_overflow: Enable the signal handler\n" );
L2UNIT_overflow_t overflow_list[512]
int _common_deleteRecreate(int *EventGroup_ptr)
PAPI_component_info_t cmp_info
int bgpm_eventset_applied
int _common_rebuildEventgroup(int count, int *EventGroup_local, int *EventGroup_ptr)
papi_vector_t _L2unit_vector
#define SUBDBG(format, args...)
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]
void user_signal_handler_L2UNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
hwd_control_state_t * ctl_state
int EventGroup_local[512]
◆ L2UNIT_shutdown_thread()
Definition at line 182 of file linux-L2unit.c.
185 printf(
"L2UNIT_shutdown_thread\n" );
◆ L2UNIT_start()
Definition at line 99 of file linux-L2unit.c.
102 printf(
"L2UNIT_start\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
int bgpm_eventset_applied
◆ L2UNIT_stop()
Definition at line 129 of file linux-L2unit.c.
132 printf(
"L2UNIT_stop\n" );
int _check_BGPM_error(int err, char *bgpmfunc)
◆ L2UNIT_update_control_state()
Definition at line 415 of file linux-L2unit.c.
420 printf(
"L2UNIT_update_control_state: count = %d\n",
count );
432 printf(
"L2UNIT_update_control_state: EventGroup=%d, overflow = %d\n",
444 printf(
"L2UNIT_update_control_state: ADD event: i = %d, index = %d\n",
i, index );
L2UNIT_overflow_t overflow_list[512]
int _common_deleteRecreate(int *EventGroup_ptr)
int _check_BGPM_error(int err, char *bgpmfunc)
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
void user_signal_handler_L2UNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
int EventGroup_local[512]
◆ user_signal_handler_L2UNIT()
| void user_signal_handler_L2UNIT |
( |
int |
hEvtSet, |
|
|
uint64_t |
address, |
|
|
uint64_t |
ovfVector, |
|
|
const ucontext_t * |
pContext |
|
) |
| |
Definition at line 202 of file linux-L2unit.c.
205 printf(
"user_signal_handler_L2UNIT\n" );
220 unsigned ovfIdxs[BGPM_MAX_OVERFLOW_EVENTS];
221 unsigned len = BGPM_MAX_OVERFLOW_EVENTS;
223 retval = Bgpm_GetOverflowEventIndices( hEvtSet, ovfVector, ovfIdxs, &len );
226 printf (
"Error: ret value is %d for BGPM API function Bgpm_GetOverflowEventIndices.\n",
233 PAPIERROR(
"thread == NULL in user_signal_handler!" );
238 PAPIERROR(
"ESI == NULL in user_signal_handler!");
243 PAPIERROR(
"ESI->overflow.flags == 0 in user_signal_handler!");
247 for (
i = 0;
i < len;
i++ ) {
249 Bgpm_GetEventUser1( hEvtSet, ovfIdxs[
i], &hProf );
251 overflow_bit ^= 1 << ovfIdxs[
i];
259 printf(
"OVERFLOW_SOFTWARE\n");
267 printf(
"OVERFLOW_HARDWARE\n");
274 printf(
"OVERFLOW_NONE\n");
276 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
papi_vector_t _L2unit_vector
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)
◆ _L2unit_vector