I got it now, but I'm not 100% sure why. I will try to describe my code a bit:
I have an Application class that is responsible for many subsystems. In my initial attempt, I tried to measure performance inside the application as follows:
int main(int argc, char *argv[])
{
Application a(argc, argv);
return a.exec();
}
void Application::Application(int &argc, char **argv)
{
m_pComplexSystem = new ComplexSystem();
m_pComplexSystem->configure();
CALLGRIND_START_INSTRUMENTATION;
m_Configurator->start();
}
Application::~Application()
{
CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS;
m_pComplexSystem ->stop();
delete m_pComplexSystem;
m_pComplexSystem = 0;
}
- , , configure() ComplexSystem.
, , , , :
int main(int argc, char *argv[])
{
Application a(argc, argv);
CALLGRIND_START_INSTRUMENTATION;
int result = a.exec();
CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS;
return result;
}
, , .