|
PAPI 7.1.0.0
|
This is the main implementation of the functionality needed to support SDEs in third party libraries. More...

Go to the source code of this file.
Macros | |
| #define | DLSYM_CHECK(name) |
| #define | _SDE_MODIFIER_COUNT 6 |
| #define | _SDE_CMP_MIN 0 |
| #define | _SDE_CMP_MAX 1 |
Variables | |
| papisde_control_t * | _papisde_global_control = NULL |
| int | papi_sde_version = PAPI_SDE_VERSION |
| pthread_mutex_t | _sde_hwd_lock_data |
Definition in file sde_lib.c.
| #define _SDE_MODIFIER_COUNT 6 |
| #define DLSYM_CHECK | ( | name | ) |
| __attribute__ | ( | (__common__) | ) |
|
inlinestatic |
Definition at line 72 of file sde_lib.c.


| int papi_sde_add_counter_to_group | ( | papi_handle_t | handle, |
| const char * | event_name, | ||
| const char * | group_name, | ||
| uint32_t | group_flags | ||
| ) |
This function adds an event counter to a group. A group is created automatically the first time a counter is added to it.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | group_name | – (const char *) name of the group. |
| [in] | group_flags | – (uint32_t) one of PAPI_SDE_SUM, PAPI_SDE_MAX, PAPI_SDE_MIN to define how the members of the group will be used to compute the group's value. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 449 of file sde_lib.c.


| int papi_sde_compare_double | ( | const void * | p1, |
| const void * | p2 | ||
| ) |
| int papi_sde_compare_float | ( | const void * | p1, |
| const void * | p2 | ||
| ) |
| int papi_sde_compare_int | ( | const void * | p1, |
| const void * | p2 | ||
| ) |
| int papi_sde_compare_long_long | ( | const void * | p1, |
| const void * | p2 | ||
| ) |
| int papi_sde_counting_set_insert | ( | void * | cset_handle, |
| size_t | element_size, | ||
| size_t | hashable_size, | ||
| const void * | element, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 766 of file sde_lib.c.


| int papi_sde_counting_set_remove | ( | void * | cset_handle, |
| size_t | hashable_size, | ||
| const void * | element, | ||
| uint32_t | type_id | ||
| ) |
Definition at line 737 of file sde_lib.c.


| int papi_sde_create_counter | ( | papi_handle_t | handle, |
| const char * | event_name, | ||
| int | cntr_mode, | ||
| void ** | cntr_handle | ||
| ) |
This function creates a counter whose memory is allocated and managed by libsde, in contrast with papi_sde_register_counter(), which works with counters that are managed by the user library that is calling this function. This counter can only by modified via the functions papi_sde_inc_counter() and papi_sde_reset_counter(). This has two benefits over a counter which lives inside the user library and is modified directly by that library: A) Our counter and the modifying API is guaranteed to be thread safe. B) Since libsde knows about each change in the value of the counter, overflowing is accurate. However, this approach has higher overhead than executing "my_cntr += value" inside a user library.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | event_name | – (const char *) name of the event. |
| [in] | cntr_mode | – (int) the mode of the counter (one of: PAPI_SDE_RO, PAPI_SDE_RW and one of: PAPI_SDE_DELTA, PAPI_SDE_INSTANT). |
| [out] | cntr_handle | – address of a pointer in which libsde will store a handle to the newly created counter. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 576 of file sde_lib.c.


| int papi_sde_create_counting_set | ( | papi_handle_t | handle, |
| const char * | cset_name, | ||
| void ** | cset_handle | ||
| ) |
Definition at line 682 of file sde_lib.c.


| int papi_sde_create_recorder | ( | papi_handle_t | handle, |
| const char * | event_name, | ||
| size_t | typesize, | ||
| int(*)(const void *p1, const void *p2) | cmpr_func_ptr, | ||
| void ** | record_handle | ||
| ) |
Definition at line 794 of file sde_lib.c.


| int papi_sde_describe_counter | ( | void * | handle, |
| const char * | event_name, | ||
| const char * | event_description | ||
| ) |
This function optionally replaces an event's default description with a description provided by the library developer within the SDE data structure attached to the handle.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | event_name | – (const char *) name of the event. |
| [in] | event_description | – (const char *) description of the event. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 398 of file sde_lib.c.

| int papi_sde_disable | ( | papi_handle_t | handle | ) |
This function disables SDE activity for a specific library, or for all libraries that use SDEs until papi_sde_enable() is called.
| [in] | handle | – (papi_handle_t) opaque pointer to sde structure for a specific library. If NULL then SDEs will be disabled at a global level. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 161 of file sde_lib.c.

