---
name: "PAPI_get_overflow_event_index"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_get_overflow_event_index"
---

# PAPI\_get\_overflow\_event\_index(3)

converts an overflow vector into an array of indexes to overflowing events

## NAME

PAPI\_get\_overflow\_event\_index - converts an overflow vector into an array of indexes to overflowing events

## SYNOPSIS

## Detailed Description

**Parameters**

*EventSet* an integer handle to a PAPI event set as created by **PAPI\_create\_eventset** \
 *overflow\_vector* a vector with bits set for each counter that overflowed. This vector is passed by the system to the overflow handler routine. \
 *\*array* an array of indexes for events in EventSet. No more than \*number indexes will be stored into the array. \
 *\*number* On input the variable determines the size of the array. On output the variable contains the number of indexes in the array.

**Return values**

*PAPI\_EINVAL* One or more of the arguments is invalid. This could occur if the overflow\_vector is empty (zero), if the array or number pointers are NULL, if the value of number is less than one, or if the EventSet is empty. \
 *PAPI\_ENOEVST* The EventSet specified does not exist.

**Examples**

```
void handler(int EventSet, void *address, long_long overflow_vector, void *context){
int Events[4], number, i;
int total = 0, retval;
printf("Overflow #%d\n  Handler(%d) Overflow at %p! vector=%#llx\n",
total, EventSet, address, overflow_vector);
total++;
number = 4;
retval = PAPI_get_overflow_event_index(EventSet,
overflow_vector, Events, &number);
if(retval == PAPI_OK)
for(i=0; i<number; i++) printf("Event index[%d] = %d", i, Events[i]);}
```

**See also**

**PAPI\_overflow**

## Author

Generated automatically by Doxygen for PAPI from the source code.
