PAPI_query_named_event(3)

✨ PAPI_query_named_event ✨

okay so this is the PAPI_query_named_event(3) page from the PAPI manual, and honestly? it's a little icon and it does exactly one job πŸ’…

πŸŽ€ NAME πŸŽ€

PAPI_query_named_event β€” query if a named PAPI event exists.

🌸 SYNOPSIS 🌸

Detailed Description

C Interface:

#include <papi.h>
int PAPI_query_named_event(const char *EventName);

PAPI_query_named_event() is literally just asking the PAPI library "hey bestie, can this PAPI named event 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 😭

and lowkey the extra cute part: you can also use this function to check the syntax of native and user events πŸ‘‘

Parameters

  • EventName β€” a defined event such as PAPI_TOT_INS. πŸ“

Return values

  • PAPI_EINVAL β€” one or more of the arguments is invalid.
  • PAPI_ENOEVNT β€” the PAPI preset is not available on the underlying hardware.

Examples

int retval;
// 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_named_event("PAPI_TOT_INS") != PAPI_OK) {
  fprintf(stderr,\"No instruction counter? How lame.\\n\");
  exit(1);
}

See also

PAPI_query_event 🌈


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for PAPI from the source code.


and that's the whole page, no cap 🧚 Version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, and yes the footer still says PAPI_query_named_event(3) because the vibes may change but the facts do not πŸ’– periodt ✨