#include <callgraph_container.h>
Data Structures | |
struct | cg_data |
Public Member Functions | |
~arc_recorder () | |
void | add (symbol_entry const &caller, symbol_entry const *callee, count_array_t const &arc_count) |
symbol_collection const & | get_symbols () const |
return all the cg symbols | |
void | process (count_array_t total, double threshold, string_filter const &filter) |
Private Types | |
typedef std::map< symbol_entry, cg_data, less_symbol > | map_t |
Private Member Functions | |
void | process_children (cg_symbol &sym, double threshold) |
Private Attributes | |
map_t | sym_map |
all the symbols (used during processing) | |
cg_collection_objs | cg_syms_objs |
symbol objects pointed to by pointers in vector cg_syms | |
symbol_collection | cg_syms |
final output data |
During building a callgraph_container we store all caller/callee relationship in this container.
An "arc" is simply a description of a call from one function to another.
Definition at line 38 of file callgraph_container.h.
typedef std::map<symbol_entry, cg_data, less_symbol> arc_recorder::map_t [private] |
Definition at line 88 of file callgraph_container.h.
arc_recorder::~arc_recorder | ( | ) | [inline] |
Definition at line 40 of file callgraph_container.h.
void arc_recorder::add | ( | symbol_entry const & | caller, | |
symbol_entry const * | callee, | |||
count_array_t const & | arc_count | |||
) |
Add a symbol arc.
caller | The calling symbol | |
callee | The called symbol | |
arc_count | profile data for the arcs |
If the callee is NULL, only the caller is added to the main list. This is used to initially populate the recorder with the symbols.
Definition at line 287 of file callgraph_container.cpp.
References arc_recorder::cg_data::callees, arc_recorder::cg_data::callers, and sym_map.
Referenced by callgraph_container::add_symbols().
symbol_collection const & arc_recorder::get_symbols | ( | ) | const |
return all the cg symbols
Definition at line 389 of file callgraph_container.cpp.
References cg_syms.
Referenced by callgraph_container::get_symbols(), and callgraph_container::output_hint().
void arc_recorder::process | ( | count_array_t | total, | |
double | threshold, | |||
string_filter const & | filter | |||
) |
After population, build the final output, and do thresholding.
Definition at line 343 of file callgraph_container.cpp.
References cg_symbol::callees, arc_recorder::cg_data::callees, cg_symbol::callers, arc_recorder::cg_data::callers, cg_syms, cg_syms_objs, sample_entry::counts, symbol_name_storage::demangle(), string_filter::match(), symbol_entry::name, op_ratio(), process_children(), symbol_entry::sample, sym_map, symbol_names, cg_symbol::total_callee_count, and cg_symbol::total_caller_count.
void arc_recorder::process_children | ( | cg_symbol & | sym, | |
double | threshold | |||
) | [private] |
Sort and threshold callers and callees.
Definition at line 304 of file callgraph_container.cpp.
References cg_symbol::callees, cg_symbol::callers, unique_storage< I, V >::create(), symbol_name_storage::demangle(), symbol_entry::name, op_ratio(), symbol_names, cg_symbol::total_callee_count, and cg_symbol::total_caller_count.
Referenced by process().
symbol_collection arc_recorder::cg_syms [private] |
final output data
Definition at line 97 of file callgraph_container.h.
Referenced by get_symbols(), and process().
cg_collection_objs arc_recorder::cg_syms_objs [private] |
symbol objects pointed to by pointers in vector cg_syms
Definition at line 94 of file callgraph_container.h.
Referenced by process().
map_t arc_recorder::sym_map [private] |
all the symbols (used during processing)
Definition at line 91 of file callgraph_container.h.