forked from qt-creator/qt-creator
Fix plugin loading profiling report
We print a report both before and after a plugin's initialization method is called, but only the time spent till after the method call should be counted. This makes a different for the delayedInitialize cycle: Before delayedInitialize is called of a plugin, there can be a delay after the previous one. But this delay should not be counted as part of the initialization time of the plugin. Change-Id: I4e5fb53cd83cb36a45a599cfc3f1f8539f6327f9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1525,16 +1525,16 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s
|
||||
const int absoluteElapsedMS = m_profileTimer->elapsed();
|
||||
const int elapsedMS = absoluteElapsedMS - m_profileElapsedMS;
|
||||
m_profileElapsedMS = absoluteElapsedMS;
|
||||
if (spec)
|
||||
m_profileTotal[spec] += elapsedMS;
|
||||
if (spec)
|
||||
qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS);
|
||||
else
|
||||
qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS);
|
||||
if (what && *what == '<') {
|
||||
QString tc;
|
||||
if (spec)
|
||||
if (spec) {
|
||||
m_profileTotal[spec] += elapsedMS;
|
||||
tc = spec->name() + '_';
|
||||
}
|
||||
tc += QString::fromUtf8(QByteArray(what + 1));
|
||||
Utils::Benchmarker::report("loadPlugins", tc, elapsedMS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user