PAPI_set_domain(3)
π¦ PAPI_set_domain(3) β PAPI manual, bestie π¦
β¨ NAME β¨
PAPI_set_domain β sets the default counting domain for new event sets bound to the cpu component. That's the assignment, and it understood it. π
πΈ SYNOPSIS πΈ
π« Detailed Description π«
π§ C Prototype:
#include <papi.h>
int PAPI_set_domain( int domain );
π Parameters
domain is one of the following constants, as defined in the papi.h header file β no cap:
PAPI_DOM_USERβ User context counted β¨PAPI_DOM_KERNELβ Kernel/OS context counted πPAPI_DOM_OTHERβ Exception/transient mode counted π¦PAPI_DOM_SUPERVISORβ Supervisor/hypervisor context counted πPAPI_DOM_ALLβ All above contexts counted πPAPI_DOM_MINβ The smallest available context πPAPI_DOM_MAXβ The largest available context π₯
π Return values
PAPI_OKβ a return value, no extra description attached in the original. β¨PAPI_EINVALβ One or more of the arguments is invalid. π
Okay so here's the tea: PAPI_set_domain sets the default counting domain for all new event sets created by PAPI_create_eventset in all threads. This call implicitly sets the domain for the cpu component (component 0), and it's included to preserve backward compatibility. Lowkey legacy, highkey still important. π«Ά
π Example:
int ret;
// Initialize the library
ret = PAPI_library_init(PAPI_VER_CURRENT);
if (ret > 0 && ret != PAPI_VER_CURRENT) {
fprintf(stderr,"PAPI library version mismatch!\n");
exit(1);
}
if (ret < 0) handle_error(ret);
// Set the default domain for the cpu component
ret = PAPI_set_domain(PAPI_DOM_KERNEL);
if (ret != PAPI_OK) handle_error(ret);
ret = PAPI_create_eventset(&EventSet);
if (ret != PAPI_OK) handle_error(ret);
π SEE ALSO π
PAPI_set_cmp_domainPAPI_set_granularityPAPI_set_optPAPI_get_opt
π AUTHOR π
The author line says it was generated automatically by Doxygen for PAPI from the source code. So yeah, Doxygen ate that one. π
Cute sign-off: this page is from PAPI version 7.2.0.0, dated Wed Jun 25 2025 19:30:49, and the footer also says PAPI_set_domain(3). Byeee, bestie β go set that domain! πβ¨π
π¦ 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