PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-IOunit.c File Reference

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...

Include dependency graph for linux-IOunit.c:

Go to the source code of this file.

Functions

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 (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)
 

Variables

papi_vector_t _IOunit_vector
 

Detailed Description

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.

Function Documentation

int IOUNIT_cleanup_eventset ( hwd_control_state_t ctrl)

Definition at line 471 of file linux-IOunit.c.

472 {
473 #ifdef DEBUG_BGQ
474  printf( "IOUNIT_cleanup_eventset\n" );
475 #endif
476  int retval;
477 
478  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ctrl;
479 
480  // create a new empty bgpm eventset
481  // reason: bgpm doesn't permit to remove events from an eventset;
482  // hence we delete the old eventset and create a new one
483  retval = _common_deleteRecreate( &this_state->EventGroup ); // HJ try to use delete() only
484  if ( retval < 0 ) return retval;
485 
486  // set overflow flag to OFF (0)
487  this_state->overflow = 0;
488  this_state->overflow_count = 0;
489 
490  return ( PAPI_OK );
491 }
int _common_deleteRecreate(int *EventGroup_ptr)
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_ctl ( hwd_context_t ctx,
int  code,
_papi_int_option_t option 
)

Definition at line 332 of file linux-IOunit.c.

333 {
334 #ifdef DEBUG_BGQ
335  printf( "IOUNIT_ctl\n" );
336 #endif
337 
338  ( void ) ctx;
339  ( void ) code;
340  ( void ) option;
341  return ( PAPI_OK );
342 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
int IOUNIT_init_component ( int  cidx)

Definition at line 52 of file linux-IOunit.c.

53 {
54 #ifdef DEBUG_BGQ
55  printf( "IOUNIT_init_component\n" );
56 #endif
57 
59 #ifdef DEBUG_BGQ
60  printf( "IOUNIT_init_component cidx = %d\n", cidx );
61 #endif
62 
63  return ( PAPI_OK );
64 }
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define printf
Definition: papi_test.h:125
static int cidx
Definition: event_info.c:40
papi_vector_t _IOunit_vector
Definition: linux-IOunit.c:23
int IOUNIT_init_control_state ( hwd_control_state_t ptr)

Definition at line 72 of file linux-IOunit.c.

73 {
74 #ifdef DEBUG_BGQ
75  printf( "IOUNIT_init_control_state\n" );
76 #endif
77  int retval;
78 
79  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
80 
81  this_state->EventGroup = Bgpm_CreateEventSet();
82  retval = _check_BGPM_error( this_state->EventGroup, "Bgpm_CreateEventSet" );
83  if ( retval < 0 ) return retval;
84 
85  // initialize overflow flag to OFF (0)
86  this_state->overflow = 0;
87  this_state->overflow_count = 0;
88 
89  return PAPI_OK;
90 }
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_init_thread ( hwd_context_t ctx)

Definition at line 36 of file linux-IOunit.c.

37 {
38 #ifdef DEBUG_BGQ
39  printf( "IOUNIT_init_thread\n" );
40 #endif
41 
42  ( void ) ctx;
43  return PAPI_OK;
44 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
int IOUNIT_ntv_code_to_bits ( unsigned int  EventCode,
hwd_register_t bits 
)

Definition at line 614 of file linux-IOunit.c.

615 {
616 #ifdef DEBUG_BGQ
617  printf( "IOUNIT_ntv_code_to_bits\n" );
618 #endif
619  ( void ) EventCode;
620  ( void ) bits;
621  return ( PAPI_OK );
622 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
int IOUNIT_ntv_code_to_descr ( unsigned int  EventCode,
char *  name,
int  len 
)

Definition at line 593 of file linux-IOunit.c.

594 {
595 #ifdef DEBUG_BGQ
596  //printf( "IOUNIT_ntv_code_to_descr\n" );
597 #endif
598  int retval, index;
599 
600  index = ( EventCode ) + OFFSET;
601 
602  retval = Bgpm_GetLongDesc( index, name, &len );
603  retval = _check_BGPM_error( retval, "Bgpm_GetLongDesc" );
604  if ( retval < 0 ) return retval;
605 
606  return ( PAPI_OK );
607 }
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
#define OFFSET
Definition: linux-CNKunit.h:36
char * name
Definition: iozone.c:23648
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_ntv_code_to_name ( unsigned int  EventCode,
char *  name,
int  len 
)

Definition at line 564 of file linux-IOunit.c.

565 {
566 #ifdef DEBUG_BGQ
567  //printf( "IOUNIT_ntv_code_to_name\n" );
568 #endif
569  int index;
570 
571  index = ( EventCode ) + OFFSET;
572 
573  if ( index >= MAX_COUNTERS )
574  return PAPI_ENOEVNT;
575 
576  strncpy( name, Bgpm_GetEventIdLabel( index ), len );
577 
578  if ( name == NULL ) {
579 #ifdef DEBUG_BGPM
580  printf ("Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" );
581 #endif
582  return PAPI_ENOEVNT;
583  }
584 
585  return ( PAPI_OK );
586 }
#define PAPI_ENOEVNT
Definition: papi.h:258
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
#define OFFSET
Definition: linux-CNKunit.h:36
char * name
Definition: iozone.c:23648
int IOUNIT_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 498 of file linux-IOunit.c.

499 {
500 #ifdef DEBUG_BGQ
501  //printf( "IOUNIT_ntv_enum_events\n" );
502 #endif
503 
504  switch ( modifier ) {
505  case PAPI_ENUM_FIRST:
506  *EventCode = 0;
507 
508  return ( PAPI_OK );
509  break;
510 
511  case PAPI_ENUM_EVENTS:
512  {
513  int index = ( *EventCode ) + OFFSET;
514 
515  if ( index < IOUNIT_MAX_EVENTS ) {
516  *EventCode = *EventCode + 1;
517  return ( PAPI_OK );
518  } else
519  return ( PAPI_ENOEVNT );
520 
521  break;
522  }
523  default:
524  return ( PAPI_EINVAL );
525  }
526  return ( PAPI_EINVAL );
527 }
#define PAPI_ENOEVNT
Definition: papi.h:258
return PAPI_OK
Definition: linux-nvml.c:458
#define IOUNIT_MAX_EVENTS
Definition: linux-IOunit.h:36
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define OFFSET
Definition: linux-CNKunit.h:36
int IOUNIT_ntv_name_to_code ( char *  name,
unsigned int event_code 
)

Definition at line 534 of file linux-IOunit.c.

535 {
536 #ifdef DEBUG_BGQ
537  printf( "IOUNIT_ntv_name_to_code\n" );
538 #endif
539  int ret;
540 
541  /* Return event id matching a given event label string */
542  ret = Bgpm_GetEventIdFromLabel ( name );
543 
544  if ( ret <= 0 ) {
545 #ifdef DEBUG_BGPM
546  printf ("Error: ret value is %d for BGPM API function '%s'.\n",
547  ret, "Bgpm_GetEventIdFromLabel" );
548 #endif
549  return PAPI_ENOEVNT;
550  }
551  else if ( ret < OFFSET || ret > IOUNIT_MAX_EVENTS ) // not an IOUnit event
552  return PAPI_ENOEVNT;
553  else
554  *event_code = ( ret - OFFSET ) ;
555 
556  return PAPI_OK;
557 }
#define PAPI_ENOEVNT
Definition: papi.h:258
return PAPI_OK
Definition: linux-nvml.c:458
#define IOUNIT_MAX_EVENTS
Definition: linux-IOunit.h:36
#define printf
Definition: papi_test.h:125
long long ret
Definition: iozone.c:1346
#define OFFSET
Definition: linux-CNKunit.h:36
char * name
Definition: iozone.c:23648
int IOUNIT_read ( hwd_context_t ctx,
hwd_control_state_t ptr,
long_long **  events,
int  flags 
)

Definition at line 139 of file linux-IOunit.c.

141 {
142 #ifdef DEBUG_BGQ
143  printf( "IOUNIT_read\n" );
144 #endif
145  ( void ) ctx;
146  ( void ) flags;
147  int i, numEvts;
148  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
149 
150  numEvts = Bgpm_NumEvents( this_state->EventGroup );
151  if ( numEvts == 0 ) {
152 #ifdef DEBUG_BGPM
153  printf ("Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
154 #endif
155  //return ( EXIT_FAILURE );
156  }
157 
158  for ( i = 0; i < numEvts; i++ )
159  this_state->counts[i] = _common_getEventValue( i, this_state->EventGroup );
160 
161  *events = this_state->counts;
162 
163  return ( PAPI_OK );
164 }
long long flags
Definition: iozone.c:12330
long long counts[IOUNIT_MAX_COUNTERS]
Definition: linux-IOunit.h:66
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
char events[MAX_EVENTS][BUFSIZ]
int i
Definition: fileop.c:140
long_long _common_getEventValue(unsigned event_id, int EventGroup)

Here is the call graph for this function:

int IOUNIT_reset ( hwd_context_t ctx,
hwd_control_state_t ptr 
)

Definition at line 440 of file linux-IOunit.c.

441 {
442 #ifdef DEBUG_BGQ
443  printf( "IOUNIT_reset\n" );
444 #endif
445  ( void ) ctx;
446  int retval;
447  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
448 
449  /* we can't simply call Bgpm_Reset() since PAPI doesn't have the
450  restriction that an EventSet has to be stopped before resetting is
451  possible. However, BGPM does have this restriction.
452  Hence we need to stop, reset and start */
453  retval = Bgpm_Stop( this_state->EventGroup );
454  retval = _check_BGPM_error( retval, "Bgpm_Stop" );
455  if ( retval < 0 ) return retval;
456 
457  retval = Bgpm_ResetStart( this_state->EventGroup );
458  retval = _check_BGPM_error( retval, "Bgpm_ResetStart" );
459  if ( retval < 0 ) return retval;
460 
461  return ( PAPI_OK );
462 }
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_set_domain ( hwd_control_state_t cntrl,
int  domain 
)

Definition at line 412 of file linux-IOunit.c.

413 {
414 #ifdef DEBUG_BGQ
415  printf( "IOUNIT_set_domain\n" );
416 #endif
417  int found = 0;
418  ( void ) cntrl;
419 
420  if ( PAPI_DOM_USER & domain )
421  found = 1;
422 
423  if ( PAPI_DOM_KERNEL & domain )
424  found = 1;
425 
426  if ( PAPI_DOM_OTHER & domain )
427  found = 1;
428 
429  if ( !found )
430  return ( PAPI_EINVAL );
431 
432  return ( PAPI_OK );
433 }
#define PAPI_DOM_KERNEL
Definition: papi.h:298
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_DOM_USER
Definition: papi.h:296
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
#define printf
Definition: papi_test.h:125
long long found
Definition: libasync.c:735
#define PAPI_DOM_OTHER
Definition: papi.h:299
int IOUNIT_set_overflow ( EventSetInfo_t ESI,
int  EventIndex,
int  threshold 
)

Definition at line 277 of file linux-IOunit.c.

278 {
279 #ifdef DEBUG_BGQ
280  printf("BEGIN IOUNIT_set_overflow\n");
281 #endif
282  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ESI->ctl_state;
283  int retval;
284  int evt_idx;
285 
286  evt_idx = ESI->EventInfoArray[EventIndex].pos[0];
287  SUBDBG( "Hardware counter %d (vs %d) used in overflow, threshold %d\n",
288  evt_idx, EventIndex, threshold );
289 #ifdef DEBUG_BGQ
290  printf( "Hardware counter %d (vs %d) used in overflow, threshold %d\n",
291  evt_idx, EventIndex, threshold );
292 #endif
293  /* If this counter isn't set to overflow, it's an error */
294  if ( threshold == 0 ) {
295  /* Remove the signal handler */
297  if ( retval != PAPI_OK )
298  return ( retval );
299  }
300  else {
301  this_state->overflow = 1;
302  this_state->overflow_count++;
303  this_state->overflow_list[this_state->overflow_count-1].threshold = threshold;
304  this_state->overflow_list[this_state->overflow_count-1].EventIndex = evt_idx;
305 
306 #ifdef DEBUG_BGQ
307  printf( "IOUNIT_set_overflow: Enable the signal handler\n" );
308 #endif
309  /* Enable the signal handler */
311  NEED_CONTEXT,
313  if ( retval != PAPI_OK )
314  return ( retval );
315 
317  this_state->overflow_list[this_state->overflow_count-1].EventIndex,
318  this_state->overflow_list[this_state->overflow_count-1].threshold,
320  if ( retval < 0 ) return retval;
321  }
322 
323  return ( PAPI_OK );
324 }
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define printf
Definition: papi_test.h:125
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int _papi_hwi_start_signal(int signal, int need_context, int cidx)
Definition: extras.c:401
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
Definition: linux-IOunit.c:189
int _papi_hwi_stop_signal(int signal)
Definition: extras.c:441
EventInfo_t * EventInfoArray
int threshold
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]
#define NEED_CONTEXT
Definition: papi_internal.h:97
hwd_control_state_t * ctl_state
ssize_t retval
Definition: libasync.c:338
IOUNIT_overflow_t overflow_list[512]
Definition: linux-IOunit.h:65
papi_vector_t _IOunit_vector
Definition: linux-IOunit.c:23

Here is the call graph for this function:

int IOUNIT_shutdown_thread ( hwd_context_t ctx)

Definition at line 171 of file linux-IOunit.c.

172 {
173 #ifdef DEBUG_BGQ
174  printf( "IOUNIT_shutdown_thread\n" );
175 #endif
176 
177  ( void ) ctx;
178  return ( PAPI_OK );
179 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
int IOUNIT_start ( hwd_context_t ctx,
hwd_control_state_t ptr 
)

Definition at line 97 of file linux-IOunit.c.

98 {
99 #ifdef DEBUG_BGQ
100  printf( "IOUNIT_start\n" );
101 #endif
102  ( void ) ctx;
103  int retval;
104  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
105 
106  retval = Bgpm_ResetStart( this_state->EventGroup );
107  retval = _check_BGPM_error( retval, "Bgpm_ResetStart" );
108  if ( retval < 0 ) return retval;
109 
110  return ( PAPI_OK );
111 }
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_stop ( hwd_context_t ctx,
hwd_control_state_t ptr 
)

Definition at line 118 of file linux-IOunit.c.

119 {
120 #ifdef DEBUG_BGQ
121  printf( "IOUNIT_stop\n" );
122 #endif
123  ( void ) ctx;
124  int retval;
125  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
126 
127  retval = Bgpm_Stop( this_state->EventGroup );
128  retval = _check_BGPM_error( retval, "Bgpm_Stop" );
129  if ( retval < 0 ) return retval;
130 
131  return ( PAPI_OK );
132 }
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

int IOUNIT_update_control_state ( hwd_control_state_t ptr,
NativeInfo_t native,
int  count,
hwd_context_t ctx 
)

Definition at line 349 of file linux-IOunit.c.

352 {
353 #ifdef DEBUG_BGQ
354  printf( "IOUNIT_update_control_state: count = %d\n", count );
355 #endif
356  ( void ) ctx;
357  int retval, index, i, k;
358  IOUNIT_control_state_t * this_state = ( IOUNIT_control_state_t * ) ptr;
359 
360  // Delete and re-create BGPM eventset
361  retval = _common_deleteRecreate( &this_state->EventGroup );
362  if ( retval < 0 ) return retval;
363 
364 #ifdef DEBUG_BGQ
365  printf( "IOUNIT_update_control_state: EventGroup=%d, overflow = %d\n",
366  this_state->EventGroup, this_state->overflow );
367 #endif
368 
369  // otherwise, add the events to the eventset
370  for ( i = 0; i < count; i++ ) {
371  index = ( native[i].ni_event ) + OFFSET;
372 
373  native[i].ni_position = i;
374 
375 #ifdef DEBUG_BGQ
376  printf("IOUNIT_update_control_state: ADD event: i = %d, index = %d\n", i, index );
377 #endif
378 
379  /* Add events to the BGPM eventGroup */
380  retval = Bgpm_AddEvent( this_state->EventGroup, index );
381  retval = _check_BGPM_error( retval, "Bgpm_AddEvent" );
382  if ( retval < 0 ) return retval;
383  }
384 
385  // since update_control_state trashes overflow settings, this puts things
386  // back into balance for BGPM
387  if ( 1 == this_state->overflow ) {
388  for ( k = 0; k < this_state->overflow_count; k++ ) {
389  retval = _common_set_overflow_BGPM( this_state->EventGroup,
390  this_state->overflow_list[k].EventIndex,
391  this_state->overflow_list[k].threshold,
393  if ( retval < 0 ) return retval;
394  }
395  }
396 
397  return ( PAPI_OK );
398 }
int _common_deleteRecreate(int *EventGroup_ptr)
int _check_BGPM_error(int err, char *bgpmfunc)
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
int k
Definition: iozone.c:19136
#define OFFSET
Definition: linux-CNKunit.h:36
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
Definition: linux-IOunit.c:189
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
ssize_t retval
Definition: libasync.c:338
IOUNIT_overflow_t overflow_list[512]
Definition: linux-IOunit.h:65

Here is the call graph for this function:

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.

190 {
191 #ifdef DEBUG_BGQ
192  printf( "user_signal_handler_IOUNIT\n" );
193 #endif
194  ( void ) address;
195  int retval;
196  unsigned i;
197  int isHardware = 1;
199  long_long overflow_bit = 0;
200  caddr_t address1;
202  ctx.ucontext = ( hwd_ucontext_t * ) pContext;
204  EventSetInfo_t *ESI;
205  ESI = thread->running_eventset[cidx];
206  // Get the indices of all events which have overflowed.
207  unsigned ovfIdxs[BGPM_MAX_OVERFLOW_EVENTS];
208  unsigned len = BGPM_MAX_OVERFLOW_EVENTS;
209 
210  retval = Bgpm_GetOverflowEventIndices( hEvtSet, ovfVector, ovfIdxs, &len );
211  if ( retval < 0 ) {
212 #ifdef DEBUG_BGPM
213  printf ( "Error: ret value is %d for BGPM API function Bgpm_GetOverflowEventIndices.\n",
214  retval );
215 #endif
216  return;
217  }
218 
219  if ( thread == NULL ) {
220  PAPIERROR( "thread == NULL in user_signal_handler!" );
221  return;
222  }
223 
224  if ( ESI == NULL ) {
225  PAPIERROR( "ESI == NULL in user_signal_handler!");
226  return;
227  }
228 
229  if ( ESI->overflow.flags == 0 ) {
230  PAPIERROR( "ESI->overflow.flags == 0 in user_signal_handler!");
231  return;
232  }
233 
234  for ( i = 0; i < len; i++ ) {
235  uint64_t hProf;
236  Bgpm_GetEventUser1( hEvtSet, ovfIdxs[i], &hProf );
237  if ( hProf ) {
238  overflow_bit ^= 1 << ovfIdxs[i];
239  break;
240  }
241 
242  }
243 
244  if ( ESI->overflow.flags & PAPI_OVERFLOW_FORCE_SW ) {
245 #ifdef DEBUG_BGQ
246  printf("OVERFLOW_SOFTWARE\n");
247 #endif
248  address1 = GET_OVERFLOW_ADDRESS( ctx );
249  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address1, NULL, 0, 0, &thread, cidx );
250  return;
251  }
252  else if ( ESI->overflow.flags & PAPI_OVERFLOW_HARDWARE ) {
253 #ifdef DEBUG_BGQ
254  printf("OVERFLOW_HARDWARE\n");
255 #endif
256  address1 = GET_OVERFLOW_ADDRESS( ctx );
257  _papi_hwi_dispatch_overflow_signal( ( void * ) &ctx, address1, &isHardware, overflow_bit, 0, &thread, cidx );
258  }
259  else {
260 #ifdef DEBUG_BGQ
261  printf("OVERFLOW_NONE\n");
262 #endif
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);
264  }
265 }
void
Definition: iozone.c:18627
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define printf
Definition: papi_test.h:125
int i
Definition: fileop.c:140
EventSetOverflowInfo_t overflow
#define PAPI_OVERFLOW_HARDWARE
Definition: papi.h:410
static int cidx
Definition: event_info.c:40
hwd_ucontext_t * ucontext
void * thread(void *arg)
Definition: kufrin.c:31
void PAPIERROR(char *format,...)
struct sigcontext hwd_ucontext_t
Definition: aix-context.h:10
#define PAPI_OVERFLOW_FORCE_SW
Definition: papi.h:409
EventSetInfo_t ** running_eventset
Definition: threads.h:30
#define long_long
Definition: papi.h:550
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
Definition: threads.h:92
int _papi_hwi_dispatch_overflow_signal(void *papiContext, caddr_t address, int *isHardware, long long overflow_bit, int genOverflowBit, ThreadInfo_t **t, int cidx)
Definition: extras.c:214
ssize_t retval
Definition: libasync.c:338
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12
papi_vector_t _IOunit_vector
Definition: linux-IOunit.c:23

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

papi_vector_t _IOunit_vector

Definition at line 23 of file linux-IOunit.c.