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 asPAPI_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 ofEventCode.
π¦ 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 onlibpfm4.
π 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 π
PAPIPAPIFPAPI_enum_cmp_eventPAPI_get_event_infoPAPI_event_name_to_codePAPI_presetPAPI_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
- 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