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.
|
| int | CNKUNIT_init_thread (hwd_context_t *ctx) |
| |
| int | CNKUNIT_init_component (int cidx) |
| |
| int | CNKUNIT_init_control_state (hwd_control_state_t *ptr) |
| |
| int | CNKUNIT_start (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | CNKUNIT_stop (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | CNKUNIT_read (hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags) |
| |
| int | CNKUNIT_shutdown_thread (hwd_context_t *ctx) |
| |
| int | CNKUNIT_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| |
| int | CNKUNIT_update_control_state (hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| |
| int | CNKUNIT_set_domain (hwd_control_state_t *cntrl, int domain) |
| |
| int | CNKUNIT_reset (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | CNKUNIT_cleanup_eventset (hwd_control_state_t *ctrl) |
| |
| int | CNKUNIT_ntv_enum_events (unsigned int *EventCode, int modifier) |
| |
| int | CNKUNIT_ntv_name_to_code (const char *name, unsigned int *event_code) |
| |
| int | CNKUNIT_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| |
| int | CNKUNIT_ntv_code_to_descr (unsigned int EventCode, char *name, int len) |
| |
| int | CNKUNIT_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 / CNKunit component
Tested version of bgpm (early access)
Definition in file linux-CNKunit.c.
◆ CNKUNIT_cleanup_eventset()
Definition at line 307 of file linux-CNKunit.c.
308{
309#ifdef DEBUG_BGQ
310 printf( "CNKUNIT_cleanup_eventset\n" );
311#endif
313
315
316
317
318
321
323}
int _common_deleteRecreate(int *EventGroup_ptr)
◆ CNKUNIT_ctl()
Definition at line 185 of file linux-CNKunit.c.
186{
187#ifdef DEBUG_BGQ
188 printf( "CNKUNIT_ctl\n" );
189#endif
190 ( void ) ctx;
191 ( void ) code;
192 ( void ) option;
194}
◆ CNKUNIT_init_component()
| int CNKUNIT_init_component |
( |
int |
cidx | ) |
|
Definition at line 49 of file linux-CNKunit.c.
50{
51#ifdef DEBUG_BGQ
52 printf( "CNKUNIT_init_component\n" );
53#endif
54
56#ifdef DEBUG_BGQ
57 printf(
"CNKUNIT_init_component cidx = %d\n",
cidx );
58#endif
59
61}
papi_vector_t _CNKunit_vector
PAPI_component_info_t cmp_info
◆ CNKUNIT_init_control_state()
Definition at line 69 of file linux-CNKunit.c.
70{
71#ifdef DEBUG_BGQ
72 printf( "CNKUNIT_init_control_state\n" );
73#endif
75
77
78 this_state->
EventGroup = Bgpm_CreateEventSet();
81
83}
int _check_BGPM_error(int err, char *bgpmfunc)
◆ CNKUNIT_init_thread()
Definition at line 33 of file linux-CNKunit.c.
34{
35#ifdef DEBUG_BGQ
36 printf( "CNKUNIT_init_thread\n" );
37#endif
38
39 ( void ) ctx;
41}
◆ CNKUNIT_ntv_code_to_bits()
Definition at line 447 of file linux-CNKunit.c.
448{
449#ifdef DEBUG_BGQ
450 printf( "CNKUNIT_ntv_code_to_bits\n" );
451#endif
452 ( void ) EventCode;
453 ( void ) bits;
455}
◆ CNKUNIT_ntv_code_to_descr()
| int CNKUNIT_ntv_code_to_descr |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 426 of file linux-CNKunit.c.
427{
428#ifdef DEBUG_BGQ
429
430#endif
432
433 index = ( EventCode ) +
OFFSET;
434
435 retval = Bgpm_GetLongDesc( index,
name, &len );
438
440}
◆ CNKUNIT_ntv_code_to_name()
| int CNKUNIT_ntv_code_to_name |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 396 of file linux-CNKunit.c.
397{
398#ifdef DEBUG_BGQ
399
400#endif
401 int index;
402
403 index = ( EventCode ) +
OFFSET;
404
407
408 strncpy(
name, Bgpm_GetEventIdLabel( index ), len );
409
410
411 if (
name == NULL ) {
412#ifdef DEBUG_BGPM
413 printf ("Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" );
414#endif
416 }
417
419}
◆ CNKUNIT_ntv_enum_events()
| int CNKUNIT_ntv_enum_events |
( |
unsigned int * |
EventCode, |
|
|
int |
modifier |
|
) |
| |
Definition at line 330 of file linux-CNKunit.c.
331{
332#ifdef DEBUG_BGQ
333
334#endif
335
336 switch ( modifier ) {
338 *EventCode = 0;
339
341 break;
342
344 {
345 int index = ( *EventCode ) +
OFFSET;
346
348 *EventCode = *EventCode + 1;
350 } else
352
353 break;
354 }
355 default:
357 }
359}
#define CNKUNIT_MAX_COUNTERS
◆ CNKUNIT_ntv_name_to_code()
| int CNKUNIT_ntv_name_to_code |
( |
const char * |
name, |
|
|
unsigned int * |
event_code |
|
) |
| |
Definition at line 366 of file linux-CNKunit.c.
367{
368#ifdef DEBUG_BGQ
369 printf( "CNKUNIT_ntv_name_to_code\n" );
370#endif
371 int ret;
372
373
374 ret = Bgpm_GetEventIdFromLabel (
name );
375
376 if ( ret <= 0 ) {
377#ifdef DEBUG_BGPM
378 printf ("Error: ret value is %d for BGPM API function '%s'.\n",
379 ret, "Bgpm_GetEventIdFromLabel" );
380#endif
382 }
385 else
386 *event_code = ( ret -
OFFSET ) ;
387
389}
◆ CNKUNIT_read()
Definition at line 138 of file linux-CNKunit.c.
140{
141#ifdef DEBUG_BGQ
142 printf( "CNKUNIT_read\n" );
143#endif
144 ( void ) ctx;
145 ( void ) flags;
148
149 numEvts = Bgpm_NumEvents( this_state->
EventGroup );
150 if ( numEvts == 0 ) {
151#ifdef DEBUG_BGPM
152 printf ("Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
153#endif
154
155 }
156
157 for (
i = 0;
i < numEvts;
i++ )
159
161
163}
char events[MAX_EVENTS][BUFSIZ]
long_long _common_getEventValue(unsigned event_id, int EventGroup)
long long counts[CNKUNIT_MAX_COUNTERS]
◆ CNKUNIT_reset()
Definition at line 276 of file linux-CNKunit.c.
277{
278#ifdef DEBUG_BGQ
279 printf( "CNKUNIT_reset\n" );
280#endif
281 ( void ) ctx;
284
285
286
287
288
292
296
298}
◆ CNKUNIT_set_domain()
Definition at line 248 of file linux-CNKunit.c.
249{
250#ifdef DEBUG_BGQ
251 printf( "CNKUNIT_set_domain\n" );
252#endif
253 int found = 0;
254 ( void ) cntrl;
255
257 found = 1;
258
260 found = 1;
261
263 found = 1;
264
265 if ( !found )
267
269}
◆ CNKUNIT_shutdown_thread()
Definition at line 170 of file linux-CNKunit.c.
171{
172#ifdef DEBUG_BGQ
173 printf( "CNKUNIT_shutdown_thread\n" );
174#endif
175 ( void ) ctx;
177}
◆ CNKUNIT_start()
Definition at line 90 of file linux-CNKunit.c.
91{
92#ifdef DEBUG_BGQ
93 printf( "CNKUNIT_start\n" );
94#endif
95 ( void ) ctx;
98
102
103
104
108
110}
◆ CNKUNIT_stop()
Definition at line 117 of file linux-CNKunit.c.
118{
119#ifdef DEBUG_BGQ
120 printf( "CNKUNIT_stop\n" );
121#endif
122 ( void ) ctx;
125
129
131}
◆ CNKUNIT_update_control_state()
Definition at line 202 of file linux-CNKunit.c.
205{
206#ifdef DEBUG_BGQ
207 printf(
"CNKUNIT_update_control_state: count = %d\n",
count );
208#endif
209 ( void ) ctx;
212
213
216
217
220
222
223#ifdef DEBUG_BGQ
224 printf(
"CNKUNIT_update_control_state: ADD event: i = %d, index = %d\n",
i, index );
225#endif
226
227
231 }
232
234}
◆ _CNKunit_vector