papi_num_events(3) - Linux man page

Name

PAPI_num_events - return the number of events in an event set

Synopsis

C Interface
#include <papi.h>int PAPI_num_events(int EventSet);
Fortran Interface
#include "fpapi.h"PAPIF_num_events(C_INT EventSet, C_INT count)

Description

PAPI_num_events() returns the number of preset events contained in an event set. The event set should be created by papi_create_eventset(3).

Arguments

EventSet -- an integer handle for a PAPI event set as created by papi_create_eventset(3)

*count -- On output the variable contains the number of events in the event set.

Return Values

On success, this function returns the positive number of events in the event set. On error, a non-zero error code is returned.

Errors

PAPI_EINVAL
The event count is zero; only if code is compiled with debug enabled.
PAPI_ENOEVST
The EventSet specified does not exist.

Examples

/* Count the events in our EventSet */
printf("%d events found in EventSet.0, PAPI_num_events(EventSet));

Bugs

This function has no known bugs.

See Also

papi_add_event(3),papi_create_eventset(3),papi(3),papif(3)