22 #ifndef INCLUDED_PROFILE 23 #define INCLUDED_PROFILE 32 #include <boost/flyweight.hpp> 33 #include <boost/flyweight/key_value.hpp> 34 #include <boost/flyweight/no_locking.hpp> 35 #include <boost/flyweight/no_tracking.hpp> 37 #define PROFILE_AMORTIZE_FRAMES 30 38 #define PROFILE_AMORTIZE_TURNS 1 59 typedef boost::flyweight<
61 boost::flyweights::no_tracking,
62 boost::flyweights::no_locking
116 const std::vector<CProfileNode*>*
GetChildren()
const {
return( &children ); }
144 void PerformStructuralReset();
151 void Start(
const char*
name );
152 void StartScript(
const char*
name );
165 void StructuralReset();
171 #define g_Profiler CProfileManager::GetSingleton() 219 #define PROFILE(name) CProfileSample __profile(name) 221 #define PROFILE_START(name) { CProfileSample __profile(name) 222 #define PROFILE_END(name) } 225 #define PROFILE3(name) PROFILE(name); PROFILE2(name) 228 #define PROFILE3_GPU(name) PROFILE(name); PROFILE2(name); PROFILE2_GPU(name) 230 #endif // INCLUDED_PROFILE RingBuf< double, PROFILE_AMORTIZE_TURNS > time_per_turn
Definition: Profile.h:82
const CProfileNode * GetChild(const char *name) const
Definition: Profile.cpp:323
RingBuf< int, PROFILE_AMORTIZE_TURNS > calls_per_turn
Definition: Profile.h:77
void Turn()
Definition: Profile.cpp:413
CProfileSample(const char *name)
Definition: Profile.h:176
double GetFrameCalls() const
Definition: Profile.cpp:293
const char * GetName() const
Definition: Profile.h:105
bool Return()
Definition: Profile.cpp:665
const std::vector< CProfileNode * > * GetScriptChildren() const
Definition: Profile.h:117
const CProfileNode * GetCurrent()
Definition: Profile.h:167
RingBuf< int, PROFILE_AMORTIZE_FRAMES > calls_per_frame
Definition: Profile.h:76
CProfileNode * parent
Definition: Profile.h:93
std::vector< CProfileNode * > children
Definition: Profile.h:94
const CProfileNode * GetRoot()
Definition: Profile.h:168
double time_turn_current
Definition: Profile.h:80
long mallocs_turn_current
Definition: Profile.h:85
double start
Definition: Profile.h:89
int calls_turn_current
Definition: Profile.h:75
CProfileNode * GetParent() const
Definition: Profile.h:123
Class CProfileNodeTable: Implement ProfileViewer's AbstractProfileTable interface in order to display...
Definition: Profile.cpp:51
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::no_locking > StringFlyweight
Definition: Profile.h:44
void Frame()
Definition: Profile.cpp:396
~CProfileNode()
Definition: Profile.cpp:274
NONCOPYABLE(CProfileNode)
CProfileNodeTable * display_table
Definition: Profile.h:96
CProfileNode * root
Definition: Profile.h:139
Definition: Profile.h:173
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:287
int recursion
Definition: Profile.h:91
CProfileSampleScript(const char *name)
Definition: Profile.h:196
std::vector< CProfileNode * >::const_iterator const_profile_iterator
Definition: Profile.h:100
#define g_Profiler
Definition: Profile.h:171
~CProfileSampleScript()
Definition: Profile.h:209
Definition: Profile.h:193
bool needs_structural_reset
Definition: Profile.h:142
New profiler (complementing the older CProfileManager)
CProfileNode * current
Definition: Profile.h:140
static bool IsInitialised()
Definition: Singleton.h:63
double GetFrameMallocs() const
Definition: Profile.cpp:313
const std::vector< CProfileNode * > * GetChildren() const
Definition: Profile.h:116
Definition: Profile.h:137
long mallocs_frame_current
Definition: Profile.h:84
void Call()
Definition: Profile.cpp:654
const CProfileNode * GetScriptChild(const char *name) const
Definition: Profile.cpp:333
~CProfileSample()
Definition: Profile.h:186
double GetTurnTime() const
Definition: Profile.cpp:308
double time_frame_current
Definition: Profile.h:79
friend class CProfileManager
Definition: Profile.h:69
RingBuf< double, PROFILE_AMORTIZE_FRAMES > time_per_frame
Definition: Profile.h:81
CProfileNode(const char *name, CProfileNode *parent)
Definition: Profile.cpp:262
void Reset()
Definition: Profile.cpp:372
int calls_frame_current
Definition: Profile.h:74
double GetFrameTime() const
Definition: Profile.cpp:298
bool IsMainThread()
Returns whether the current thread is the 'main' thread (i.e.
Definition: ThreadUtil.cpp:25
Definition: Singleton.h:34
const char * name
Definition: Profile.h:72
long start_mallocs
Definition: Profile.h:90
RingBuf< long, PROFILE_AMORTIZE_FRAMES > mallocs_per_frame
Definition: Profile.h:86
RingBuf< long, PROFILE_AMORTIZE_TURNS > mallocs_per_turn
Definition: Profile.h:87
std::vector< CProfileNode * > script_children
Definition: Profile.h:95
double GetTurnMallocs() const
Definition: Profile.cpp:318
bool CanExpand()
Definition: Profile.cpp:367
std::vector< CProfileNode * >::iterator profile_iterator
Definition: Profile.h:99
double GetTurnCalls() const
Definition: Profile.cpp:303