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 | NWUNIT_init_thread (hwd_context_t *ctx) |
| |
| int | NWUNIT_init_component (int cidx) |
| |
| int | NWUNIT_init_control_state (hwd_control_state_t *ptr) |
| |
| int | NWUNIT_start (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | NWUNIT_stop (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | NWUNIT_read (hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags) |
| |
| int | NWUNIT_shutdown_thread (hwd_context_t *ctx) |
| |
| int | NWUNIT_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| |
| int | NWUNIT_update_control_state (hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| |
| int | NWUNIT_set_domain (hwd_control_state_t *cntrl, int domain) |
| |
| int | NWUNIT_reset (hwd_context_t *ctx, hwd_control_state_t *ptr) |
| |
| int | NWUNIT_cleanup_eventset (hwd_control_state_t *ctrl) |
| |
| int | NWUNIT_ntv_enum_events (unsigned int *EventCode, int modifier) |
| |
| int | NWUNIT_ntv_name_to_code (const char *name, unsigned int *event_code) |
| |
| int | NWUNIT_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| |
| int | NWUNIT_ntv_code_to_descr (unsigned int EventCode, char *name, int len) |
| |
| int | NWUNIT_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 / NWunit component
Tested version of bgpm (early access)
Definition in file linux-NWunit.c.
◆ NWUNIT_cleanup_eventset()
Definition at line 310 of file linux-NWunit.c.
311{
312#ifdef DEBUG_BGQ
313 printf( "NWUNIT_cleanup_eventset\n" );
314#endif
316
318
319
320
321
324
326}
int _common_deleteRecreate(int *EventGroup_ptr)
◆ NWUNIT_ctl()
Definition at line 185 of file linux-NWunit.c.
186{
187#ifdef DEBUG_BGQ
188 printf( "NWUNIT_ctl\n" );
189#endif
190
191 ( void ) ctx;
192 ( void ) code;
193 ( void ) option;
195}
◆ NWUNIT_init_component()
| int NWUNIT_init_component |
( |
int |
cidx | ) |
|
Definition at line 49 of file linux-NWunit.c.
50{
51#ifdef DEBUG_BGQ
52 printf( "NWUNIT_init_component\n" );
53#endif
54
56#ifdef DEBUG_BGQ
57 printf(
"NWUNIT_init_component cidx = %d\n",
cidx );
58#endif
59
61}
papi_vector_t _NWunit_vector
PAPI_component_info_t cmp_info
◆ NWUNIT_init_control_state()
Definition at line 69 of file linux-NWunit.c.
70{
71#ifdef DEBUG_BGQ
72 printf( "NWUNIT_init_control_state\n" );
73#endif
75
77
78 this_state->
EventGroup = Bgpm_CreateEventSet();
81
83}
int _check_BGPM_error(int err, char *bgpmfunc)
◆ NWUNIT_init_thread()
Definition at line 33 of file linux-NWunit.c.
34{
35#ifdef DEBUG_BGQ
36 printf( "NWUNIT_init_thread\n" );
37#endif
38
39 ( void ) ctx;
41}
◆ NWUNIT_ntv_code_to_bits()
Definition at line 447 of file linux-NWunit.c.
448{
449#ifdef DEBUG_BGQ
450 printf( "NWUNIT_ntv_code_to_bits\n" );
451#endif
452 ( void ) EventCode;
453 ( void ) bits;
455}
◆ NWUNIT_ntv_code_to_descr()
| int NWUNIT_ntv_code_to_descr |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 426 of file linux-NWunit.c.
427{
428#ifdef DEBUG_BGQ
429
430#endif
432
433 index = ( EventCode ) +
OFFSET;
434
435 retval = Bgpm_GetLongDesc( index,
name, &len );
438
440}
◆ NWUNIT_ntv_code_to_name()
| int NWUNIT_ntv_code_to_name |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
Definition at line 397 of file linux-NWunit.c.
398{
399#ifdef DEBUG_BGQ
400
401#endif
402 int index;
403
404 index = ( EventCode ) +
OFFSET;
405
408
409 strncpy(
name, Bgpm_GetEventIdLabel( index ), len );
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}
◆ NWUNIT_ntv_enum_events()
| int NWUNIT_ntv_enum_events |
( |
unsigned int * |
EventCode, |
|
|
int |
modifier |
|
) |
| |
Definition at line 333 of file linux-NWunit.c.
334{
335
336
337 switch ( modifier ) {
339 *EventCode = 0;
340
342 break;
343
345 {
346 int index = ( *EventCode ) +
OFFSET;
347
349 *EventCode = *EventCode + 1;
351 } else
353
354 break;
355 }
356 default:
358 }
360}
#define NWUNIT_MAX_EVENTS
◆ NWUNIT_ntv_name_to_code()
| int NWUNIT_ntv_name_to_code |
( |
const char * |
name, |
|
|
unsigned int * |
event_code |
|
) |
| |
Definition at line 367 of file linux-NWunit.c.
368{
369#ifdef DEBUG_BGQ
370 printf( "NWUNIT_ntv_name_to_code\n" );
371#endif
372 int ret;
373
374
375 ret = Bgpm_GetEventIdFromLabel (
name );
376
377 if ( ret <= 0 ) {
378#ifdef DEBUG_BGPM
379 printf ("Error: ret value is %d for BGPM API function '%s'.\n",
380 ret, "Bgpm_GetEventIdFromLabel" );
381#endif
383 }
386 else
387 *event_code = ( ret -
OFFSET ) ;
388
390}
◆ NWUNIT_read()
Definition at line 137 of file linux-NWunit.c.
139{
140#ifdef DEBUG_BGQ
141 printf( "NWUNIT_read\n" );
142#endif
143 ( void ) ctx;
144 ( void ) flags;
147
148 numEvts = Bgpm_NumEvents( this_state->
EventGroup );
149 if ( numEvts == 0 ) {
150#ifdef DEBUG_BGPM
151 printf ("Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
152#endif
153
154 }
155
156 for (
i = 0;
i < numEvts;
i++ )
158
160
162}
char events[MAX_EVENTS][BUFSIZ]
long_long _common_getEventValue(unsigned event_id, int EventGroup)
long long counts[NWUNIT_MAX_COUNTERS]
◆ NWUNIT_reset()
Definition at line 279 of file linux-NWunit.c.
280{
281#ifdef DEBUG_BGQ
282 printf( "NWUNIT_reset\n" );
283#endif
284 ( void ) ctx;
287
288
289
290
291
295
299
301}
◆ NWUNIT_set_domain()
Definition at line 251 of file linux-NWunit.c.
252{
253#ifdef DEBUG_BGQ
254 printf( "NWUNIT_set_domain\n" );
255#endif
256 int found = 0;
257 ( void ) cntrl;
258
260 found = 1;
261
263 found = 1;
264
266 found = 1;
267
268 if ( !found )
270
272}
◆ NWUNIT_shutdown_thread()
Definition at line 169 of file linux-NWunit.c.
170{
171#ifdef DEBUG_BGQ
172 printf( "NWUNIT_shutdown_thread\n" );
173#endif
174
175 ( void ) ctx;
177}
◆ NWUNIT_start()
Definition at line 90 of file linux-NWunit.c.
91{
92#ifdef DEBUG_BGQ
93 printf( "NWUNIT_start\n" );
94#endif
95
96 ( void ) ctx;
99
103
107
109}
◆ NWUNIT_stop()
Definition at line 116 of file linux-NWunit.c.
117{
118#ifdef DEBUG_BGQ
119 printf( "NWUNIT_stop\n" );
120#endif
121 ( void ) ctx;
124
128
130}
◆ NWUNIT_update_control_state()
Definition at line 205 of file linux-NWunit.c.
208{
209#ifdef DEBUG_BGQ
210 printf(
"NWUNIT_update_control_state: count = %d\n",
count );
211#endif
212 ( void ) ctx;
215
216
219
220
223
225
226#ifdef DEBUG_BGQ
227 printf(
"NWUNIT_update_control_state: ADD event: i = %d, index = %d\n",
i, index );
228#endif
229
230
234 }
235
237}
◆ _NWunit_vector