PAPI_set_opt(3)
πΈ NAME πΈ
PAPI_set_opt(3) β from the PAPI manual, bestie π β set PAPI library or event set options. That's the whole NAME, short and iconic, done π
β¨ SYNOPSIS β¨
#include <papi.h>
int PAPI_set_opt( int option, PAPI_option_t * ptr );
π Detailed Description π
π§ C Interface π§
Okay so here's the C interface again, because the manpage says so and we don't skip details in this house π:
#include <papi.h>
int PAPI_set_opt( int option, PAPI_option_t * ptr );
π Parameters π
optionβ defines the option to be set. The possible values are briefly described in the table below πptrβ pointer to a structure determined by the selected option. SeePAPI_option_tfor a description of possible structures.
π₯ Return values π₯
PAPI_OKβ no description in the original, just the name πPAPI_EINVALβ the specified option or parameter is invalid.PAPI_ENOEVSTβ the EventSet specified does not exist.PAPI_EISRUNβ the EventSet is currently counting events.PAPI_ECMPβ the option is not implemented for the current component.PAPI_ENOINITβ PAPI has not been initialized.PAPI_EINVAL_DOMβ invalid domain has been requested.
PAPI_set_opt() changes the options of the PAPI library or a specific EventSet created by PAPI_create_eventset. Some options may require that the EventSet be bound to a component before they can execute successfully. You can do that either by adding an event or by explicitly calling PAPI_assign_eventset_component. No cap, that binding step matters π
ptr is a pointer to the PAPI_option_t structure, which is actually a union of different structures for different options. Not all options require or return information in these structures. Each requires different values to be set. Some options require a component index to be provided. These options are handled implicitly through the option structures π«Ά
π Note π
Some options, such asPAPI_DOMAINandPAPI_MULTIPLEX, are also available as separate entry points in both C and Fortran. So yeah, iykyk β¨
The reader is encouraged to peruse the ctests code in the PAPI distribution for examples of usage of PAPI_set_opt. Go look, bestie β examples are free real estate π
π Possible values for the PAPI_set_opt option parameter π
PAPI_DEFDOMβ set default counting domain for newly created event sets. Requires a component index.PAPI_DEFGRNβ set default counting granularity. Requires a component index.PAPI_DEBUGβ set the PAPI debug state and the debug handler. The debug state is specified inptr->debug.level. The debug handler is specified inptr->debug.handler. For further information regarding debug states and the behavior of the handler, seePAPI_set_debug.PAPI_MULTIPLEXβ enable specified EventSet for multiplexing.PAPI_DEF_ITIMERβ set the type of itimer used in software multiplexing, overflowing and profiling.PAPI_DEF_MPX_NSβ set the sampling time slice in nanoseconds for multiplexing and overflow.PAPI_DEF_ITIMER_NSβ seePAPI_DEF_MPX_NS.PAPI_ATTACHβ attach EventSet specified inptr->attach.eventsetto thread or process id specified inptr->attach.tid.PAPI_CPU_ATTACHβ attach EventSet specified inptr->cpu.eventsetto cpu specified inptr->cpu.cpu_num.PAPI_DETACHβ detach EventSet specified inptr->attach.eventsetfrom any thread or process id.PAPI_DOMAINβ set domain for EventSet specified inptr->domain.eventset. Will error if eventset is not bound to a component.PAPI_GRANULβ set granularity for EventSet specified inptr->granularity.eventset. Will error if eventset is not bound to a component.PAPI_INHERITβ enable or disable inheritance for specified EventSet.PAPI_DATA_ADDRESSβ set data address range to restrict event counting for EventSet specified inptr->addr.eventset. Starting and ending addresses are specified inptr->addr.startandptr->addr.end, respectively. If exact addresses cannot be instantiated, offsets are returned inptr->addr.start_offandptr->addr.end_off. Currently implemented on Itanium only.PAPI_INSTR_ADDRESSβ set instruction address range as described above. Itanium only.
π¦ See also π¦
PAPI_set_debugPAPI_set_multiplexPAPI_set_domainPAPI_option_t
π Author π
Generated automatically by Doxygen for PAPI from the source code. So not a human author, just Doxygen doing its thing π€π
Okay bestie, that's the whole PAPI_set_opt(3) page! π It's from PAPI version 7.2.0.0, dated Wed Jun 25 2025 19:30:49, and yes, the footer says PAPI_set_opt(3). Bye bestie, go set those options and slay π«Άβ¨
π¦ 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