PAPI_overflow(3) | PAPI | PAPI_overflow(3) |
PAPI_overflow -
Set up an event set to begin registering overflows.
PAPI_overflow() marks a specific EventCode in an EventSet to generate an overflow signal after every threshold events are counted. More than one event in an event set can be used to trigger overflows. In such cases, the user must call this function once for each overflowing event. To turn off overflow on a specified event, call this function with a threshold value of 0.
Overflows can be implemented in either software or hardware, but the scope is the entire event set. PAPI defaults to hardware overflow if it is available. In the case of software overflow, a periodic timer interrupt causes PAPI to compare the event counts against the threshold values and call the overflow handler if one or more events have exceeded their threshold. In the case of hardware overflow, the counters are typically set to the negative of the threshold value and count up to 0. This zero-crossing triggers a hardware interrupt that calls the overflow handler. Because of this counter interrupt, the counter values for overflowing counters may be very small or even negative numbers, and cannot be relied upon as accurate. In such cases the overflow handler can approximate the counts by supplying the threshold value whenever an overflow occurs.
_papi_overflow_handler() is a placeholder for a user-defined function to process overflow events. A pointer to this function is passed to the PAPI_overflow routine, where it is invoked whenever a software or hardware overflow occurs. This handler receives the EventSet of the overflowing event, the Program Counter address when the interrupt occurred, an overflow_vector that can be processed to determined which event(s) caused the overflow, and a pointer to the machine context, which can be used in a platform-specific manor to extract register information about what was happening when the overflow occurred.
C Interface:
(*PAPI_overflow_handler_t) _papi_overflow_handler (int EventSet, void *address, long_long overflow_vector, void *context );
Fortran Interface:
Parameters:
Return values:
Example
// Define a simple overflow handler: void handler(int EventSet, void *address, long_long overflow_vector, void *context) {
fprintf(stderr,
address,overflow_vector); } // Call PAPI_overflow for an EventSet containing PAPI_TOT_INS, // setting the threshold to 100000. Use the handler defined above. retval = PAPI_overflow(EventSet, PAPI_TOT_INS, 100000, 0, handler);
See Also:
Generated automatically by Doxygen for PAPI from the source code.
Mon Nov 14 2022 | Version 7.0.0.0 |