This file is part of 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.
|
int | _check_BGPM_error (int err, char *bgpmfunc) |
|
long_long | _common_getEventValue (unsigned event_id, int EventGroup) |
|
int | _common_deleteRecreate (int *EventGroup_ptr) |
|
int | _common_rebuildEventgroup (int count, int *EventGroup_local, int *EventGroup_ptr) |
|
int | _common_set_overflow_BGPM (int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *)) |
|
CVS: $Id$
- 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 component
Tested version of bgpm (early access)
Definition in file linux-bgq-common.c.
◆ _check_BGPM_error()
int _check_BGPM_error |
( |
int |
err, |
|
|
char * |
bgpmfunc |
|
) |
| |
Definition at line 27 of file linux-bgq-common.c.
28{
31
32 if ( err < 0 ) {
33 sprintf( buffer, "Error: ret value is %d for BGPM API function '%s'.",
34 err, bgpmfunc);
37 }
38
40}
◆ _common_deleteRecreate()
int _common_deleteRecreate |
( |
int * |
EventGroup_ptr | ) |
|
Definition at line 64 of file linux-bgq-common.c.
65{
66#ifdef DEBUG_BGQ
67 printf(
_AT_ " _common_deleteRecreate: *EventGroup_ptr=%d\n", *EventGroup_ptr);
68#endif
70
71
72 retval = Bgpm_DeleteEventSet( *EventGroup_ptr );
75
76
77 *EventGroup_ptr = Bgpm_CreateEventSet();
80
81#ifdef DEBUG_BGQ
82 printf(
_AT_ " _common_deleteRecreate: *EventGroup_ptr=%d\n", *EventGroup_ptr);
83#endif
85}
int _check_BGPM_error(int err, char *bgpmfunc)
◆ _common_getEventValue()
long_long _common_getEventValue |
( |
unsigned |
event_id, |
|
|
int |
EventGroup |
|
) |
| |
Definition at line 47 of file linux-bgq-common.c.
48{
49 uint64_t value;
51
52 retval = Bgpm_ReadEvent( EventGroup, event_id, &value );
55
57}
◆ _common_rebuildEventgroup()
int _common_rebuildEventgroup |
( |
int |
count, |
|
|
int * |
EventGroup_local, |
|
|
int * |
EventGroup_ptr |
|
) |
| |
Definition at line 92 of file linux-bgq-common.c.
93{
94#ifdef DEBUG_BGQ
95 printf( "_common_rebuildEventgroup\n" );
96#endif
98
99
101 retval = Bgpm_AddEvent( *EventGroup_ptr, EventGroup_local[
i] );
104
105#ifdef DEBUG_BGQ
106 printf( "_common_rebuildEventgroup: After emptying EventGroup, event re-added: %d\n",
107 EventGroup_local[
i] );
108#endif
109 }
111}
◆ _common_set_overflow_BGPM()
int _common_set_overflow_BGPM |
( |
int |
EventGroup, |
|
|
int |
evt_idx, |
|
|
int |
threshold, |
|
|
void(*)(int, uint64_t, uint64_t, const ucontext_t *) |
handler |
|
) |
| |
Definition at line 121 of file linux-bgq-common.c.
125{
127 uint64_t threshold_for_bgpm;
128
129
130
131 threshold_for_bgpm = BGPM_PERIOD2THRES(
threshold );
132
133#ifdef DEBUG_BGQ
134 printf("_common_set_overflow_BGPM\n");
135
137 int numEvts = Bgpm_NumEvents( EventGroup );
138 for (
i = 0;
i < numEvts;
i++ ) {
139 printf(
"_common_set_overflow_BGPM: %d = %s\n",
i, Bgpm_GetEventLabel( EventGroup,
i) );
140 }
141#endif
142
143
144 retval = Bgpm_SetOverflow( EventGroup,
145 evt_idx,
146 threshold_for_bgpm );
149
150 retval = Bgpm_SetEventUser1( EventGroup,
151 evt_idx,
152 1024 );
155
156
157 retval = Bgpm_SetOverflowHandler( EventGroup,
161
163}
void handler(int EventSet, void *address, long long overflow_vector, void *context)