NAME
PAPI_query_event - query if PAPI event exists
CONTENTS
Synopsis
Description
Arguments
Return Values
Errors
Examples
Authors
Bugs
See Also
SYNOPSIS
C Interface
#include <papi.h>
int PAPI_query_event(int EventCode);
Fortran Interface
#include fpapi.h
PAPIF_query_event(C_INT EventCode, C_INT check)
DESCRIPTION
PAPI_query_event() asks the PAPI library if the PAPI Preset event can be counted on this
architecture. If the event CAN be counted, the function returns
PAPI_OK. If the event CANNOT be counted, the function returns an
error code. This function also can be used to
check the syntax of a native event.
ARGUMENTS
EventCode -- a defined event such as PAPI_TOT_INS.
RETURN VALUES
On success,
PAPI_query_event returns
PAPI_OK , and on error, a non-zero error code is returned.
ERRORS
PAPI_EINVAL | |
One or more of the arguments is invalid.
|
PAPI_ENOTPRESET | |
The hardware event specified is not a valid PAPI preset.
|
PAPI_ENOEVNT | |
The PAPI preset is not available on the underlying hardware.
|
|
EXAMPLES
int EventSet = PAPI_NULL;
unsigned int native = 0x0;
int retval,i;
PAPI_preset_info_t info;
PAPI_preset_info_t *infostructs;
/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT) {
fprintf(stderr,"PAPI library init error!\n");
exit(1); }
if (PAPI_query_event(PAPI_TOT_INS) != PAPI_OK) {
fprintf(stderr,"No instruction counter? How lame.\n");
exit(1);
}
AUTHORS
The PAPI Team. See them at the PAPI Web Site:
http://icl.cs.utk.edu/projects/papi
BUGS
These functions have no known bugs.
SEE ALSO
PAPI_preset (3),
PAPI_native (3),
PAPI_set_opt (3),
PAPI_start (3),
PAPI_remove_event (3),
PAPI_remove_events (3),
PAPI_cleanup_eventset (3),
PAPI_destroy_eventset (3),
PAPI Programmers Reference | PAPI_query_event (3) | November, 2003 |
|
|