Add -profile option that dumps plugin load/initialization times.

Reviewed-by: con
This commit is contained in:
Friedemann Kleint
2010-03-02 12:33:51 +01:00
parent ab3a702c07
commit eae2f62970
5 changed files with 82 additions and 11 deletions

View File

@@ -34,9 +34,10 @@
using namespace ExtensionSystem;
using namespace ExtensionSystem::Internal;
static const char *END_OF_OPTIONS = "--";
static const char END_OF_OPTIONS[] = "--";
const char *OptionsParser::NO_LOAD_OPTION = "-noload";
const char *OptionsParser::TEST_OPTION = "-test";
const char *OptionsParser::PROFILE_OPTION = "-profile";
OptionsParser::OptionsParser(const QStringList &args,
const QMap<QString, bool> &appOptions,
@@ -69,6 +70,8 @@ bool OptionsParser::parse()
break;
if (checkForNoLoadOption())
continue;
if (checkForProfilingOption())
continue;
if (checkForTestOption())
continue;
if (checkForAppOption())
@@ -148,6 +151,14 @@ bool OptionsParser::checkForAppOption()
return true;
}
bool OptionsParser::checkForProfilingOption()
{
if (m_currentArg != QLatin1String(PROFILE_OPTION))
return false;
m_pmPrivate->initProfiling();
return true;
}
bool OptionsParser::checkForPluginOption()
{
bool requiresParameter;