src/core/stats.h File Reference

Statistics collector interface and MACROs. More...

#include <misc/generic_types.h>
#include <core/config.h>
#include <core/tx.h>
#include <core/txdesc.h>

Go to the source code of this file.

Classes

struct  txc_stats_stat_s
struct  txc_stats_txstat_s

Defines

#define FOREACH_STAT_XCALL(ACTION)
#define FOREACH_STAT(ACTION)
#define FOREACH_STATPROBE(ACTION)
#define FOREACH_VOIDSTATPROBE(ACTION)
#define STATENTRY(name)   txc_stats_##name##_stat,
#define GENERATE_STATPROBES(stat_provider)
#define GENERATE_VOIDSTATPROBES(stat_provider)
#define txc_stats_txstat_increment(txd, stat_provider, stat, val)
#define txc_stats_txstat_decrement(txd, stat_provider, stat, val)

Typedefs

typedef unsigned int txc_stats_statcounter_t
typedef txc_stats_threadstat_s txc_stats_threadstat_t
typedef txc_statsmgr_s txc_statsmgr_t
typedef txc_stats_txstat_s txc_stats_txstat_t
typedef txc_stats_stat_s txc_stats_stat_t

Enumerations

enum  txc_stats_statentry_t { txc_stats_numofstats }

Functions

void txc_stats_txstat_set (txc_tx_t *txd, txc_stats_statentry_t entry, txc_stats_statcounter_t val)
 Writes the value of a statistic.
txc_stats_statcounter_t txc_stats_txstat_get (txc_tx_t *txd, txc_stats_statentry_t entry)
 Reads the value of a statistic.
txc_result_t txc_statsmgr_create (txc_statsmgr_t **statsmgrp)
txc_result_t txc_statsmgr_destroy (txc_statsmgr_t **statsmgrp)
txc_result_t txc_stats_threadstat_create (txc_statsmgr_t *statsmgr, txc_stats_threadstat_t **threadstatp, txc_tx_t *txd)
txc_result_t txc_stats_txstat_create (txc_stats_txstat_t **txstatp)
txc_result_t txc_stats_txstat_destroy (txc_stats_txstat_t **txstatp)
txc_result_t txc_stats_txstat_init (txc_stats_txstat_t *txstat, const char *srcloc_str, txc_tx_srcloc_t *srcloc)
void txc_stats_register_statsmgr_commit_action (txc_tx_t *txd)
void txc_stats_register_statsmgr_undo_action (txc_tx_t *txd)
void txc_stats_transaction_postbegin (txc_tx_t *txd)
void txc_stats_print (txc_statsmgr_t *statsmgr)
 Prints a statistics report.


Detailed Description

Statistics collector interface and MACROs.

Definition in file stats.h.


Define Documentation

#define FOREACH_STAT_XCALL ( ACTION   ) 

Value:

The statistics collected by the collector.

Definition at line 15 of file stats.h.

#define GENERATE_STATPROBES ( stat_provider   ) 

Value:

inline                                                                       \
void                                                                         \
txc_stats_txstat_increment_##stat_provider(txc_tx_t *txd,                    \
                                           txc_stats_statentry_t entry,      \
                                           txc_stats_statcounter_t val)      \
{                                                                            \
    if (txc_runtime_settings.statistics == TXC_BOOL_TRUE) {                  \
        txc_stats_txstat_set(txd,                                            \
                             entry,                                          \
                             txc_stats_txstat_get(txd, entry) + val);        \
    }                                                                                                \
}                                                                                                                    \
                                                                             \
inline                                                                       \
void                                                                         \
txc_stats_txstat_decrement_##stat_provider(txc_tx_t *txd,                    \
                                           txc_stats_statentry_t entry,      \
                                           txc_stats_statcounter_t val)      \
{                                                                            \
        if (txc_runtime_settings.statistics == TXC_BOOL_TRUE) {                  \
        txc_stats_txstat_set(txd,                                            \
                             entry,                                          \
                             txc_stats_txstat_get(txd, entry) - val);        \
    }                                                                                                \
}                                                                                                                    \

Definition at line 125 of file stats.h.

#define GENERATE_VOIDSTATPROBES ( stat_provider   ) 

Value:

inline                                                                       \
void                                                                         \
txc_stats_txstat_increment_##stat_provider(txc_tx_t *txd,                    \
                                           txc_stats_statentry_t entry,      \
                                           txc_stats_statcounter_t val)      \
{                                                                            \
        return ;                                                                 \
}                                                                                                                    \
                                                                             \
inline                                                                       \
void                                                                         \
txc_stats_txstat_increment_##stat_provider(txc_tx_t *txd,                    \
                                           txc_stats_statentry_t entry,      \
                                           txc_stats_statcounter_t val)      \
{                                                                            \
        return ;                                                                 \
}                                                                                                                    \

Definition at line 154 of file stats.h.

#define txc_stats_txstat_decrement ( txd,
stat_provider,
stat,
val   ) 

Value:

txc_stats_txstat_decrement_##stat_provider(txd,                            \
                                             txc_stats_##stat##_stat,        \
                                             val);

Definition at line 183 of file stats.h.

#define txc_stats_txstat_increment ( txd,
stat_provider,
stat,
val   ) 

Value:

txc_stats_txstat_increment_##stat_provider(txd,                            \
                                             txc_stats_##stat##_stat,        \
                                             val);

Definition at line 178 of file stats.h.

Referenced by x_close(), x_create(), x_dup(), x_fsync(), x_lseek(), x_open(), x_pipe(), x_printf(), x_read(), x_rename(), x_sendmsg(), x_socket(), x_unlink(), and x_write_pipe().


Function Documentation

void txc_stats_print ( txc_statsmgr_t statsmgr  ) 

Prints a statistics report.

Summarizes statistics and prints a report into the statistics file. Print the statistics report in the same format as the Intel STM's one to avoid duplicating post-processing scripts.

Parameters:
[in] statsmgr Pointer to the statistics manager collecting the statistics.
Returns:
None

Definition at line 486 of file stats.c.

References txc_statsmgr_s::alloc_threadstat_list_head, txc_stats_txstat_s::count, txc_stats_threadstat_s::count, txc_stats_stat_s::max, txc_stats_stat_s::min, txc_stats_threadstat_s::next, txc_stats_stat_s::total, txc_stats_txstat_s::total_stats, txc_stats_threadstat_s::total_stats, txc_stats_threadstat_s::tx_stats, txc_hash_table_create(), txc_hash_table_iter_init(), txc_hash_table_iter_next(), TXC_R_SUCCESS, txc_runtime_settings, and TXC_STATS_THREADSTAT_HASHTABLE_SIZE.

Referenced by _TXC_global_shutdown().


Generated on Wed Dec 9 20:32:40 2009 for xCalls by  doxygen 1.4.7