| int papi_sde_enable | ( | papi_handle_t | handle | ) |
This function enables SDE activity for a specific library, or for all libraries that use SDEs.
| [in] | handle | – (papi_handle_t) opaque pointer to sde structure for a specific library. If NULL then SDEs will be enabled at a global level. Note that if SDEs for a specific library have been explicitly disabled, then they must be explicitly enabled passing that libary's handle. Calling papi_sde_enabled(NULL) will only enable SDEs at the global level. It will not recursivelly enable SDEs for individual libraries. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 189 of file sde_lib.c.

| void * papi_sde_get_counter_handle | ( | void * | handle, |
| const char * | event_name | ||
| ) |
This function finds the handle associated with a created counter, or a recorder, given the library handle and the event name.
| [in] | handle | – (void *) pointer to sde structure for an individual library |
| [in] | event_name | – name of the event |
Definition at line 1016 of file sde_lib.c.


| int papi_sde_inc_counter | ( | papi_handle_t | cntr_handle, |
| long long int | increment | ||
| ) |
Definition at line 637 of file sde_lib.c.


| papi_handle_t papi_sde_init | ( | const char * | name_of_library | ) |
This function initializes SDE internal data-structures for an individual software library and returns an opaque handle to these structures.
| [in] | name_of_library | – (const char *) library name. |
| [out] | sde_handle | – (papi_handle_t) opaque pointer to sde structure for initialized library. |
Definition at line 119 of file sde_lib.c.


Definition at line 909 of file sde_lib.c.


| int papi_sde_register_counter | ( | papi_handle_t | handle, |
| const char * | event_name, | ||
| int | cntr_mode, | ||
| int | cntr_type, | ||
| void * | counter | ||
| ) |
This function registers an event name and counter within the SDE data structure attached to the handle. A default description for an event is synthesized from the library name and the event name when they are registered.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | event_name | – (const char *) name of the event. |
| [in] | cntr_mode | – (int) the mode of the counter (one of: PAPI_SDE_RO, PAPI_SDE_RW and one of: PAPI_SDE_DELTA, PAPI_SDE_INSTANT). |
| [in] | cntr_type | – (int) the type of the counter (PAPI_SDE_long_long, PAPI_SDE_int, PAPI_SDE_double, PAPI_SDE_float). |
| [in] | counter | – pointer to a variable that stores the value for the event. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 276 of file sde_lib.c.


| int papi_sde_register_counter_cb | ( | papi_handle_t | handle, |
| const char * | event_name, | ||
| int | cntr_mode, | ||
| int | cntr_type, | ||
| papi_sde_fptr_t | callback, | ||
| void * | param | ||
| ) |
This function registers an event name and (caller provided) callback function within the SDE data structure attached to the handle. A default description for an event is synthesized from the library name and the event name when they are registered.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | event_name | – (const char *) name of the event. |
| [in] | cntr_mode | – (int) the mode of the counter (one of: PAPI_SDE_RO, PAPI_SDE_RW and one of: PAPI_SDE_DELTA, PAPI_SDE_INSTANT). |
| [in] | cntr_type | – (int) the type of the counter (PAPI_SDE_long_long, PAPI_SDE_int, PAPI_SDE_double, PAPI_SDE_float). |
| [in] | fp_counter | – pointer to a callback function that SDE will call when PAPI_read/stop/accum is called. |
| [in] | param | – (void *) opaque parameter that will be passed to the callback function every time it's called. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 312 of file sde_lib.c.


| int papi_sde_reset_counter | ( | void * | cntr_handle | ) |
Definition at line 973 of file sde_lib.c.

| int papi_sde_reset_recorder | ( | void * | record_handle | ) |
Definition at line 940 of file sde_lib.c.

| int papi_sde_shutdown | ( | papi_handle_t | handle | ) |
This function frees all SDE internal data-structures for an individual software library including all memory allocated by the counters of that library.
| [in] | handle | – (papi_handle_t) opaque pointer to sde structure for initialized library. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 212 of file sde_lib.c.


| int papi_sde_unregister_counter | ( | papi_handle_t | handle, |
| const char * | event_name | ||
| ) |
This function unregisters (removes) an event name and counter from the SDE data structures.
| [in] | handle | – pointer (of opaque type papi_handle_t) to sde structure for an individual library. |
| [in] | event_name | – (const char *) name of the event that is being unregistered. |
| [out] | -- | (int) the return value is SDE_OK on success, or an error code on failure. |
Definition at line 342 of file sde_lib.c.


Definition at line 1101 of file sde_lib.c.

Definition at line 1263 of file sde_lib.c.


Definition at line 1254 of file sde_lib.c.


Definition at line 1194 of file sde_lib.c.


|
inline |
| papisde_control_t* _papisde_global_control = NULL |
| pthread_mutex_t _sde_hwd_lock_data |
| int papi_sde_version = PAPI_SDE_VERSION |