TinySTM
1.0.5
|
Module for gathering statistics about transactions. More...
Go to the source code of this file.
Data Structures | |
struct | stm_ab_stats |
Statistics associated with an atomic block. More... | |
Typedefs | |
typedef struct stm_ab_stats | stm_ab_stats_t |
Statistics associated with an atomic block. | |
Functions | |
int | stm_get_ab_stats (int id, stm_ab_stats_t *stats) |
Get statistics about an atomic block. More... | |
void | mod_ab_init (int freq, int(*check)(void)) |
Initialize the module. More... | |
Module for gathering statistics about transactions.
This module maintains aggregate statistics about all threads for every atomic block in the application (distinguished using the identifier part of the transaction attributes).
void mod_ab_init | ( | int | freq, |
int(*)(void) | check | ||
) |
Initialize the module.
This function must be called once, from the main thread, after initializing the STM library and before performing any transactional operation.
freq | Inverse sampling frequency (1 to keep all samples). |
check | Pointer to a function that will be called to check if a sample is valid and should be kept. The event will be discarded if and only if the function returns 0. If no function is provided, all samples will be kept. |
int stm_get_ab_stats | ( | int | id, |
stm_ab_stats_t * | stats | ||
) |
Get statistics about an atomic block.
id | Identifier of the atomic block (as specified in transaction attributes). |
stats | Pointer to the variable to should hold the statistics of the atomic block. |