libFirm
Statistic Events

The statistics system helps to evaluate the effects of compiler passes and transformations. More...

Functions

void stat_ev_ctx_push_fmt (const char *key, const char *fmt,...)
 Pushes a new setting on the context stack. More...
 
void stat_ev_ctx_push_str (const char *key, const char *str)
 Pushes a new setting with a string value on the context stack. More...
 
void stat_ev_ctx_pop (const char *key)
 Pops last setting from context stack. More...
 
void stat_ev_dbl (const char *name, double value)
 Emits a statistic event with a double value. More...
 
void stat_ev_int (const char *name, int value)
 Emits a statistic event with an integer value. More...
 
void stat_ev_ull (const char *name, unsigned long long value)
 Emits a statistic event with an unsigned long long value. More...
 
void stat_ev (const char *name)
 Emits a statistic event (without an additional value). More...
 
void stat_ev_begin (const char *filename_prefix, const char *filter)
 Initialize the stat ev machinery. More...
 
void stat_ev_end (void)
 Shuts down stat ev machinery. More...
 

Variables

int stat_ev_enabled
 This variable indicates whether statev output is enabled. More...
 

Detailed Description

The statistics system helps to evaluate the effects of compiler passes and transformations.

It is typically used to collect information like the number of instruction before and behind a pass, counting specific patterns or measuring the timing of subcomponents. This can create quite a bit of data, so we provide a framework for producing such data in an organzied way and some external tools to analyse such data.

The system is based on 2 concepts: Events and Contexts. A statistic-event is a pair of an event name and a double value. Events are put into a context like the compilation unit, the currently compiled function or the currently allocated register class. So contexts refine events and allow a grouping of events based on their context later. The context is managed in an hierarchic manner. You can push key/value pairs to refine the previous context or pop them again to get back to the previous broader context.

Function Documentation

◆ stat_ev()

void stat_ev ( const char *  name)

Emits a statistic event (without an additional value).

◆ stat_ev_begin()

void stat_ev_begin ( const char *  filename_prefix,
const char *  filter 
)

Initialize the stat ev machinery.

Parameters
filename_prefixThe name of the file (.ev or .ev.gz will be appended). File will be truncated!
filterAll pushes, pops and events will be filtered by this. If we have regex support, you can give an extended regex here. If not, each key will be matched against this. Matched means, we look if the key starts with filter. If NULL is given, each key passes, ie the filter is always TRUE.

◆ stat_ev_ctx_pop()

void stat_ev_ctx_pop ( const char *  key)

Pops last setting from context stack.

◆ stat_ev_ctx_push_fmt()

void stat_ev_ctx_push_fmt ( const char *  key,
const char *  fmt,
  ... 
)

Pushes a new setting on the context stack.

◆ stat_ev_ctx_push_str()

void stat_ev_ctx_push_str ( const char *  key,
const char *  str 
)

Pushes a new setting with a string value on the context stack.

◆ stat_ev_dbl()

void stat_ev_dbl ( const char *  name,
double  value 
)

Emits a statistic event with a double value.

◆ stat_ev_end()

void stat_ev_end ( void  )

Shuts down stat ev machinery.

◆ stat_ev_int()

void stat_ev_int ( const char *  name,
int  value 
)

Emits a statistic event with an integer value.

◆ stat_ev_ull()

void stat_ev_ull ( const char *  name,
unsigned long long  value 
)

Emits a statistic event with an unsigned long long value.

Variable Documentation

◆ stat_ev_enabled

int stat_ev_enabled

This variable indicates whether statev output is enabled.

Definition at line 73 of file statev.h.