PAPI_event_code_to_name(3)
π NAME π
okay so bestie, welcome to the PAPI_event_code_to_name(3) manual page β this is the PAPI page where PAPI_event_code_to_name converts a numeric hardware event code to a name. β¨
π SYNOPSIS π
the C interface is literally right below in Detailed Description, bestie β keep scrolling π
π¦ DETAILED DESCRIPTION π¦
so hereβs the tea: PAPI_event_code_to_name is used to translate a 32-bit integer PAPI event code into an ASCII PAPI event name. Either Preset event codes or Native event codes can be passed to this routine. Native event codes and names differ from platform to platform. no cap π
π» C Interface:
#include <papi.h>
int PAPI_event_code_to_name( int EventCode, char * EventName );
πΈ Parameters
EventCodeβ the numeric code for the event. π*EventNameβ a string containing the event name as listed inPAPI_presetsor discussed inPAPI_native. π¦
β Return values
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 hardware event is not available on the underlying hardware.
π Examples:
int EventCode, EventSet = PAPI_NULL;
int Event, number;
char EventCodeStr[PAPI_MAX_STR_LEN];
// Create the EventSet
if ( PAPI_create_eventset( &EventSet ) != PAPI_OK )
handle_error( 1 );
// Add Total Instructions Executed to our EventSet
if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK )
handle_error( 1 );
number = 1;
if ( PAPI_list_events( EventSet, &Event, &number ) != PAPI_OK )
handle_error(1);
// Convert integer code to name string
if ( PAPI_event_code_to_name( Event, EventCodeStr ) != PAPI_OK )
handle_error( 1 );
printf( "Event Name: %s\n", EventCodeStr );
π See also
PAPI_event_name_to_codePAPI_remove_eventPAPI_get_event_infoPAPI_enum_eventPAPI_add_eventPAPI_presetsPAPI_native
π AUTHOR π
Generated automatically by Doxygen for PAPI from the source code.
thatβs the whole page, bestie π«Ά β mwah! This was PAPI version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, and the page is PAPI_event_code_to_name(3). 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