forked from qt-creator/qt-creator
QmlDesigner: Introduce extra tracing file for project storage
That is reducing dependecies and compilation time. Change-Id: Ib495c7d7a61e9ff18d976d0a94db215691097ad9 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -402,6 +402,7 @@ extend_qtc_library(QmlDesignerCore
|
||||
projectstoragepathwatcher.h
|
||||
projectstoragepathwatchertypes.h
|
||||
projectstorageprinting.h
|
||||
projectstoragetracing.cpp projectstoragetracing.h
|
||||
projectstoragetypes.h
|
||||
projectstorageupdater.cpp projectstorageupdater.h
|
||||
projectstorage.cpp projectstorage.h
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
||||
#include "projectstoragetypes.h"
|
||||
#include "sourcepathstorage/storagecache.h"
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
#include "projectstoragetracing.h"
|
||||
|
||||
#include <sqlitealgorithms.h>
|
||||
#include <sqlitedatabase.h>
|
||||
@@ -31,8 +31,6 @@ namespace QmlDesigner {
|
||||
|
||||
using namespace NanotraceHR::Literals;
|
||||
|
||||
using ProjectStorageTracing::projectStorageCategory;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT ProjectStorage final : public ProjectStorageInterface
|
||||
{
|
||||
using Database = Sqlite::Database;
|
||||
@@ -136,7 +134,7 @@ public:
|
||||
{
|
||||
using NanotraceHR::keyValue;
|
||||
NanotraceHR::Tracer tracer{"get type id from common type cache",
|
||||
projectStorageCategory(),
|
||||
ProjectStorageTracing::category(),
|
||||
keyValue("module name", std::string_view{moduleName}),
|
||||
keyValue("type name", std::string_view{typeName})};
|
||||
|
||||
@@ -152,7 +150,7 @@ public:
|
||||
{
|
||||
using NanotraceHR::keyValue;
|
||||
NanotraceHR::Tracer tracer{"get builtin type id from common type cache",
|
||||
projectStorageCategory()};
|
||||
ProjectStorageTracing::category()};
|
||||
|
||||
auto typeId = commonTypeCache_.builtinTypeId<BuiltinType>();
|
||||
|
||||
@@ -166,7 +164,7 @@ public:
|
||||
{
|
||||
using NanotraceHR::keyValue;
|
||||
NanotraceHR::Tracer tracer{"get builtin type id from common type cache",
|
||||
projectStorageCategory()};
|
||||
ProjectStorageTracing::category()};
|
||||
|
||||
auto typeId = commonTypeCache_.builtinTypeId<builtinType>();
|
||||
|
||||
@@ -322,30 +320,11 @@ private:
|
||||
class ModuleStorageAdapter
|
||||
{
|
||||
public:
|
||||
auto fetchId(ModuleView module)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"module stoeage adapter fetch id",
|
||||
projectStorageCategory(),
|
||||
NanotraceHR::keyValue("module name", module.name),
|
||||
NanotraceHR::keyValue("module kind", module.kind)};
|
||||
return storage.fetchModuleId(module.name, module.kind);
|
||||
}
|
||||
auto fetchId(ModuleView module);
|
||||
|
||||
auto fetchValue(ModuleId id)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"module stoeage adapter fetch value",
|
||||
projectStorageCategory(),
|
||||
NanotraceHR::keyValue("module id", id)};
|
||||
auto fetchValue(ModuleId id);
|
||||
|
||||
return storage.fetchModule(id);
|
||||
}
|
||||
|
||||
auto fetchAll()
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"module stoeage adapter fetch all", projectStorageCategory()};
|
||||
|
||||
return storage.fetchAllModules();
|
||||
}
|
||||
auto fetchAll();
|
||||
|
||||
ProjectStorage &storage;
|
||||
};
|
||||
@@ -895,26 +874,8 @@ private:
|
||||
AliasPropertyDeclarations &aliasPropertyDeclarationsToLink,
|
||||
PropertyDeclarationIds &propertyDeclarationIds);
|
||||
|
||||
template<typename Relinkable>
|
||||
void removeRelinkableEntries(std::vector<Relinkable> &relinkables, auto &ids, auto projection)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"remove relinkable entries", projectStorageCategory()};
|
||||
|
||||
std::vector<Relinkable> newRelinkables;
|
||||
newRelinkables.reserve(relinkables.size());
|
||||
|
||||
std::ranges::sort(ids);
|
||||
std::ranges::sort(relinkables, {}, projection);
|
||||
|
||||
Utils::set_greedy_difference(
|
||||
relinkables,
|
||||
ids,
|
||||
[&](Relinkable &entry) { newRelinkables.push_back(std::move(entry)); },
|
||||
{},
|
||||
projection);
|
||||
|
||||
relinkables = std::move(newRelinkables);
|
||||
}
|
||||
template<typename Relinkable, typename Ids, typename Projection>
|
||||
void removeRelinkableEntries(std::vector<Relinkable> &relinkables, Ids ids, Projection projection);
|
||||
|
||||
void syncDeclarations(Storage::Synchronization::Types &types,
|
||||
AliasPropertyDeclarations &aliasPropertyDeclarationsToLink,
|
||||
|
@@ -3,24 +3,20 @@
|
||||
|
||||
#include "projectstorageexceptions.h"
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
#include "projectstoragetracing.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
using namespace NanotraceHR::Literals;
|
||||
using NanotraceHR::keyValue;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProjectStorageTracing::projectStorageCategory;
|
||||
|
||||
} // namespace
|
||||
using ProjectStorageTracing::category;
|
||||
|
||||
TypeHasInvalidSourceId::TypeHasInvalidSourceId(const Sqlite::source_location &location)
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("TypeHasInvalidSourceId");
|
||||
category().threadEvent("TypeHasInvalidSourceId");
|
||||
}
|
||||
|
||||
const char *TypeHasInvalidSourceId::what() const noexcept
|
||||
@@ -32,7 +28,7 @@ ModuleDoesNotExists::ModuleDoesNotExists(const Sqlite::source_location &location
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("ModuleDoesNotExists");
|
||||
category().threadEvent("ModuleDoesNotExists");
|
||||
}
|
||||
|
||||
const char *ModuleDoesNotExists::what() const noexcept
|
||||
@@ -44,7 +40,7 @@ ModuleAlreadyExists::ModuleAlreadyExists(const Sqlite::source_location &location
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("ModuleAlreadyExists");
|
||||
category().threadEvent("ModuleAlreadyExists");
|
||||
}
|
||||
|
||||
const char *ModuleAlreadyExists::what() const noexcept
|
||||
@@ -61,16 +57,16 @@ TypeNameDoesNotExists::TypeNameDoesNotExists(std::string_view typeName,
|
||||
{"type: ", typeName, ", source id: ", Utils::SmallString::number(sourceId.internalId())}),
|
||||
location}
|
||||
{
|
||||
projectStorageCategory().threadEvent("TypeNameDoesNotExists",
|
||||
keyValue("type name", typeName),
|
||||
keyValue("source id", sourceId));
|
||||
category().threadEvent("TypeNameDoesNotExists",
|
||||
keyValue("type name", typeName),
|
||||
keyValue("source id", sourceId));
|
||||
}
|
||||
|
||||
PrototypeChainCycle::PrototypeChainCycle(const Sqlite::source_location &location)
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("PrototypeChainCycle");
|
||||
category().threadEvent("PrototypeChainCycle");
|
||||
}
|
||||
|
||||
const char *PrototypeChainCycle::what() const noexcept
|
||||
@@ -82,7 +78,7 @@ AliasChainCycle::AliasChainCycle(const Sqlite::source_location &location)
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("AliasChainCycle");
|
||||
category().threadEvent("AliasChainCycle");
|
||||
}
|
||||
|
||||
const char *AliasChainCycle::what() const noexcept
|
||||
@@ -94,7 +90,7 @@ CannotParseQmlTypesFile::CannotParseQmlTypesFile(const Sqlite::source_location &
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("CannotParseQmlTypesFile");
|
||||
category().threadEvent("CannotParseQmlTypesFile");
|
||||
}
|
||||
|
||||
const char *CannotParseQmlTypesFile::what() const noexcept
|
||||
@@ -106,7 +102,7 @@ CannotParseQmlDocumentFile::CannotParseQmlDocumentFile(const Sqlite::source_loca
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("CannotParseQmlDocumentFile");
|
||||
category().threadEvent("CannotParseQmlDocumentFile");
|
||||
}
|
||||
|
||||
const char *CannotParseQmlDocumentFile::what() const noexcept
|
||||
@@ -119,7 +115,7 @@ DirectoryInfoHasInvalidProjectSourceId::DirectoryInfoHasInvalidProjectSourceId(
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("DirectoryInfoHasInvalidProjectSourceId");
|
||||
category().threadEvent("DirectoryInfoHasInvalidProjectSourceId");
|
||||
}
|
||||
|
||||
const char *DirectoryInfoHasInvalidProjectSourceId::what() const noexcept
|
||||
@@ -131,7 +127,7 @@ DirectoryInfoHasInvalidSourceId::DirectoryInfoHasInvalidSourceId(const Sqlite::s
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("DirectoryInfoHasInvalidSourceId");
|
||||
category().threadEvent("DirectoryInfoHasInvalidSourceId");
|
||||
}
|
||||
|
||||
const char *DirectoryInfoHasInvalidSourceId::what() const noexcept
|
||||
@@ -143,7 +139,7 @@ DirectoryInfoHasInvalidModuleId::DirectoryInfoHasInvalidModuleId(const Sqlite::s
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("DirectoryInfoHasInvalidModuleId");
|
||||
category().threadEvent("DirectoryInfoHasInvalidModuleId");
|
||||
}
|
||||
|
||||
const char *DirectoryInfoHasInvalidModuleId::what() const noexcept
|
||||
@@ -155,7 +151,7 @@ FileStatusHasInvalidSourceId::FileStatusHasInvalidSourceId(const Sqlite::source_
|
||||
: ProjectStorageError{location}
|
||||
|
||||
{
|
||||
projectStorageCategory().threadEvent("FileStatusHasInvalidSourceId");
|
||||
category().threadEvent("FileStatusHasInvalidSourceId");
|
||||
}
|
||||
|
||||
const char *FileStatusHasInvalidSourceId::what() const noexcept
|
||||
@@ -188,14 +184,13 @@ ExportedTypeCannotBeInserted::ExportedTypeCannotBeInserted(std::string_view erro
|
||||
const Sqlite::source_location &location)
|
||||
: ProjectStorageErrorWithMessage{"ExportedTypeCannotBeInserted"sv, errorMessage, location}
|
||||
{
|
||||
projectStorageCategory().threadEvent("ExportedTypeCannotBeInserted",
|
||||
keyValue("error message", errorMessage));
|
||||
category().threadEvent("ExportedTypeCannotBeInserted", keyValue("error message", errorMessage));
|
||||
}
|
||||
|
||||
TypeAnnotationHasInvalidSourceId::TypeAnnotationHasInvalidSourceId(const Sqlite::source_location &location)
|
||||
: ProjectStorageError{location}
|
||||
{
|
||||
projectStorageCategory().threadEvent("TypeAnnotationHasInvalidSourceId");
|
||||
category().threadEvent("TypeAnnotationHasInvalidSourceId");
|
||||
}
|
||||
|
||||
const char *TypeAnnotationHasInvalidSourceId::what() const noexcept
|
||||
|
@@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2025 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "projectstoragetracing.h"
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
|
||||
#include <sqlitebasestatement.h>
|
||||
|
||||
namespace QmlDesigner::ProjectStorageTracing {
|
||||
using namespace NanotraceHR::Literals;
|
||||
|
||||
#ifdef ENABLE_PROJECT_STORAGE_TRACING
|
||||
|
||||
namespace {
|
||||
|
||||
thread_local Category category_{"project storage",
|
||||
Tracing::eventQueueWithStringArguments(),
|
||||
Tracing::eventQueueWithoutArguments(),
|
||||
category};
|
||||
|
||||
} // namespace
|
||||
|
||||
Category &category()
|
||||
{
|
||||
return category_;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace QmlDesigner::ProjectStorageTracing
|
@@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2025 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <qmldesignercorelib_exports.h>
|
||||
|
||||
#include <nanotrace/nanotracehr.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace QmlDesigner::ProjectStorageTracing {
|
||||
|
||||
#ifdef ENABLE_PROJECT_STORAGE_TRACING
|
||||
|
||||
using Category = NanotraceHR::EnabledCategory;
|
||||
using SourceLocation = Category::SourceLocation;
|
||||
|
||||
[[gnu::pure]] QMLDESIGNERCORE_EXPORT Category &category();
|
||||
|
||||
#else
|
||||
|
||||
using Category = NanotraceHR::DisabledCategory;
|
||||
using SourceLocation = Category::SourceLocation;
|
||||
|
||||
inline Category category()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
#endif
|
||||
} // namespace QmlDesigner::ProjectStorageTracing
|
@@ -7,6 +7,7 @@
|
||||
#include "filesysteminterface.h"
|
||||
#include "projectstorage.h"
|
||||
#include "projectstoragepathwatcherinterface.h"
|
||||
#include "projectstoragetracing.h"
|
||||
#include "qmldocumentparserinterface.h"
|
||||
#include "qmltypesparserinterface.h"
|
||||
#include "sourcepathstorage/sourcepath.h"
|
||||
@@ -15,7 +16,6 @@
|
||||
|
||||
#include <functional.h>
|
||||
#include <sqlitedatabase.h>
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/set_algorithm.h>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
using NanotraceHR::keyValue;
|
||||
using ProjectStorageTracing::projectStorageUpdaterCategory;
|
||||
using ProjectStorageTracing::category;
|
||||
using Tracer = NanotraceHR::Tracer<ProjectStorageTracing::Category>;
|
||||
|
||||
template<typename String>
|
||||
@@ -205,7 +205,7 @@ void addModuleExportedImport(Storage::Synchronization::ModuleExportedImports &im
|
||||
std::string_view exportedModuleName)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"add module exported imports",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("module id", moduleId),
|
||||
keyValue("exported module id", exportedModuleId),
|
||||
keyValue("version", version),
|
||||
@@ -231,7 +231,7 @@ void addModuleExportedImports(Storage::Synchronization::ModuleExportedImports &i
|
||||
ProjectStorageInterface &projectStorage)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"add module exported imports",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("cpp module id", cppModuleId),
|
||||
keyValue("module id", moduleId)};
|
||||
|
||||
@@ -294,7 +294,7 @@ void ProjectStorageUpdater::update(Update update)
|
||||
const Utils::PathString projectDirectory = update.projectDirectory;
|
||||
|
||||
NanotraceHR::Tracer tracer{"update",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("Qt directories", qtDirectories),
|
||||
keyValue("project directory", projectDirectory)};
|
||||
|
||||
@@ -516,7 +516,7 @@ void ProjectStorageUpdater::updateDirectories(const QStringList &directories,
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds,
|
||||
WatchedSourceIds &watchedSourceIds)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update directories", projectStorageUpdaterCategory()};
|
||||
NanotraceHR::Tracer tracer{"update directories", category()};
|
||||
|
||||
for (const QString &directory : directories)
|
||||
updateDirectory(
|
||||
@@ -624,7 +624,7 @@ void ProjectStorageUpdater::annotationDirectoryChanged(
|
||||
Storage::Synchronization::SynchronizationPackage &package)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"annotation directory changed",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory path", directoryPath),
|
||||
keyValue("directory id", directoryId)};
|
||||
|
||||
@@ -640,7 +640,7 @@ void ProjectStorageUpdater::updatePropertyEditorFiles(
|
||||
Storage::Synchronization::SynchronizationPackage &package)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update property editor files",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory path", directoryPath),
|
||||
keyValue("directory id", directoryId)};
|
||||
|
||||
@@ -676,9 +676,7 @@ void ProjectStorageUpdater::updateDirectory(const Utils::PathString &directoryPa
|
||||
WatchedSourceIds &watchedSourceIds,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update directory",
|
||||
projectStorageUpdaterCategory(),
|
||||
keyValue("directory", directoryPath)};
|
||||
NanotraceHR::Tracer tracer{"update directory", category(), keyValue("directory", directoryPath)};
|
||||
|
||||
SourcePath qmldirPath{directoryPath + "/qmldir"};
|
||||
SourceId qmldirSourceId = m_pathCache.sourceId(qmldirPath);
|
||||
@@ -766,7 +764,7 @@ void ProjectStorageUpdater::updatePropertyEditorPaths(
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update property editor paths",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("property editor resources path", propertyEditorResourcesPath)};
|
||||
|
||||
if (propertyEditorResourcesPath.isEmpty())
|
||||
@@ -810,7 +808,7 @@ void ProjectStorageUpdater::updateTypeAnnotations(const QStringList &directoryPa
|
||||
Storage::Synchronization::SynchronizationPackage &package,
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds)
|
||||
{
|
||||
NanotraceHR::Tracer tracer("update type annotations", projectStorageUpdaterCategory());
|
||||
NanotraceHR::Tracer tracer("update type annotations", category());
|
||||
|
||||
std::map<DirectoryPathId, SmallSourceIds<16>> updatedSourceIdsDictonary;
|
||||
|
||||
@@ -830,7 +828,7 @@ void ProjectStorageUpdater::updateTypeAnnotations(
|
||||
std::map<DirectoryPathId, SmallSourceIds<16>> &updatedSourceIdsDictonary)
|
||||
{
|
||||
NanotraceHR::Tracer tracer("update type annotation directory",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("path", rootDirectoryPath));
|
||||
|
||||
if (rootDirectoryPath.isEmpty())
|
||||
@@ -904,7 +902,7 @@ void ProjectStorageUpdater::updateTypeAnnotation(const QString &directoryPath,
|
||||
Storage::Synchronization::SynchronizationPackage &package)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update type annotation path",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("path", filePath),
|
||||
keyValue("directory path", directoryPath)};
|
||||
|
||||
@@ -927,7 +925,7 @@ void ProjectStorageUpdater::updatePropertyEditorPath(
|
||||
long long pathOffset)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update property editor path",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory path", directoryPath),
|
||||
keyValue("directory id", directoryId)};
|
||||
|
||||
@@ -947,7 +945,7 @@ void ProjectStorageUpdater::updatePropertyEditorFilePath(
|
||||
long long pathOffset)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update property editor file path",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory path", path),
|
||||
keyValue("directory id", directoryId)};
|
||||
|
||||
@@ -1038,7 +1036,7 @@ void appendProjectChunkSourceIds(ProjectChunkSourceIds &ids,
|
||||
void ProjectStorageUpdater::pathsWithIdsChanged(const std::vector<IdPaths> &changedIdPaths)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"paths with ids changed",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("id paths", changedIdPaths)};
|
||||
|
||||
try {
|
||||
@@ -1165,15 +1163,13 @@ void ProjectStorageUpdater::parseTypeInfos(const QStringList &typeInfos,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse type infos",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory id", directoryId),
|
||||
keyValue("directory path", directoryPath),
|
||||
keyValue("module id", moduleId)};
|
||||
|
||||
for (const QString &typeInfo : typeInfos) {
|
||||
NanotraceHR::Tracer tracer{"parse type info",
|
||||
projectStorageUpdaterCategory(),
|
||||
keyValue("type info", typeInfo)};
|
||||
NanotraceHR::Tracer tracer{"parse type info", category(), keyValue("type info", typeInfo)};
|
||||
|
||||
Utils::PathString qmltypesFileName = typeInfo;
|
||||
SourceId sourceId = m_pathCache.sourceId(directoryId, qmltypesFileName);
|
||||
@@ -1216,7 +1212,7 @@ void ProjectStorageUpdater::parseDirectoryInfos(
|
||||
WatchedSourceIds &watchedSourceIds,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse project datas", projectStorageUpdaterCategory()};
|
||||
NanotraceHR::Tracer tracer{"parse project datas", category()};
|
||||
|
||||
for (const Storage::Synchronization::DirectoryInfo &directoryInfo : directoryInfos) {
|
||||
switch (directoryInfo.fileType) {
|
||||
@@ -1245,9 +1241,7 @@ auto ProjectStorageUpdater::parseTypeInfo(const Storage::Synchronization::Direct
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds,
|
||||
IsInsideProject isInsideProject) -> FileState
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse type info",
|
||||
projectStorageUpdaterCategory(),
|
||||
keyValue("qmltypes path", qmltypesPath)};
|
||||
NanotraceHR::Tracer tracer{"parse type info", category(), keyValue("qmltypes path", qmltypesPath)};
|
||||
|
||||
auto state = fileState(directoryInfo.sourceId, package, notUpdatedSourceIds);
|
||||
switch (state) {
|
||||
@@ -1293,7 +1287,7 @@ void ProjectStorageUpdater::parseQmlComponent(Utils::SmallStringView relativeFil
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse qml component",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("relative file path", relativeFilePath),
|
||||
keyValue("directory path", directoryPath),
|
||||
keyValue("exported types", exportedTypes),
|
||||
@@ -1369,9 +1363,7 @@ void ProjectStorageUpdater::parseQmlComponent(SourceId sourceId,
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse qml component",
|
||||
projectStorageUpdaterCategory(),
|
||||
keyValue("source id", sourceId)};
|
||||
NanotraceHR::Tracer tracer{"parse qml component", category(), keyValue("source id", sourceId)};
|
||||
|
||||
auto state = fileState(sourceId, package, notUpdatedSourceIds);
|
||||
if (isUnchanged(state))
|
||||
@@ -1468,7 +1460,7 @@ void ProjectStorageUpdater::parseQmlComponents(Components components,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse qml components",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("directory id", directoryId),
|
||||
keyValue("qmldir state", qmldirState)};
|
||||
|
||||
@@ -1502,7 +1494,7 @@ ProjectStorageUpdater::FileState ProjectStorageUpdater::fileState(
|
||||
NotUpdatedSourceIds ¬UpdatedSourceIds) const
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"update property editor paths",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("source id", sourceId)};
|
||||
|
||||
auto currentFileStatus = m_fileStatusCache.find(sourceId);
|
||||
|
@@ -8,14 +8,13 @@
|
||||
#include "projectstorageids.h"
|
||||
#include "projectstoragepathwatchernotifierinterface.h"
|
||||
#include "projectstoragepathwatchertypes.h"
|
||||
#include "projectstoragetracing.h"
|
||||
#include "projectstoragetypes.h"
|
||||
#include "sourcepathstorage/nonlockingmutex.h"
|
||||
#include "sourcepathstorage/sourcepath.h"
|
||||
|
||||
#include <modelfwd.h>
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
#include <map>
|
||||
|
@@ -6,11 +6,11 @@
|
||||
|
||||
#include "projectstorage.h"
|
||||
#include "projectstorageexceptions.h"
|
||||
#include "projectstoragetracing.h"
|
||||
|
||||
#include <sourcepathstorage/sourcepathcache.h>
|
||||
#include <sqlitedatabase.h>
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
|
||||
#ifdef QDS_BUILD_QMLPARSER
|
||||
#include <private/qqmldomtop_p.h>
|
||||
@@ -23,8 +23,8 @@ namespace QmlDesigner {
|
||||
|
||||
#ifdef QDS_BUILD_QMLPARSER
|
||||
|
||||
using ProjectStorageTracing::projectStorageUpdaterCategory;
|
||||
using NanotraceHR::keyValue;
|
||||
using ProjectStorageTracing::category;
|
||||
using Storage::IsInsideProject;
|
||||
using Tracer = NanotraceHR::Tracer<ProjectStorageTracing::Category>;
|
||||
|
||||
@@ -97,7 +97,7 @@ QualifiedImports createQualifiedImports(const QList<QmlDom::Import> &qmlImports,
|
||||
ProjectStorageType &storage)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"create qualified imports",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("sourceId", sourceId),
|
||||
keyValue("directoryPath", directoryPath)};
|
||||
|
||||
@@ -331,7 +331,7 @@ Storage::Synchronization::Type QmlDocumentParser::parse(const QString &sourceCon
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"qml document parser parse",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("sourceId", sourceId),
|
||||
keyValue("directoryPath", directoryPath)};
|
||||
|
||||
|
@@ -4,8 +4,7 @@
|
||||
#include "qmltypesparser.h"
|
||||
|
||||
#include "projectstorage.h"
|
||||
|
||||
#include <tracing/qmldesignertracing.h>
|
||||
#include "projectstoragetracing.h"
|
||||
|
||||
#include <sqlitedatabase.h>
|
||||
|
||||
@@ -25,8 +24,8 @@ namespace QmlDesigner {
|
||||
|
||||
#ifdef QDS_BUILD_QMLPARSER
|
||||
|
||||
using ProjectStorageTracing::projectStorageUpdaterCategory;
|
||||
using NanotraceHR::keyValue;
|
||||
using ProjectStorageTracing::category;
|
||||
using Storage::IsInsideProject;
|
||||
using Tracer = NanotraceHR::Tracer<ProjectStorageTracing::Category>;
|
||||
using Storage::ModuleKind;
|
||||
@@ -40,7 +39,7 @@ using Storage::TypeNameString;
|
||||
|
||||
ComponentWithoutNamespaces createComponentNameWithoutNamespaces(const QList<QQmlJSExportedScope> &objects)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"parse qmltypes file", projectStorageUpdaterCategory()};
|
||||
NanotraceHR::Tracer tracer{"parse qmltypes file", category()};
|
||||
|
||||
ComponentWithoutNamespaces componentWithoutNamespaces;
|
||||
|
||||
@@ -83,7 +82,7 @@ void addImports(Storage::Imports &imports,
|
||||
{
|
||||
NanotraceHR::Tracer tracer{
|
||||
"add imports",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("source id", sourceId),
|
||||
keyValue("module id", cppModuleId),
|
||||
};
|
||||
@@ -467,7 +466,7 @@ void addType(Storage::Synchronization::Types &types,
|
||||
Internal::LastModule &lastQmlModule)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"add type",
|
||||
projectStorageUpdaterCategory(),
|
||||
category(),
|
||||
keyValue("source id", sourceId),
|
||||
keyValue("module id", cppModuleId)};
|
||||
|
||||
@@ -507,7 +506,7 @@ void addTypes(Storage::Synchronization::Types &types,
|
||||
IsInsideProject isInsideProject,
|
||||
Internal::LastModule &lastQmlModule)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"add types", projectStorageUpdaterCategory()};
|
||||
NanotraceHR::Tracer tracer{"add types", category()};
|
||||
types.reserve(Utils::usize(objects) + types.size());
|
||||
|
||||
|
||||
@@ -531,7 +530,7 @@ void QmlTypesParser::parse(const QString &sourceContent,
|
||||
const Storage::Synchronization::DirectoryInfo &directoryInfo,
|
||||
IsInsideProject isInsideProject)
|
||||
{
|
||||
NanotraceHR::Tracer tracer{"qmltypes parser parse", projectStorageUpdaterCategory()};
|
||||
NanotraceHR::Tracer tracer{"qmltypes parser parse", category()};
|
||||
|
||||
lastQmlModule.name.clear();
|
||||
lastQmlModule.id = ModuleId{};
|
||||
|
@@ -68,34 +68,6 @@ Category &category()
|
||||
|
||||
} // namespace ModelTracing
|
||||
|
||||
namespace ProjectStorageTracing {
|
||||
|
||||
#ifdef ENABLE_PROJECT_STORAGE_TRACING
|
||||
|
||||
Category &projectStorageCategory()
|
||||
{
|
||||
thread_local Category category{"project storage",
|
||||
Tracing::eventQueueWithStringArguments(),
|
||||
Tracing::eventQueueWithoutArguments(),
|
||||
projectStorageCategory};
|
||||
|
||||
return category;
|
||||
}
|
||||
|
||||
Category &projectStorageUpdaterCategory()
|
||||
{
|
||||
thread_local Category category{"project storage updater",
|
||||
Tracing::eventQueueWithStringArguments(),
|
||||
Tracing::eventQueueWithoutArguments(),
|
||||
projectStorageCategory};
|
||||
|
||||
return category;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace ProjectStorageTracing
|
||||
|
||||
namespace SourcePathStorageTracing {
|
||||
|
||||
#ifdef ENABLE_SOURCE_PATH_STORAGE_TRACING
|
||||
|
@@ -48,34 +48,6 @@ inline Category category()
|
||||
|
||||
} // namespace ModelTracing
|
||||
|
||||
namespace ProjectStorageTracing {
|
||||
|
||||
#ifdef ENABLE_PROJECT_STORAGE_TRACING
|
||||
|
||||
using Category = NanotraceHR::EnabledCategory;
|
||||
|
||||
[[gnu::pure]] Category &projectStorageCategory();
|
||||
|
||||
[[gnu::pure]] Category &projectStorageUpdaterCategory();
|
||||
|
||||
#else
|
||||
|
||||
using Category = NanotraceHR::DisabledCategory;
|
||||
|
||||
inline Category projectStorageCategory()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
inline Category projectStorageUpdaterCategory()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace ProjectStorageTracing
|
||||
|
||||
namespace SourcePathStorageTracing {
|
||||
|
||||
#ifdef ENABLE_SOURCE_PATH_STORAGE_TRACING
|
||||
|
Reference in New Issue
Block a user