PAPI_enum_event(3)

🌸 PAPI_enum_event(3) β€” the PAPI manual, bestie 🌸

πŸŽ€ NAME πŸŽ€

PAPI_enum_event β€” Enumerate PAPI preset or native events. πŸ’–

πŸ’… SYNOPSIS πŸ’…

πŸ’« Detailed Description πŸ’«

C Interface:

#include <papi.h>
int PAPI_enum_event( int * EventCode, int  modifer );

okay so picture this: you hand PAPI_enum_event a preset or native event code, and it replaces that event code with the next available event in either the preset table or the native table. lowkey magic, fr fr. ✨

The modifier argument affects which events are returned. For all platforms and event types, a value of PAPI_ENUM_ALL (zero) directs the function to return all possible events. no cap. 🫢

For preset events, a TRUE (non-zero) value currently directs the function to return event codes only for PAPI preset events available on this platform.

πŸ‘€ This may change in the future.

For native events, the effect of the modifier argument is different on each platform. See the discussion below for platform-specific definitions. iykyk. πŸ¦‹

🫢 Parameters 🫢

  • *EventCode β€” a defined preset or native event such as PAPI_TOT_INS.
  • modifier β€” modifies the search logic. See below for full list. For native events, each platform behaves differently. See platform-specific documentation for details.

😭 Return values 😭

  • PAPI_ENOEVNT β€” the next requested PAPI preset or native event is not available on the underlying hardware.

πŸ”₯ Examples πŸ”₯

okay so here's the example, and it's literally scanning all supported native events on this platform:

// Scan for all supported native events on this platform
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_event( &i, PAPI_ENUM_ALL ) == PAPI_OK );

🌈 Generic Modifiers 🌈

The following values are implemented for preset events:

  • PAPI_ENUM_EVENTS β€” Enumerate all (default). πŸ’«
  • PAPI_ENUM_FIRST β€” Enumerate first event (preset or native); preset/native chosen based on type of EventCode.

πŸ¦‹ 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.
  • PAPI_NTV_ENUM_UMASK_COMBOS β€” Given an event, iterate through all possible combinations of umasks. This is not implemented on libpfm4.

πŸ‘‘ Preset Modifiers πŸ‘‘

The following values are implemented for preset events:

  • PAPI_PRESET_ENUM_AVAIL β€” enumerate only available presets.
  • PAPI_PRESET_ENUM_CPU β€” enumerate CPU preset events.
  • PAPI_PRESET_ENUM_CPU_AVAIL β€” enumerate available CPU preset events.
  • PAPI_PRESET_ENUM_FIRST_COMP β€” enumerate first component preset event.

πŸ’œ See also πŸ’œ

  • PAPI
  • PAPIF
  • PAPI_enum_cmp_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.


πŸ’– That's the whole page, bestie! This lil icon is from PAPI version 7.2.0.0, dated Wed Jun 25 2025 19:30:48. slay and bye! πŸ’…βœ¨

πŸ“¦ where this page comes from