PAPI_perror - Online Linux Manual PageSection : 3
Updated : September, 2004
Source : PAPI Programmer's Reference
Note : PAPI

NAMEPAPI_perror − convert PAPI error codes to strings, and print error message to stderr. PAPI_strerror − convert PAPI error codes to strings, and return the error string to user.

SYNOPSISC Interface #include <papi.h> int PAPI_perror(int code, char *destination, int length); char *PAPI_strerror(int code);Fortran Interface #include "fpapi.h" PAPIF_perror(C_INT code, C_STRING destination, C_INT check)

DESCRIPTIONPAPI_perror() fills the string destination with the error message corresponding to the error code code. The function copies length worth of the error description string corresponding to code into destination. The resulting string is always null terminated. If length is 0, then the string is printed on stderr. 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. This function is not implemented in Fortran.

ARGUMENTScode -- the error code to interpret *destination -- "the error message in quotes" length -- either 0 or strlen(destination)

RETURN VALUESOn success PAPI_perror() returns PAPI_OK." and PAPI_strerror() returns a non-NULL pointer.

ERRORSPAPI_EINVAL"  One or more of the arguments to PAPI_perror() is invalid. NULL"  The input error code to PAPI_strerror() is invalid.

EXAMPLEint EventSet = PAPI_NULL; int native = 0x0; char error_str[PAPI_MAX_STR_LEN]; if ((retval = PAPI_create_eventset(&EventSet)) != PAPI_OK) { fprintf(stderr, "PAPI error %d: %s\n",retval,PAPI_strerror(retval)); exit(1); } /* Add Total Instructions Executed to our EventSet */ if ((retval = PAPI_add_event(EventSet, PAPI_TOT_INS)) != PAPI_OK) { PAPI_perror(retval,error_str,PAPI_MAX_STR_LEN); fprintf(stderr,"PAPI_error %d: %s\n",retval,error_str); exit(1); } /* Start counting */ if ((retval = PAPI_start(EventSet)) != PAPI_OK) handle_error(retval);

BUGSThese functions have no known bugs.

SEE ALSOPAPI_set_debug(3)," PAPI_set_opt(3), PAPI_get_opt (3), PAPI_shutdown (3),"
0
Johanes Gumabo
Data Size   :   9,001 byte
man-PAPI_perror.3Build   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 257,462
Visitor ID   :     :  
Visitor IP   :   18.117.73.72   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_nr_x|149|PAPI_perror.3|83|\n",retval,PAPI_strerror(retval));| fprintf(stderr, "PAPI error %d: %s\\n",retval,PAPI_strerror(retval)); )         (rof_nr_x|149|PAPI_perror.3|92|\n",retval,error_str);| fprintf(stderr,"PAPI_error %d: %s\\n",retval,error_str); )