usermode/library/mtm/src/stats.h File Reference

Statistics collector interface and MACROs. More...

#include "result.h"

Go to the source code of this file.

Classes

struct  m_stats_stat_s
struct  m_stats_statset_s

Defines

#define FOREACH_STAT_XACT(ACTION)
#define FOREACH_STAT(ACTION)
#define FOREACH_STATPROBE(ACTION)
#define FOREACH_VOIDSTATPROBE(ACTION)
#define STATENTRY(name)   m_stats_##name##_stat,
#define GENERATE_STATPROBES(stat_provider)
#define GENERATE_VOIDSTATPROBES(stat_provider)
#define m_stats_statset_increment(statsmgr, statset, stat_provider, stat, val)
#define m_stats_statset_decrement(statsmgr, statset, stat_provider, stat, val)

Typedefs

typedef unsigned int m_stats_statcounter_t
typedef m_stats_threadstat_s m_stats_threadstat_t
typedef m_statsmgr_s m_statsmgr_t
typedef m_stats_statset_s m_stats_statset_t
typedef m_stats_stat_s m_stats_stat_t

Enumerations

enum  m_stats_statentry_t { m_stats_numofstats }

Functions

m_result_t m_statsmgr_create (m_statsmgr_t **statsmgrp, char *output_file)
m_result_t m_statsmgr_destroy (m_statsmgr_t **statsmgrp)
m_result_t m_stats_threadstat_create (m_statsmgr_t *statsmgr, unsigned int tid, m_stats_threadstat_t **threadstatp)
m_result_t m_stats_statset_create (m_stats_statset_t **statsetp)
m_result_t m_stats_statset_destroy (m_stats_statset_t **statsetp)
m_result_t m_stats_statset_init (m_stats_statset_t *statset, const char *name)
void m_stats_threadstat_aggregate (m_stats_threadstat_t *threadstat, m_stats_statset_t *source_statset)
void m_stats_print (m_statsmgr_t *statsmgr)
 Prints a statistics report.


Detailed Description

Statistics collector interface and MACROs.

FIXME: This statistics collector was meant to be as generic as possible but it seems that it didn't live up to its promise. This is because the logic is based on the logic of the statistics collector used in the transaction statistics collector used by MTM. For the future, we would like to implement a more extensible statistics collector similar to the one used by Solaris kstat provider.

Definition in file stats.h.


Define Documentation

#define FOREACH_STAT_XACT ( ACTION   ) 

Value:

ACTION(aborts)                                                            \
  ACTION(writes)                                                            \
  ACTION(writes_distinct)                                                   \
  ACTION(nvwrites)                                                          \
  ACTION(nvwrites_distinct)                                                 \
  ACTION(vwrites)                                                           \
  ACTION(vwrites_distinct)                                                  \
  ACTION(wbflush)
The statistics collected by the collector.

Definition at line 59 of file stats.h.

#define GENERATE_STATPROBES ( stat_provider   ) 

Value:

static inline                                                                  \
void                                                                           \
m_stats_statset_increment_##stat_provider(m_statsmgr_t *statsmgr,              \
                                          m_stats_statset_t *statset,          \
                                          m_stats_statentry_t entry,           \
                                          m_stats_statcounter_t val)           \
{                                                                              \
    if (statsmgr) {                                                            \
        m_stats_statset_set_val(statset,                                       \
                                entry,                                         \
                                m_stats_statset_get_val(statset, entry) + val);\
    }                                                                                                  \
}                                                                                                                      \
                                                                               \
static inline                                                                  \
void                                                                           \
m_stats_statset_decrement_##stat_provider(m_statsmgr_t *statsmgr,              \
                                          m_stats_statset_t *statset,          \
                                          m_stats_statentry_t entry,           \
                                          m_stats_statcounter_t val)           \
{                                                                              \
        if (statsmgr) {                                                            \
        m_stats_statset_set_val(statset,                                       \
                                entry,                                         \
                                m_stats_statset_get_val(statset, entry) - val);\
    }                                                                                                  \
}                                                                                                                      \

Definition at line 148 of file stats.h.

#define GENERATE_VOIDSTATPROBES ( stat_provider   ) 

Value:

static inline                                                                \
void                                                                         \
m_stats_statset_increment_##stat_provider(m_statsmgr_t *statsmgr,            \
                                          m_stats_statset_t *statset,        \
                                          m_stats_statentry_t entry,         \
                                          m_stats_statcounter_t val)         \
{                                                                            \
        return ;                                                                 \
}                                                                                                                    \
                                                                             \
static inline                                                                \
void                                                                         \
m_stats_statset_decrement_##stat_provider(m_statsmgr_t *statsmgr,            \
                                          m_stats_statset_t *statset,        \
                                          m_stats_statentry_t entry,         \
                                          m_stats_statcounter_t val)         \
{                                                                            \
        return ;                                                                 \
}                                                                                                                    \

Definition at line 178 of file stats.h.

#define m_stats_statset_decrement ( statsmgr,
statset,
stat_provider,
stat,
val   ) 

Value:

m_stats_statset_decrement_##stat_provider(statsmgr,                          \
                                            statset,                           \
                                            m_stats_##stat##_stat,             \
                                            val);

Definition at line 210 of file stats.h.

#define m_stats_statset_increment ( statsmgr,
statset,
stat_provider,
stat,
val   ) 

Value:

m_stats_statset_increment_##stat_provider(statsmgr,                          \
                                            statset,                           \
                                                                                        m_stats_##stat##_stat,             \
                                            val);

Definition at line 204 of file stats.h.


Function Documentation

void m_stats_print ( m_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 424 of file stats_generic.c.

References m_statsmgr_s::alloc_threadstat_list_head, m_stats_statset_s::count, m_chhash_create(), m_chhash_iter_init(), m_chhash_iter_next(), m_stats_statset_init(), M_STATS_THREADSTAT_HASHTABLE_SIZE, m_stats_threadstat_s::next, m_statsmgr_s::output_file, m_stats_statset_s::stats, m_stats_threadstat_s::stats_table, and m_stats_threadstat_s::summary_statset.


Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7