PAPI_list_events(3)
π NAME π
Okay bestie, we're in the PAPI manual, and this specific page is PAPI_list_events(3). Its whole job? List the events in an event set. Periodt. π
β¨ SYNOPSIS β¨
πΈ Detailed Description πΈ
PAPI_list_events() returns an array of events and a count of the total number of events in an event set. This call assumes an initialized PAPI library and a successfully created event set. No cap.
π C Interface π
#include <papi.h>
int PAPI_list_events(int EventSet, int *Events, int *number);
π Parameters π
EventSetβ an integer handle for a PAPI event set as created byPAPI_create_eventset.*Eventsβ a pointer to a preallocated array of codes for events, such asPAPI_INT_INS. No more than*numbercodes will be stored into the array.*numberβ on input, the size of theEventsarray, or the maximum number of event codes to be returned. A value of0can be used to probe an event set. On output, the number of events actually in the event set. This value may be greater than the actually stored number of event codes.
π₯ Return values π₯
The page literally just drops these two names, so here they are in their full iconic glory:
PAPI_EINVALPAPI_ENOEVST
π¦ Examples π¦
Here's the example, kept exactly as the page has it:
if (PAPI_event_name_to_code("PAPI_TOT_INS",&EventCode) != PAPI_OK)
exit(1);
if (PAPI_add_event(EventSet, EventCode) != PAPI_OK)
exit(1);
Convert a second event name to an event code
if (PAPI_event_name_to_code("PAPI_L1_LDM",&EventCode) != PAPI_OK)
exit(1);
if (PAPI_add_event(EventSet, EventCode) != PAPI_OK)
exit(1);
number = 0;
if(PAPI_list_events(EventSet, NULL, &number))
exit(1);
if(number != 2)
exit(1);
if(PAPI_list_events(EventSet, Events, &number))
exit(1);
π See also π
PAPI_event_code_to_namePAPI_event_name_to_codePAPI_add_eventPAPI_create_eventset
π§ Fortran Interface π§
#include 'fpapi.h'
PAPI_list_events( C_INT EventSet, C_INT(*) Events, C_INT number,
C_INT check )
π See also π
PAPI_list_events
β Author β
Generated automatically by Doxygen for PAPI from the source code.
That's the whole vibe, bestie: generated automatically by Doxygen for PAPI from the source code, version 7.2.0.0, dated Wed Jun 25 2025 19:30:48. Slay and byeee π«Άβ¨
π¦ 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