PAPI_get_opt - Online Linux Manual PageSection : 3
Updated : October, 2006
Source : PAPI Programmer's Reference
Note : PAPI

NAME
 PAPI_get_opt − get PAPI library or event set options
 PAPI_get_cmp_opt − get component specific PAPI options
 PAPI_set_opt − set PAPI library or event set options
 PAPIF_get_clockrate − get the clockrate (Fortran only)
 PAPIF_get_domain − get the counting domain (Fortran only)
 PAPIF_get_granularity − get the counting granularity (Fortran only)
 PAPIF_get_preload − get the library preload setting (Fortran only)

SYNOPSISC Interface #include <papi.h> int PAPI_get_opt(int option, PAPI_option_t *ptr); int PAPI_get_cmp_opt(int option, PAPI_option_t *ptr, int cidx); int PAPI_set_opt(int option, PAPI_option_t *ptr);Fortran Interface #include "fpapi.h" PAPIF_get_clockrate(C_INT clockrate) PAPIF_get_domain(C_INT EventSet, C_INT domain, C_INT mode, C_INT check) PAPIF_get_granularity(C_INT EventSet, C_INT granularity, C_INT mode, C_INT check) PAPIF_get_preload(C_STRING preload, C_INT check)

DESCRIPTIONPAPI_get_opt() and PAPI_set_opt() query or change the options of the PAPI library or a specific event set created by "PAPI_create_eventset(3).Someoptionsmayrequirethattheeventsetbe bound to a component before they can execute successfully. This can be done either by adding an event or by explicitly calling "PAPI_assign_eventset_component(3). The C interface for these functions passes a pointer to the PAPI_option_t structure. Not all options require or return information in this structure, and not all options are implemented for both get and set. Some options require a component index to be provided. These options are handled explicitly by the PAPI_get_cmp_opt() call for 'get' and implicitly through the option structure for 'set'. The Fortran interface is a series of calls implementing various subsets of the C interface. Not all options in C are available in Fortran. NOTE: Some options, such as PAPI_DOMAIN and PAPI_MULTIPLEX, are also available as separate entry points in both C and Fortran. The reader is urged to see the example code in the PAPI distribution for usage of PAPI_get_opt. The file papi.h contains definitions for the structures unioned in the PAPI_option_t structure.

ARGUMENTSoption -- is an input parameter describing the course of action. Possible values are defined in papi.h and briefly described in the table below. The Fortran calls are implementations of specific options. ptr" -- is a pointer to a structure that acts as both an input and output parameter. It is defined in papi.h and below. cidx -- An integer identifier for a component. By convention, component 0 is always the cpu component. EventSet -- input; a reference to an EventSetInfo structure clockrate -- output; cycle time of this CPU in MHz; *may* be an estimate generated at init time with a quick timing routine domain -- output; execution domain for which events are counted granularity -- output; execution granularity for which events are counted mode -- input; determines if domain or granularity are default or for the current event set preload -- output; environment variable string for preloading libraries

