QmlDesiger: Add tracing to meta info

Change-Id: I0ef7b061c729e6ad161db77a03f375f4452ad273
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2024-04-04 13:45:51 +02:00
parent 1cc99b996a
commit 31aec73423
4 changed files with 1242 additions and 241 deletions

View File

@@ -27,6 +27,10 @@ env_with_default("QTC_ENABLE_MODEL_TRACING" ENV_QTC_ENABLE_MODEL_TRACING OFF)
option(ENABLE_MODEL_TRACING "Enable model tracing" ${ENV_QTC_ENABLE_MODEL_TRACING}) option(ENABLE_MODEL_TRACING "Enable model tracing" ${ENV_QTC_ENABLE_MODEL_TRACING})
add_feature_info("Model tracing" ${ENABLE_MODEL_TRACING} "") add_feature_info("Model tracing" ${ENABLE_MODEL_TRACING} "")
env_with_default("QTC_ENABLE_METAINFO_TRACING" ENV_QTC_ENABLE_METAINFO_TRACING OFF)
option(ENABLE_METAINFO_TRACING "Enable meta info tracing" ${ENV_QTC_ENABLE_METAINFO_TRACING})
add_feature_info("Meta info tracing" ${ENABLE_METAINFO_TRACING} "")
add_qtc_library(QmlDesignerUtils STATIC add_qtc_library(QmlDesignerUtils STATIC
DEPENDS DEPENDS
Qt::Gui Utils Qt::QmlPrivate Qt::Gui Utils Qt::QmlPrivate
@@ -99,7 +103,7 @@ add_qtc_library(QmlDesignerCore STATIC
) )
extend_qtc_library(QmlDesignerCore extend_qtc_library(QmlDesignerCore
CONDITION ENABLE_PROJECT_STORAGE_TRACING OR ENABLE_IMAGE_CACHE_TRACING OR ENABLE_MODEL_TRACING CONDITION ENABLE_PROJECT_STORAGE_TRACING OR ENABLE_IMAGE_CACHE_TRACING OR ENABLE_MODEL_TRACING OR ENABLE_METAINFO_TRACING
PUBLIC_DEPENDS Nanotrace PUBLIC_DEPENDS Nanotrace
PUBLIC_DEFINES PUBLIC_DEFINES
ENABLE_QMLDESIGNER_TRACING ENABLE_QMLDESIGNER_TRACING
@@ -107,6 +111,7 @@ extend_qtc_library(QmlDesignerCore
$<$<BOOL:${ENABLE_PROJECT_STORAGE_TRACING}>:ENABLE_PROJECT_STORAGE_TRACING> $<$<BOOL:${ENABLE_PROJECT_STORAGE_TRACING}>:ENABLE_PROJECT_STORAGE_TRACING>
$<$<BOOL:${ENABLE_IMAGE_CACHE_TRACING}>:ENABLE_IMAGE_CACHE_TRACING> $<$<BOOL:${ENABLE_IMAGE_CACHE_TRACING}>:ENABLE_IMAGE_CACHE_TRACING>
$<$<BOOL:${ENABLE_MODEL_TRACING}>:ENABLE_MODEL_TRACING> $<$<BOOL:${ENABLE_MODEL_TRACING}>:ENABLE_MODEL_TRACING>
$<$<BOOL:${ENABLE_METAINFO_TRACING}>:ENABLE_METAINFO_TRACING>
) )
extend_qtc_library(QmlDesignerCore extend_qtc_library(QmlDesignerCore

File diff suppressed because it is too large Load Diff

View File

@@ -88,4 +88,13 @@ Category &projectStorageUpdaterCategory()
} // namespace ProjectStorageTracing } // namespace ProjectStorageTracing
namespace MetaInfoTracing {
Category &category()
{
thread_local Category category_{"meta info"_t, Tracing::eventQueueWithStringArguments(), category};
return category_;
}
} // namespace MetaInfoTracing
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -62,4 +62,20 @@ using Category = NanotraceHR::StringViewWithStringArgumentsCategory<projectStora
[[gnu::pure]] Category &projectStorageUpdaterCategory(); [[gnu::pure]] Category &projectStorageUpdaterCategory();
} // namespace ProjectStorageTracing } // namespace ProjectStorageTracing
namespace MetaInfoTracing {
constexpr NanotraceHR::Tracing tracingStatus()
{
#ifdef ENABLE_METAINFO_TRACING
return NanotraceHR::Tracing::IsEnabled;
#else
return NanotraceHR::Tracing::IsDisabled;
#endif
}
using Category = NanotraceHR::StringViewWithStringArgumentsCategory<tracingStatus()>;
[[gnu::pure]] Category &category();
} // namespace MetaInfoTracing
} // namespace QmlDesigner } // namespace QmlDesigner