diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3fd80a259d..79d313ce32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,9 +43,6 @@ endif() qt_install_3rdparty_library_wrap_config_extra_file(BundledZLIB) add_subdirectory(corelib) -if (QT_FEATURE_ctf AND QT_FEATURE_library) - add_subdirectory(corelib/tracing) -endif() # Needs to be after corelib, because some of them reference Core. add_subdirectory(3rdparty) diff --git a/src/corelib/tracing/qctf.cpp b/src/corelib/tracing/qctf.cpp index 22bb587acd..1dafa582d9 100644 --- a/src/corelib/tracing/qctf.cpp +++ b/src/corelib/tracing/qctf.cpp @@ -8,7 +8,7 @@ #include #include -#include "qctflib_p.h" +#include "qctf_p.h" QT_BEGIN_NAMESPACE diff --git a/src/corelib/tracing/qctf_p.h b/src/corelib/tracing/qctf_p.h index b2f822e337..8bd4a218c0 100644 --- a/src/corelib/tracing/qctf_p.h +++ b/src/corelib/tracing/qctf_p.h @@ -17,6 +17,7 @@ // #include +#include QT_REQUIRE_CONFIG(library); @@ -220,6 +221,17 @@ inline QByteArray toByteArrayFromFlags(QFlags value) #endif +class Q_CORE_EXPORT QCtfLib : public QObject +{ + Q_OBJECT +public: + virtual ~QCtfLib() = default; + virtual bool tracepointEnabled(const QCtfTracePointEvent &point) = 0; + virtual void doTracepoint(const QCtfTracePointEvent &point, const QByteArray &arr) = 0; + virtual bool sessionEnabled() = 0; + virtual QCtfTracePointPrivate *initializeTracepoint(const QCtfTracePointEvent &point) = 0; +}; + QT_END_NAMESPACE #endif diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 308aa800bd..dc7c45c2d8 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -25,3 +25,6 @@ if (TARGET Qt::Network) add_subdirectory(networkinformation) add_subdirectory(tls) endif() +if (QT_FEATURE_ctf AND QT_FEATURE_library) + add_subdirectory(tracing) +endif() diff --git a/src/corelib/tracing/CMakeLists.txt b/src/plugins/tracing/CMakeLists.txt similarity index 95% rename from src/corelib/tracing/CMakeLists.txt rename to src/plugins/tracing/CMakeLists.txt index c872360978..9840b59ecd 100644 --- a/src/corelib/tracing/CMakeLists.txt +++ b/src/plugins/tracing/CMakeLists.txt @@ -18,6 +18,6 @@ qt_internal_add_plugin(QCtfTracePlugin SOURCES qctflib_p.h qctflib.cpp metadata_template.txt qctfplugin.cpp qctfplugin_p.h LIBRARIES - Qt6::Core + Qt6::Core Qt6::CorePrivate ) diff --git a/src/corelib/tracing/metadata_template.txt b/src/plugins/tracing/metadata_template.txt similarity index 100% rename from src/corelib/tracing/metadata_template.txt rename to src/plugins/tracing/metadata_template.txt diff --git a/src/corelib/tracing/qctflib.cpp b/src/plugins/tracing/qctflib.cpp similarity index 100% rename from src/corelib/tracing/qctflib.cpp rename to src/plugins/tracing/qctflib.cpp diff --git a/src/corelib/tracing/qctflib_p.h b/src/plugins/tracing/qctflib_p.h similarity index 99% rename from src/corelib/tracing/qctflib_p.h rename to src/plugins/tracing/qctflib_p.h index 4ad386e209..081dda1d04 100644 --- a/src/corelib/tracing/qctflib_p.h +++ b/src/plugins/tracing/qctflib_p.h @@ -16,7 +16,7 @@ // // -#include "qctf_p.h" +#include #include "qctfplugin_p.h" #include #include diff --git a/src/corelib/tracing/qctfplugin.cpp b/src/plugins/tracing/qctfplugin.cpp similarity index 96% rename from src/corelib/tracing/qctfplugin.cpp rename to src/plugins/tracing/qctfplugin.cpp index db052fa6e0..8f2245bb28 100644 --- a/src/corelib/tracing/qctfplugin.cpp +++ b/src/plugins/tracing/qctfplugin.cpp @@ -8,7 +8,7 @@ QT_BEGIN_NAMESPACE -class QCtfTracePlugin : public QObject, public QCtfLib +class QCtfTracePlugin : public QCtfLib { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QCtfLib" FILE "trace.json") diff --git a/src/corelib/tracing/qctfplugin_p.h b/src/plugins/tracing/qctfplugin_p.h similarity index 53% rename from src/corelib/tracing/qctfplugin_p.h rename to src/plugins/tracing/qctfplugin_p.h index d09e0404e4..987c4d925f 100644 --- a/src/corelib/tracing/qctfplugin_p.h +++ b/src/plugins/tracing/qctfplugin_p.h @@ -16,22 +16,12 @@ // // -#include "qctf_p.h" +#include #include QT_BEGIN_NAMESPACE -class QCtfLib -{ -public: - virtual ~QCtfLib() = default; - virtual bool tracepointEnabled(const QCtfTracePointEvent &point) = 0; - virtual void doTracepoint(const QCtfTracePointEvent &point, const QByteArray &arr) = 0; - virtual bool sessionEnabled() = 0; - virtual QCtfTracePointPrivate *initializeTracepoint(const QCtfTracePointEvent &point) = 0; -}; - -Q_DECLARE_INTERFACE(QCtfLib, "org.qt-project.Qt.QCtfLib"); +Q_DECLARE_INTERFACE(QCtfLib, "org.qt-project.Qt.QCtfLib") QT_END_NAMESPACE diff --git a/src/corelib/tracing/trace.json b/src/plugins/tracing/trace.json similarity index 100% rename from src/corelib/tracing/trace.json rename to src/plugins/tracing/trace.json