PAPI_event_name_to_code(3)
π NAME π
okay so bestie, welcome to the PAPI_event_name_to_code(3) page from the PAPI manual. the NAME tea is: PAPI_event_name_to_code β Convert a name to a numeric hardware event code. it's giving main character energy, no cap. π
β¨
β¨ SYNOPSIS β¨
the actual C interface is right below in Detailed Description, bestie β don't skip it, it's giving iconic. π«Ά
π DETAILED DESCRIPTION π
π» C Interface: π»
#include <papi.h>
int PAPI_event_name_to_code( const char * EventName, int * EventCode
);
okay so here's the tea: PAPI_event_name_to_code is used to translate an ASCII PAPI event name into an integer PAPI event code. literally that's the whole vibe. πΈ
π§Ύ Parameters π§Ύ
*EventCodeβ the numeric code for the event. π*EventNameβ a string containing the event name, as listed inPAPI_presetsor discussed inPAPI_native. no cap, that's the exact source of the name. π¦
π¦ 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_ENOINITβ the PAPI library has not been initialized. πPAPI_ENOEVNTβ the hardware event is not available on the underlying hardware. π«
π¬ Examples: π¬
bestie, here's the iconic example, copied exactly so you can trust it:
int EventCode, EventSet = PAPI_NULL;
// Convert to integer
if ( PAPI_event_name_to_code( "PAPI_TOT_INS", &EventCode ) != PAPI_OK )
handle_error( 1 );
// 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, EventCode ) != PAPI_OK )
handle_error( 1 );
π See also π
PAPI_event_code_to_namePAPI_remove_eventPAPI_get_event_infoPAPI_enum_eventPAPI_add_eventPAPI_add_named_eventPAPI_presetsPAPI_native
βοΈ AUTHOR βοΈ
not a human author, bestie β the author line says: Generated automatically by Doxygen for PAPI from the source code. π
π·οΈ VERSION π·οΈ
slay, this page is stamped Version 7.2.0.0 and dated Wed Jun 25 2025 19:30:48 β and it's the PAPI_event_name_to_code(3) manual page from PAPI. bye bestie, go convert those event names. π
β¨π
π¦ 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