PAPI_query_event(3)
π NAME π
PAPI_query_event β the lil' vibe-check function that tells you whether a PAPI event actually exists. π
β¨ SYNOPSIS β¨
Detailed Description
C Interface:
#include <papi.h>
int PAPI_query_event(int EventCode);
Okay so bestie, here's the tea β: PAPI_query_event() slides into the PAPI library's DMs and asks whether a PAPI Preset event can actually be counted on this architecture. If the event CAN be counted, the function returns PAPI_OK β slay, we're so back. π If the event CANNOT be counted, you get an error code back instead. π This function can also be used to check the syntax of native and user events, which is lowkey iconic of it. π¦
Parameters
EventCodeβ a defined event, likePAPI_TOT_INS. Periodt. π
Return values
PAPI_EINVALβ one or more of the arguments is invalid. π not the invalid args!!PAPI_ENOEVNTβ the PAPI preset is not available on the underlying hardware. π genuinely giving "it's just not here" energy.
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_event(PAPI_TOT_INS) != PAPI_OK) {
fprintf(stderr,\"No instruction counter? How lame.\\n\");
exit(1);
}
fr fr, that error message speaks for all of us. "No instruction counter? How lame." is main character energy and honestly iconic. π₯
See also
PAPI_remove_eventPAPI_remove_eventsPAPI_presetsPAPI_native
πΈ Author πΈ
Generated automatically by Doxygen for PAPI from the source code. (Not me writing this by hand, bestie β the robots did it, and they ate. π€β¨)
Version 7.2.0.0 Β· Wed Jun 25 2025 19:30:48 β mwah, that's the whole page, drink some water and go count some events π«Άππ§
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms