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, like PAPI_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 of EventCode. 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 presets
  • PAPI_PRESET_ENUM_MSC β€” Miscellaneous preset events
  • PAPI_PRESET_ENUM_INS β€” Instruction related preset events
  • PAPI_PRESET_ENUM_IDL β€” Stalled or Idle preset events
  • PAPI_PRESET_ENUM_BR β€” Branch related preset events
  • PAPI_PRESET_ENUM_CND β€” Conditional preset events
  • PAPI_PRESET_ENUM_MEM β€” Memory related preset events
  • PAPI_PRESET_ENUM_CACH β€” Cache related preset events
  • PAPI_PRESET_ENUM_L1 β€” L1 cache related preset events
  • PAPI_PRESET_ENUM_L2 β€” L2 cache related preset events
  • PAPI_PRESET_ENUM_L3 β€” L3 cache related preset events
  • PAPI_PRESET_ENUM_TLB β€” Translation Lookaside Buffer events
  • PAPI_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) events
  • PAPI_NTV_ENUM_DARR β€” Enumerate DAR (data address ranging) events
  • PAPI_NTV_ENUM_OPCM β€” Enumerate OPC (opcode matching) events
  • PAPI_NTV_ENUM_IEAR β€” Enumerate IEAR (instr event address register) events
  • PAPI_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 πŸ‘‘:

  • PAPI
  • PAPIF
  • PAPI_enum_event
  • PAPI_get_event_info
  • PAPI_event_name_to_code
  • PAPI_preset
  • PAPI_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