OPTIONS TABLE.TS H allbox tab($); cB cB cI s lB lw(45). .TH Predefined name$Explanation General information requests PAPI_CLOCKRATE$T{ Get clockrate in MHz. T} PAPI_MAX_CPUS$T{ Get number of CPUs. T} PAPI_MAX_HWCTRS$T{ Get number of counters. Requires a component index. T} PAPI_EXEINFO$T{ Get Executable addresses for text/data/bss. T} PAPI_HWINFO$T{ Get information about the hardware. T} PAPI_SHLIBINFO$T{ Get shared library information used by the program. T} PAPI_COMPONENTINFO$T{ Get the PAPI features the specified component supports. Requires a component index. T} PAPI_LIB_VERSION$T{ Get the full PAPI version of the library T} PAPI_PRELOAD$T{ Get ``LD_PRELOAD'' environment equivalent. T} .T& cI s lB lw(45). Defaults for the global library PAPI_DEFDOM$T{ Get/Set default counting domain for newly created event sets. Requires a component index. T} PAPI_DEFGRN$T{ Get/Set default counting granularity. Requires a component index. T} PAPI_DEBUG$T{ Get/Set the PAPI debug state and the debug handler. The available debug states are defined in papi.h. The debug state is available in ptr->debug.level. The debug handler is available in ptr->debug.handler. For information regarding the behavior of the handler, please see the man page for PAPI_set_debug. T} .T& cI s lB lw(45). Multiplexing control PAPI_MULTIPLEX$T{ Get/Set options for multiplexing. T} PAPI_MAX_MPX_CTRS$T{ Get maximum number of multiplexing counters. Requires a component index. T} PAPI_DEF_MPX_USEC$T{ Get/Set the sampling time slice in microseconds for multiplexing. T} .T& cI s lB lw(45). Manipulating individual event sets PAPI_ATTACH$T{ Get thread or process id to which event set is attached. Returns TRUE if currently attached. Set event set specified in ptr->ptr->attach.eventset to be attached to thread or process id specified in in ptr->attach.tid T} PAPI_DETACH$T{ Get thread or process id to which event set is attached. Returns TRUE if currently detached. Set event set specified in ptr->ptr->attach.eventset to be detached from any thread or process id. T} PAPI_DOMAIN$T{ Get/Set domain for a single event set. The event set is specified in ptr->domain.eventset. Will error if eventset is not bound to a component. T} PAPI_GRANUL$T{ Get/Set granularity for a single event set. The event set is specified in ptr->granularity.eventset. Will error if eventset is not bound to a component. T} .T& cI s lB lw(45). Platform specific options PAPI_DATA_ADDRESS$T{ Set data address range to restrict event counting for event set specified in ptr->addr.eventset. Starting and ending addresses are specified in ptr->addr.start and ptr->addr.end, respectively. If exact addresses cannot be instantiated, offsets are returned in ptr->addr.start_off and ptr->addr.end_off. Currently implemented on Itanium only. T} PAPI_INSTR_ADDRESS$T{ Set instruction address range as described above. Itanium only. T} The option_t *ptr structure is defined in papi.h and looks something like the following example from the source tree. Users should use the definition in papi.h which is in synch with the library used. typedef union { PAPI_preload_option_t preload; PAPI_debug_option_t debug; PAPI_granularity_option_t granularity; PAPI_granularity_option_t defgranularity; PAPI_domain_option_t domain; PAPI_domain_option_t defdomain; PAPI_attach_option_t attach; PAPI_multiplex_option_t multiplex; PAPI_hw_info_t *hw_info; PAPI_shlib_info_t *shlib_info; PAPI_exe_info_t *exe_info; PAPI_component_info_t *sub_info; PAPI_overflow_option_t ovf_info; PAPI_addr_range_option_t addr; } PAPI_option_t;

RETURN VALUESOn success, these functions return PAPI_OK." On error, a non-zero error code is returned.

ERRORSPAPI_EINVAL"  One or more of the arguments is invalid. PAPI_ENOEVST"  The event set specified does not exist. PAPI_ENOCMP"  The argument cidx is not a valid component. PAPI_EISRUN"  The event set is currently counting events.

EXAMPLESPAPI_option_t options; if ((num = PAPI_get_cmp_opt(PAPI_MAX_HWCTRS,NULL,0)) <= 0) handle_error(); printf("This component has %d counters.\n",num); /* Set the domain of this EventSet to counter user and kernel modes for this process */ memset(&options,0x0,sizeof(options)); options.domain.eventset = EventSet; options.domain.domain = PAPI_DOM_ALL; if (PAPI_set_opt(PAPI_DOMAIN, &options) != PAPI_OK) handle_error();

BUGSThe granularity and domain functions are only implemented on some components. There are no known bugs in these functions.

SEE ALSOPAPI_set_debug(3), PAPI_set_multiplex (3), PAPI_set_domain (3)"
0
Johanes Gumabo
Data Size   :   19,188 byte
man-PAPIF_get_preload.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 170,631
Visitor ID   :     :  
Visitor IP   :   18.226.186.109   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_TS|11|PAPI_get_opt.3|103|2|.TS H )         (rof_TH|6|PAPI_get_opt.3|108|1|.TH )         (parse_manual_page_|249|PAPI_get_opt.3|140|T&|.T& )         (parse_manual_page_|249|PAPI_get_opt.3|158|T&|.T& )         (parse_manual_page_|249|PAPI_get_opt.3|172|T&|.T& )         (parse_manual_page_|249|PAPI_get_opt.3|197|T&|.T& )         (rof_nr_x|149|PAPI_get_opt.3|274|\n",num);|printf("This component has %d counters.\n",num); )