TinySTM  1.0.5
Data Structures | Typedefs | Functions
mod_ab.h File Reference

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...


typedef struct stm_ab_stats stm_ab_stats_t
 Statistics associated with an atomic block.


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...

Detailed Description

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).

Pascal Felber pasca.nosp@m.l.fe.nosp@m.lber@.nosp@m.unin.nosp@m.e.ch Patrick Marlier patri.nosp@m.ck.m.nosp@m.arlie.nosp@m.r@un.nosp@m.ine.c.nosp@m.h

Function Documentation

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.

freqInverse sampling frequency (1 to keep all samples).
checkPointer 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.

idIdentifier of the atomic block (as specified in transaction attributes).
statsPointer to the variable to should hold the statistics of the atomic block.
1 upon success, 0 otherwise.