QmlDesigner: Introduce extra tracing file for source path storage

That is reducing dependecies and compilation time.

Change-Id: I31acc6df4175dc42c9b11c5c69b970e1b5e71a4a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2025-06-19 11:00:37 +02:00
parent cc2a83f532
commit ae881c4799
8 changed files with 65 additions and 43 deletions

View File

@@ -360,6 +360,8 @@ extend_qtc_library(QmlDesignerCore
sourcepathexceptions.h
sourcepathstorage.cpp
sourcepathstorage.h
sourcepathstoragetracing.cpp
sourcepathstoragetracing.h
sourcepathview.h
storagecache.h
storagecacheentry.h

View File

@@ -3,7 +3,7 @@
#include "sourcepathexceptions.h"
#include <tracing/qmldesignertracing.h>
#include "sourcepathstoragetracing.h"
namespace QmlDesigner {

View File

@@ -4,8 +4,7 @@
#include "sourcepathstorage.h"
#include "sourcepathexceptions.h"
#include <tracing/qmldesignertracing.h>
#include "sourcepathstoragetracing.h"
namespace QmlDesigner {

View File

@@ -0,0 +1,29 @@
// 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 "sourcepathstoragetracing.h"
#include <sqlitebasestatement.h>
namespace QmlDesigner::SourcePathStorageTracing {
using namespace NanotraceHR::Literals;
#ifdef ENABLE_SOURCE_PATH_STORAGE_TRACING
namespace {
thread_local Category category_{"source path storage",
Tracing::eventQueueWithStringArguments(),
Tracing::eventQueueWithoutArguments(),
category};
} // namespace
Category &category()
{
return category_;
}
#endif
} // namespace QmlDesigner::SourcePathStorageTracing

View File

@@ -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::SourcePathStorageTracing {
#ifdef ENABLE_SOURCE_PATH_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::SourcePathStorageTracing

View File

@@ -4,11 +4,10 @@
#pragma once
#include "nonlockingmutex.h"
#include "sourcepathstoragetracing.h"
#include "storagecacheentry.h"
#include "storagecachefwd.h"
#include <tracing/qmldesignertracing.h>
#include <sourcepathids.h>
#include <utils/algorithm.h>

View File

@@ -68,22 +68,4 @@ Category &category()
} // namespace ModelTracing
namespace SourcePathStorageTracing {
#ifdef ENABLE_SOURCE_PATH_STORAGE_TRACING
Category &category()
{
thread_local Category category_{"source path storage",
Tracing::eventQueueWithStringArguments(),
Tracing::eventQueueWithoutArguments(),
category};
return category_;
}
#endif
} // namespace SourcePathStorageTracing
} // namespace QmlDesigner

View File

@@ -48,23 +48,4 @@ inline Category category()
} // namespace ModelTracing
namespace SourcePathStorageTracing {
#ifdef ENABLE_SOURCE_PATH_STORAGE_TRACING
using Category = NanotraceHR::EnabledCategory;
[[gnu::pure]] QMLDESIGNERCORE_EXPORT Category &category();
#else
using Category = NanotraceHR::DisabledCategory;
inline Category category()
{
return {};
}
#endif
} // namespace SourcePathStorageTracing
} // namespace QmlDesigner