Skip to content

Commit

Permalink
Move CTF tracing plugin to plugins directory
Browse files Browse the repository at this point in the history
A coming change to support streaming requires networking so having it
in corelib is dubious.

Pick-to: 6.5
Change-Id: Idc25abe23b5ed07823d749294796c9f318ef1744
Reviewed-by: Hatem ElKharashy <[email protected]>
Reviewed-by: Tomi Korpipää <[email protected]>
Reviewed-by: Janne Koskinen <[email protected]>
  • Loading branch information
anttimaa committed Mar 21, 2023
1 parent 643b6e5 commit aed3de3
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 19 deletions.
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/tracing/qctf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <qfileinfo.h>
#include <qdir.h>

#include "qctflib_p.h"
#include "qctf_p.h"

QT_BEGIN_NAMESPACE

Expand Down
12 changes: 12 additions & 0 deletions src/corelib/tracing/qctf_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

#include <qtcoreexports.h>
#include <qobject.h>

QT_REQUIRE_CONFIG(library);

Expand Down Expand Up @@ -220,6 +221,17 @@ inline QByteArray toByteArrayFromFlags(QFlags<T> 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
3 changes: 3 additions & 0 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
//

#include "qctf_p.h"
#include <private/qctf_p.h>
#include "qctfplugin_p.h"
#include <qstring.h>
#include <qmutex.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,12 @@
//
//

#include "qctf_p.h"
#include <private/qctf_p.h>
#include <qplugin.h>

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

Expand Down
File renamed without changes.

0 comments on commit aed3de3

Please sign in to comment.