PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-IOunit.c
Go to the documentation of this file.
1 /****************************/
2 /* THIS IS OPEN SOURCE CODE */
3 /****************************/
4 
20 #include "linux-IOunit.h"
21 
22 /* Declare our vector in advance */
24 
25 /* prototypes */
26 void user_signal_handler_IOUNIT( int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext );
27 
28 /*****************************************************************************
29  ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS *************
30  *****************************************************************************/
31 
32 /*
33  * This is called whenever a thread is initialized
34  */
35 int
37 {
38 #ifdef DEBUG_BGQ
39  printf( "IOUNIT_init_thread\n" );
40 #endif
41 
42  ( void ) ctx;
43  return PAPI_OK;
44 }
45 
46 
47 /* Initialize hardware counters, setup the function vector table
48  * and get hardware information, this routine is called when the
49  * PAPI process is initialized (IE PAPI_library_init)
50  */
51 int
53 {
54 #ifdef DEBUG_BGQ
55  printf( "IOUNIT_init_component\n" );
56 #endif
57 
58  _IOunit_vector.cmp_info.CmpIdx = cidx;
59 #ifdef DEBUG_BGQ
60  printf( "IOUNIT_init_component cidx = %d\n", cidx );
61 #endif
62 
63  return ( PAPI_OK );
64 }
65 
66 
67 /*
68  * Control of counters (Reading/Writing/Starting/Stopping/Setup)
69  * functions
70  */
71 int
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 }
91 
92 
93 /*
94  *
95  */
96 int
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 }
112 
113 
114 /*
115  *
116  */
117 int
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 }
133 
134 
135 /*
136  *
137  */
138 int
140  long_long ** events, int flags )
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 }
165 
166 
167 /*
168  *
169  */
170 int
172 {
173 #ifdef DEBUG_BGQ
174  printf( "IOUNIT_shutdown_thread\n" );
175 #endif
176 
177  ( void ) ctx;
178  return ( PAPI_OK );
179 }
180 
181 
182 /*
183  * user_signal_handler
184  *
185  * This function is used when hardware overflows are working or when
186  * software overflows are forced
187  */
188 void
189 user_signal_handler_IOUNIT( int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext )
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;
198  int cidx = _IOunit_vector.cmp_info.CmpIdx;
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 }
266 
267 
268 /*
269  * Set Overflow
270  *
271  * This is commented out in BG/L/P - need to explore and complete...
272  * However, with true 64-bit counters in BG/Q and all counters for PAPI
273  * always starting from a true zero (we don't allow write...), the possibility
274  * for overflow is remote at best...
275  */
276 int
277 IOUNIT_set_overflow( EventSetInfo_t * ESI, int EventIndex, int threshold )
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,
312  _IOunit_vector.cmp_info.CmpIdx );
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 }
325 
326 
327 /* This function sets various options in the component
328  * The valid codes being passed in are PAPI_SET_DEFDOM,
329  * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
330  */
331 int
332 IOUNIT_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option )
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 }
343 
344 
345 /*
346  *
347  */
348 int
350  NativeInfo_t * native, int count,
351  hwd_context_t * ctx )
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 }
399 
400 
401 /*
402  * This function has to set the bits needed to count different domains
403  * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER
404  * By default return PAPI_EINVAL if none of those are specified
405  * and PAPI_OK with success
406  * PAPI_DOM_USER is only user context is counted
407  * PAPI_DOM_KERNEL is only the Kernel/OS context is counted
408  * PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses)
409  * PAPI_DOM_ALL is all of the domains
410  */
411 int
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 }
434 
435 
436 /*
437  *
438  */
439 int
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 }
463 
464 
465 /*
466  * PAPI Cleanup Eventset
467  *
468  * Destroy and re-create the BGPM / IOunit EventSet
469  */
470 int
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 }
492 
493 
494 /*
495  * Native Event functions
496  */
497 int
498 IOUNIT_ntv_enum_events( unsigned int *EventCode, int modifier )
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_COUNTERS ) {
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 }
528 
529 
530 /*
531  *
532  */
533 int
534 IOUNIT_ntv_name_to_code( char *name, unsigned int *event_code )
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_COUNTERS ) // not an IOUnit event
552  return PAPI_ENOEVNT;
553  else
554  *event_code = ( ret - OFFSET ) ;
555 
556  return PAPI_OK;
557 }
558 
559 
560 /*
561  *
562  */
563 int
564 IOUNIT_ntv_code_to_name( unsigned int EventCode, char *name, int len )
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 }
587 
588 
589 /*
590  *
591  */
592 int
593 IOUNIT_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
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 }
608 
609 
610 /*
611  *
612  */
613 int
614 IOUNIT_ntv_code_to_bits( unsigned int EventCode, hwd_register_t * bits )
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 }
623 
624 
625 /*
626  *
627  */
628 papi_vector_t _IOunit_vector = {
629  .cmp_info = {
630  /* default component information (unspecified values are initialized to 0) */
631  .name = "bgpm/IOUnit",
632  .short_name = "IOUnit",
633  .description = "Blue Gene/Q IOUnit component",
634  .num_cntrs = IOUNIT_MAX_COUNTERS,
635  .num_mpx_cntrs = IOUNIT_MAX_COUNTERS,
636  .default_domain = PAPI_DOM_USER,
637  .available_domains = PAPI_DOM_USER | PAPI_DOM_KERNEL,
638  .default_granularity = PAPI_GRN_THR,
639  .available_granularities = PAPI_GRN_THR,
640 
641  .hardware_intr_sig = PAPI_INT_SIGNAL,
642  .hardware_intr = 1,
643 
644  .kernel_multiplex = 0,
645 
646  /* component specific cmp_info initializations */
647  .fast_real_timer = 0,
648  .fast_virtual_timer = 0,
649  .attach = 0,
650  .attach_must_ptrace = 0,
651  }
652  ,
653 
654  /* sizes of framework-opaque component-private structures */
655  .size = {
656  .context = sizeof ( IOUNIT_context_t ),
657  .control_state = sizeof ( IOUNIT_control_state_t ),
658  .reg_value = sizeof ( IOUNIT_register_t ),
659  .reg_alloc = sizeof ( IOUNIT_reg_alloc_t ),
660  }
661  ,
662  /* function pointers in this component */
663  .init_thread = IOUNIT_init_thread,
664  .init_component = IOUNIT_init_component,
665  .init_control_state = IOUNIT_init_control_state,
666  .start = IOUNIT_start,
667  .stop = IOUNIT_stop,
668  .read = IOUNIT_read,
669  .shutdown_thread = IOUNIT_shutdown_thread,
670  .set_overflow = IOUNIT_set_overflow,
671  .cleanup_eventset = IOUNIT_cleanup_eventset,
672  .ctl = IOUNIT_ctl,
673 
674  .update_control_state = IOUNIT_update_control_state,
675  .set_domain = IOUNIT_set_domain,
676  .reset = IOUNIT_reset,
677 
678  .ntv_name_to_code = IOUNIT_ntv_name_to_code,
679  .ntv_enum_events = IOUNIT_ntv_enum_events,
680  .ntv_code_to_name = IOUNIT_ntv_code_to_name,
681  .ntv_code_to_descr = IOUNIT_ntv_code_to_descr,
682  .ntv_code_to_bits = IOUNIT_ntv_code_to_bits
683 };
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:625
int IOUNIT_set_domain(hwd_control_state_t *cntrl, int domain)
Definition: linux-IOunit.c:412
long long flags
Definition: iozone.c:12330
long long counts[IOUNIT_MAX_COUNTERS]
Definition: linux-IOunit.h:65
int IOUNIT_ntv_code_to_bits(unsigned int EventCode, hwd_register_t *bits)
Definition: linux-IOunit.c:614
#define PAPI_ENOEVNT
Definition: fpapi.h:112
int _common_deleteRecreate(int *EventGroup_ptr)
int IOUNIT_init_thread(hwd_context_t *ctx)
Definition: linux-IOunit.c:36
int IOUNIT_ntv_enum_events(unsigned int *EventCode, int modifier)
Definition: linux-IOunit.c:498
int _check_BGPM_error(int err, char *bgpmfunc)
#define MAX_COUNTERS
Definition: perfctr-x86.h:8
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
#define PAPI_DOM_OTHER
Definition: fpapi.h:23
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
#define IOUNIT_MAX_COUNTERS
Definition: linux-IOunit.h:35
#define printf
Definition: papi_test.h:125
int IOUNIT_update_control_state(hwd_control_state_t *ptr, NativeInfo_t *native, int count, hwd_context_t *ctx)
Definition: linux-IOunit.c:349
int IOUNIT_shutdown_thread(hwd_context_t *ctx)
Definition: linux-IOunit.c:171
int IOUNIT_ntv_name_to_code(char *name, unsigned int *event_code)
Definition: linux-IOunit.c:534
long long ret
Definition: iozone.c:1346
int i
Definition: fileop.c:140
EventSetOverflowInfo_t overflow
#define PAPI_OVERFLOW_HARDWARE
Definition: papi.h:410
long long found
Definition: libasync.c:735
int k
Definition: iozone.c:19136
static int cidx
Definition: event_info.c:40
hwd_ucontext_t * ucontext
static int native
Definition: event_info.c:39
void * thread(void *arg)
Definition: kufrin.c:31
#define OFFSET
Definition: linux-CNKunit.h:36
int IOUNIT_read(hwd_context_t *ctx, hwd_control_state_t *ptr, long_long **events, int flags)
Definition: linux-IOunit.c:139
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
int IOUNIT_init_component(int cidx)
Definition: linux-IOunit.c:52
int _papi_hwi_start_signal(int signal, int need_context, int cidx)
Definition: extras.c:401
char events[MAX_EVENTS][BUFSIZ]
void user_signal_handler_IOUNIT(int hEvtSet, uint64_t address, uint64_t ovfVector, const ucontext_t *pContext)
Definition: linux-IOunit.c:189
long_long _common_getEventValue(unsigned event_id, int EventGroup)
#define PAPI_INT_SIGNAL
Definition: papi_internal.h:53
int _papi_hwi_stop_signal(int signal)
Definition: extras.c:441
EventInfo_t * EventInfoArray
int IOUNIT_ntv_code_to_name(unsigned int EventCode, char *name, int len)
Definition: linux-IOunit.c:564
int threshold
int IOUNIT_stop(hwd_context_t *ctx, hwd_control_state_t *ptr)
Definition: linux-IOunit.c:118
int _common_set_overflow_BGPM(int EventGroup, int evt_idx, int threshold, void(*handler)(int, uint64_t, uint64_t, const ucontext_t *))
int IOUNIT_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
Definition: linux-IOunit.c:593
int pos[PAPI_EVENTS_IN_DERIVED_EVENT]
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
char * name
Definition: iozone.c:23648
#define NEED_CONTEXT
Definition: papi_internal.h:97
int IOUNIT_init_control_state(hwd_control_state_t *ptr)
Definition: linux-IOunit.c:72
#define long_long
Definition: papi.h:549
inline_static ThreadInfo_t * _papi_hwi_lookup_thread(int custom_tid)
Definition: threads.h:92
int IOUNIT_cleanup_eventset(hwd_control_state_t *ctrl)
Definition: linux-IOunit.c:471
int IOUNIT_start(hwd_context_t *ctx, hwd_control_state_t *ptr)
Definition: linux-IOunit.c:97
This file has the source code for a component that enables PAPI-C to access hardware monitoring count...
int IOUNIT_reset(hwd_context_t *ctx, hwd_control_state_t *ptr)
Definition: linux-IOunit.c:440
#define PAPI_DOM_USER
Definition: fpapi.h:21
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
int IOUNIT_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: linux-IOunit.c:332
hwd_control_state_t * ctl_state
ssize_t retval
Definition: libasync.c:338
#define GET_OVERFLOW_ADDRESS(ctx)
Definition: aix-context.h:12
IOUNIT_overflow_t overflow_list[512]
Definition: linux-IOunit.h:64
#define PAPI_GRN_THR
Definition: fpapi.h:67
papi_vector_t _IOunit_vector
Definition: linux-IOunit.c:23
int IOUNIT_set_overflow(EventSetInfo_t *ESI, int EventIndex, int threshold)
Definition: linux-IOunit.c:277
char * ptr
Definition: iozone.c:23586