PAPI_strerror(3)
β¨ NAME β¨
okay bestie, welcome to the PAPI_strerror(3) page β this is the one that tells you what a PAPI error code actually means. PAPI_strerror β Returns a string describing the PAPI error code. π
πΈ SYNOPSIS πΈ
bestie, this page goes straight into the Detailed Description next, so keep scrolling. no cap, thereβs no big synopsis block to memorize here. π«Ά
π Detailed Description π
π C Interface:
#include <papi.h>
char * PAPI_strerror( int errorCode );
π Parameters π
codeβ the error code to interpret
π Return values π
*errorβ a pointer to the error string.NULLβ the input error code toPAPI_strerror()is invalid.
So like, PAPI_strerror() returns a pointer to the error message corresponding to the error code code. If the call fails, the function returns the NULL pointer.
π¨ Fortran besties: this function is not implemented in Fortran.
π₯ Example: π₯
okay this example is giving βhandle your PAPI errors before chaosβ energy, so here it is exactly:
int ret;
int EventSet = PAPI_NULL;
int native = 0x0;
char error_str[PAPI_MAX_STR_LEN];
ret = PAPI_create_eventset(&EventSet);
if (ret != PAPI_OK)
{
fprintf(stderr, "PAPI error %d: %s\n", ret, PAPI_strerror(retval));
exit(1);
}
// Add Total Instructions Executed to our EventSet
ret = PAPI_add_event(EventSet, PAPI_TOT_INS);
if (ret != PAPI_OK)
{
PAPI_perror( "PAPI_add_event");
fprintf(stderr,"PAPI_error %d: %s\n", ret, error_str);
exit(1);
}
// Start counting
ret = PAPI_start(EventSet);
if (ret != PAPI_OK) handle_error(ret);
π See also π
the whole squad:
PAPI_perrorPAPI_set_optPAPI_get_optPAPI_shutdownPAPI_set_debug
π§ Author π§
Generated automatically by Doxygen for PAPI from the source code. (yes bestie, the robots wrote this one π€π)
kisses π β this page is from Version 7.2.0.0, dated Wed Jun 25 2025 19:30:49. PAPI_strerror(3) out. periodt. π«Ά
π¦ 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