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 byPAPI_create_eventsetstatusβ an integer containing a boolean combination of one or more of the following nonzero constants as defined in the PAPI header filepapi.h:PAPI_STOPPEDβ EventSet is stoppedPAPI_RUNNINGβ EventSet is runningPAPI_PAUSEDβ EventSet temporarily disabled by the libraryPAPI_NOT_INITβ EventSet defined, but not initializedPAPI_OVERFLOWINGβ EventSet has overflowing enabledPAPI_PROFILINGβ EventSet has profiling enabledPAPI_MULTIPLEXINGβ EventSet has multiplexing enabledPAPI_ACCUMULATINGβ reserved for future usePAPI_HWPROFILINGβ reserved for future use
π Return values π
PAPI_OKPAPI_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. β
π¦ 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