Added marker in Engine for runtime analyzers like callgrind to start collecting data.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4671 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2011-11-03 14:40:58 +00:00
parent 095fe9ae56
commit ba66ef045b
3 changed files with 9 additions and 1 deletions

View File

@ -1111,6 +1111,7 @@ int Engine::run()
install(new EngineHelp); install(new EngineHelp);
loadPlugins(); loadPlugins();
Debug(DebugAll,"Loaded %d plugins",plugins.count()); Debug(DebugAll,"Loaded %d plugins",plugins.count());
internalStatisticsStart();
if (s_super_handle >= 0) { if (s_super_handle >= 0) {
install(new EngineSuperHandler); install(new EngineSuperHandler);
if (s_restarts) if (s_restarts)
@ -1252,6 +1253,12 @@ int Engine::run()
return s_haltcode; return s_haltcode;
} }
void Engine::internalStatisticsStart()
{
// This is here so runtime analyzers can start or reset statistics
// after the cruft of module load + global objects initialization
}
Engine* Engine::self() Engine* Engine::self()
{ {
if (!s_self) if (!s_self)

2
run.in
View File

@ -40,7 +40,7 @@ fi
if [ "$1" = "--callgrind" ]; then if [ "$1" = "--callgrind" ]; then
shift shift
export LD_BIND_NOW=yes export LD_BIND_NOW=yes
yate="valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes $1 $yate -Du" yate="valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --zero-before=*TelEngine*Engine*internalStatisticsStart* $1 $yate -Du"
shift shift
fi fi

View File

@ -1167,6 +1167,7 @@ protected:
private: private:
Engine(); Engine();
void internalStatisticsStart();
ObjList m_libs; ObjList m_libs;
MessageDispatcher m_dispatcher; MessageDispatcher m_dispatcher;
static Engine* s_self; static Engine* s_self;