PAPI_state(3)

πŸ’– NAME πŸ’–

Okay so bestie, welcome to PAPI_state(3) β€” that's the manual page, and PAPI is the manual name, folded in right here so you don't have to squint at a header line. πŸ’… The NAME entry is literally PAPI_state - Return the counting state of an EventSet. No cap, that's the whole main character energy of this page: it highkey just returns the counting state of an EventSet. Lowkey iconic. That's it. That's the vibe. ✨

✨ SYNOPSIS ✨

πŸ’« Detailed Description πŸ’«

πŸŽ€ C Interface: πŸŽ€

#include <papi.h>
int PAPI_state( int  EventSet, int * status );

πŸŽ€ Parameters πŸŽ€

  • EventSet β€” an integer handle for a PAPI event set as created by PAPI_create_eventset
  • status β€” an integer containing a boolean combination of one or more of the following nonzero constants as defined in the PAPI header file papi.h:
    • PAPI_STOPPED β€” EventSet is stopped
    • PAPI_RUNNING β€” EventSet is running
    • PAPI_PAUSED β€” EventSet temporarily disabled by the library
    • PAPI_NOT_INIT β€” EventSet defined, but not initialized
    • PAPI_OVERFLOWING β€” EventSet has overflowing enabled
    • PAPI_PROFILING β€” EventSet has profiling enabled
    • PAPI_MULTIPLEXING β€” EventSet has multiplexing enabled
    • PAPI_ACCUMULATING β€” reserved for future use
    • PAPI_HWPROFILING β€” reserved for future use

πŸ’… Return values πŸ’…

  • PAPI_OK
  • PAPI_EINVAL β€” One or more of the arguments is invalid.
  • PAPI_ENOEVST β€” The EventSet specified does not exist.

PAPI_state() returns the counting state of the specified event set. Periodt, fr fr. πŸ’–

πŸ“ Example πŸ“

int EventSet = PAPI_NULL;
int status = 0;
int ret;

ret = PAPI_create_eventset(&EventSet);
if (ret != PAPI_OK) handle_error(ret);

// Add Total Instructions Executed to our EventSet
ret = PAPI_add_event(EventSet, PAPI_TOT_INS);
if (ret != PAPI_OK) handle_error(ret);

// Start counting
ret = PAPI_state(EventSet, &status);
if (ret != PAPI_OK) handle_error(ret);
printf("State is now %d\n",status);
ret = PAPI_start(EventSet);
if (ret != PAPI_OK) handle_error(ret);
ret = PAPI_state(EventSet, &status);
if (ret != PAPI_OK) handle_error(ret);
printf("State is now %d\n",status);

This example ate, honestly β€” setup, start, check, repeat. Obsessed. πŸ”₯

🌈 See also 🌈

PAPI_stop PAPI_start β€” your other faves, linked in the original as PAPI_stop PAPI_start. It's giving utility, and iykyk. 🫢

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for PAPI from the source code. Not me being auto-generated and still serving looks. ngl, iconic. 😭✨


That's the whole page, bestie! Version 7.2.0.0, dated Wed Jun 25 2025 19:30:49, from PAPI β€” slay, bye! πŸ’…πŸŽ€πŸ¦‹ Vibe check: passed. βœ