papi_cleanup_eventset(3) - Linux man page

Name

PAPI_destroy_eventset, PAPI_cleanup_eventset - empty and destroy

an EventSet

Synopsis

C Interface
#include <papi.h>int PAPI_cleanup_eventset(int EventSet);int PAPI_destroy_eventset(int
*EventSet);
Fortran Interface
#include "fpapi.h"PAPIF_cleanup_eventset(C_INT EventSet, C_INT check)PAPIF_destroy_eventset(C_INT EventSet, C_INT check)

Description

PAPI_cleanup_eventset() removes all events from a PAPI event set and turns off profiling and overflow for all events in the eventset. This can not be called if the EventSet is not stopped.

PAPI_destroy_eventset() deallocates the memory associated with an empty PAPI event set.

Arguments

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

*EventSet -- a pointer to the integer handle for a PAPI event set as created by papi_create_eventset(3). The value pointed to by EventSet is then set to PAPI_NULL on success.

Return Values

On success, this function returns
PAPI_OK. On error, a non-zero error code is returned.

Errors

PAPI_EINVAL
One or more of the arguments is invalid. Attempting to destroy a non-empty event set or passing in a null pointer to be destroyed.
PAPI_ENOEVST
The EventSet specified does not exist.
PAPI_EISRUN
The EventSet is currently counting events.
PAPI_EBUG
Internal error, send mail to ptools-perfapi@ptools.org and complain.

Examples

/* Remove all events in the eventset */
if (PAPI_cleanup_eventset(EventSet) != PAPI_OK)
  handle_error(1);
/* Free all memory and data structures, EventSet must be empty. */
if (PAPI_destroy_eventset(&EventSet) != PAPI_OK)
  handle_error(1);

Bugs

If the user has set profile on an event with the PAPI_profil (3) call, then when destroying the EventSet the memory allocated by PAPI_profil (3) will not be freed. The user should turn off profiling on the Events before destroying the EventSet to prevent this behavior.

See Also

papi_create_eventset(3), papi_add_event(3), papi_stop(3), papi_profil(3)

Referenced By

papi_remove_events(3), papi_shutdown(3)