diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2021-05-17 00:38:38 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2021-05-20 09:47:03 +0000 |
commit | 0df9ff8e3efa695aed76107673bff9eca355fe13 (patch) | |
tree | 3735c3a14e2219cfd7816abde70a77345c21e1a5 /src | |
parent | 0bbefbd5dc0ed597b8d1442594a9ab04fadaba60 (diff) | |
download | qbs-0df9ff8e3efa695aed76107673bff9eca355fe13.tar.gz |
Add profiling timer for module providers
Change-Id: Ia1c79675a20fb3d97ae2a1aa65091fb87a03cc21
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/language/moduleloader.cpp | 6 | ||||
-rw-r--r-- | src/lib/corelib/language/moduleloader.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 3680d94f0..3d059b4a8 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -308,6 +308,7 @@ ModuleLoaderResult ModuleLoader::load(const SetupProjectParameters ¶meters) m_elapsedTimeProbes = m_elapsedTimePrepareProducts = m_elapsedTimeHandleProducts = m_elapsedTimeProductDependencies = m_elapsedTimeTransitiveDependencies = m_elapsedTimePropertyChecking = 0; + m_elapsedTimeModuleProviders = 0; m_elapsedTimeProbes = 0; m_probesEncountered = m_probesRun = m_probesCachedCurrent = m_probesCachedOld = 0; m_settings = std::make_unique<Settings>(parameters.settingsDirectory()); @@ -1934,6 +1935,9 @@ void ModuleLoader::printProfilingInfo() << Tr::tr("Setting up product dependencies took %1.") .arg(elapsedTimeString(m_elapsedTimeProductDependencies)); m_logger.qbsLog(LoggerInfo, true) << "\t\t" + << Tr::tr("Running module providers took %1.") + .arg(elapsedTimeString(m_elapsedTimeModuleProviders)); + m_logger.qbsLog(LoggerInfo, true) << "\t\t" << Tr::tr("Setting up transitive product dependencies took %1.") .arg(elapsedTimeString(m_elapsedTimeTransitiveDependencies)); m_logger.qbsLog(LoggerInfo, true) << "\t" @@ -3103,6 +3107,8 @@ Item *ModuleLoader::searchAndLoadModuleFile(ProductContext *productContext, auto existingPaths = findExistingModulePaths(m_reader->allSearchPaths(), moduleName); if (existingPaths.isEmpty()) { // no suitable names found, try to use providers + AccumulatingTimer providersTimer( + m_parameters.logElapsedTime() ? &m_elapsedTimeModuleProviders : nullptr); const auto result = m_moduleProviderLoader->executeModuleProvider( *productContext, dependsItemLocation, diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h index 6d0943708..1e39c2cf5 100644 --- a/src/lib/corelib/language/moduleloader.h +++ b/src/lib/corelib/language/moduleloader.h @@ -451,6 +451,7 @@ private: qint64 m_elapsedTimeProbes = 0; qint64 m_elapsedTimePrepareProducts = 0; qint64 m_elapsedTimeProductDependencies = 0; + qint64 m_elapsedTimeModuleProviders = 0; qint64 m_elapsedTimeTransitiveDependencies = 0; qint64 m_elapsedTimeHandleProducts = 0; qint64 m_elapsedTimePropertyChecking = 0; |