From e2e9707510ae653fe40597b9f954eae11ec52201 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 28 Sep 2018 10:25:34 +0200 Subject: 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 --- src/libs/extensionsystem/pluginmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libs/extensionsystem') diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 665b89f886..b6ee6afa11 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -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); } -- cgit v1.2.1