PAPI_enum_cmp_event(3)
π PAPI_enum_cmp_event(3) π
ok so bestie, welcome to the PAPI_enum_cmp_event page (that's the man page name, bestie, don't come for me) β this is the <pink>PAPI</pink> girlie whose whole job is walking you through preset or native events for a given component. like a little event tour guide. slay.
β¨ NAME β¨
PAPI_enum_cmp_event β enumerate PAPI preset or native events for a given component. that's it, that's the vibe. π
β¨ SYNOPSIS β¨
Detailed Description
ok so here's the C interface, and yes we're including it exactly as it lives:
#include <papi.h>
int PAPI_enum_cmp_event( int *EventCode, int modifer, int cidx );
the way that this works is: you hand it an event code, and PAPI_enum_cmp_event swaps that event code out for the next available event. literally passing the aux, event-code style. π₯
the modifier argument is the one deciding which events come back to you. for all platforms and event types, a value of PAPI_ENUM_ALL (zero) tells the function "bestie, just give me all possible events." and likeβ¦ for native events, the modifier's effect may be different on each platform β no cap. see the discussion below for the platform-specific definitions. π
Parameters
*EventCodeβ a defined preset or native event, likePAPI_TOT_INS. that's your starting point, your main character event.modifierβ modifies the search logic. full list is below, keep scrolling π«Ά for native events, each platform behaves differently, so peep the platform-specific documentation for the deets.cidxβ specifies the component to search in. pick your component, queen.
Return values
PAPI_ENOEVNTβ the next requested PAPI preset or native event isn't available on the underlying hardware. so it's giving "we ran out", that's all. π
Examples
here's the iconic example, verbatim, don't touch:
// Scan for all supported native events on the first component
printf( "Name\t\t\t Code\t Description\n" );
do {
retval = PAPI_get_event_info( i, &info );
if ( retval == PAPI_OK ) {
printf( "%-30s %#-10x\n%s\n", info.symbol, info.event_code, info.long_descr );
}
} while ( PAPI_enum_cmp_event( &i, PAPI_ENUM_ALL, 0 ) == PAPI_OK );
β¨ Modifiers, aka the whole menu β¨
Generic Modifiers
The following values are implemented for preset events:
PAPI_ENUM_EVENTSβ enumerate all (default). the all-you-can-eat option πPAPI_ENUM_FIRSTβ enumerate first event (preset or native); preset/native chosen based on type ofEventCode. first come, first served, periodt.
Native Modifiers
The following values are implemented for native events:
PAPI_NTV_ENUM_UMASKSβ given an event, iterate through possible umasks one at a time. one baddie at a time π¦PAPI_NTV_ENUM_UMASK_COMBOSβ given an event, iterate through all possible combinations of umasks. not implemented on libpfm4 β so don't come crying to me when it doesn't work there, that's literally the documented situation.
Preset Modifiers
The following values are implemented for preset events:
PAPI_PRESET_ENUM_AVAILβ enumerate only available presetsPAPI_PRESET_ENUM_MSCβ Miscellaneous preset eventsPAPI_PRESET_ENUM_INSβ Instruction related preset eventsPAPI_PRESET_ENUM_IDLβ Stalled or Idle preset eventsPAPI_PRESET_ENUM_BRβ Branch related preset eventsPAPI_PRESET_ENUM_CNDβ Conditional preset eventsPAPI_PRESET_ENUM_MEMβ Memory related preset eventsPAPI_PRESET_ENUM_CACHβ Cache related preset eventsPAPI_PRESET_ENUM_L1β L1 cache related preset eventsPAPI_PRESET_ENUM_L2β L2 cache related preset eventsPAPI_PRESET_ENUM_L3β L3 cache related preset eventsPAPI_PRESET_ENUM_TLBβ Translation Lookaside Buffer eventsPAPI_PRESET_ENUM_FPβ Floating Point related preset events
ITANIUM Modifiers
The following values are implemented for modifier on Itanium:
PAPI_NTV_ENUM_IARRβ Enumerate IAR (instruction address ranging) eventsPAPI_NTV_ENUM_DARRβ Enumerate DAR (data address ranging) eventsPAPI_NTV_ENUM_OPCMβ Enumerate OPC (opcode matching) eventsPAPI_NTV_ENUM_IEARβ Enumerate IEAR (instr event address register) eventsPAPI_NTV_ENUM_DEARβ Enumerate DEAR (data event address register) events
POWER Modifiers
The following values are implemented for POWER:
PAPI_NTV_ENUM_GROUPSβ Enumerate groups to which an event belongs
β¨ See also β¨
go read these too, they're all linked up and lowkey important π:
PAPIPAPIFPAPI_enum_eventPAPI_get_event_infoPAPI_event_name_to_codePAPI_presetPAPI_native
β¨ Author β¨
Generated automatically by Doxygen for PAPI from the source code. so like, a robot wrote the original, and I'm just the messenger with better emoji game π
ok that's the whole page, bestie β you ate that. this was Version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, and yes we're closing out with the footer energy because the footer deserves its moment too. mwah π«Άπβ¨
π¦ 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms