Trace: Convert qtcore module to use tracepointgen tool

Change-Id: I379896280a16cd0b94d7ee9d0cfcca4afe64b9fe
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
(cherry picked from commit 4ce1c1d93252c0fbe8224faf7416b8e5a5a21d76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Antti Määttä 2023-01-27 08:10:01 +02:00 committed by Qt Cherry-pick Bot
parent 0fd4dd9f68
commit 22dad3f83c
7 changed files with 48 additions and 2 deletions

View File

@ -1406,7 +1406,15 @@ if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET)
endif()
# special case end
qt_internal_create_tracepoints(Core qtcore.tracepoints)
qt_internal_generate_tracepoints(Core core
SOURCES
kernel/qcoreapplication.cpp
kernel/qcoreevent.cpp
kernel/qobject.cpp
plugin/qfactoryloader.cpp
plugin/qlibrary.cpp
global/qlogging.cpp
)
qt_internal_add_docs(Core
doc/qtcore.qdocconf
)

View File

@ -129,6 +129,10 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#ifndef QT_BOOTSTRAPPED
Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const char *function, const char *file, int line, const QString &message);
#endif
/*!
\headerfile <QtLogging>
\inmodule QtCore

View File

@ -108,6 +108,21 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_TRACE_PREFIX(qtcore,
"QT_BEGIN_NAMESPACE" \
"class QEvent;" \
"QT_END_NAMESPACE"
);
Q_TRACE_METADATA(qtcore, "ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;");
Q_TRACE_POINT(qtcore, QCoreApplication_postEvent_entry, QObject *receiver, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QCoreApplication_postEvent_exit);
Q_TRACE_POINT(qtcore, QCoreApplication_postEvent_event_compressed, QObject *receiver, QEvent *event);
Q_TRACE_POINT(qtcore, QCoreApplication_postEvent_event_posted, QObject *receiver, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QCoreApplication_sendEvent, QObject *receiver, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QCoreApplication_sendSpontaneousEvent, QObject *receiver, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QCoreApplication_notify_entry, QObject *receiver, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QCoreApplication_notify_exit, bool consumed, bool filtered);
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
extern QString qAppFileName();
#endif
@ -769,7 +784,7 @@ QCoreApplication::QCoreApplication(int &argc, char **argv
\value ApplicationFlags QT_VERSION
*/
void QCoreApplicationPrivate::init()
void Q_TRACE_INSTRUMENT(qtcore) QCoreApplicationPrivate::init()
{
Q_TRACE_SCOPE(QCoreApplicationPrivate_init);

View File

@ -14,6 +14,9 @@
QT_BEGIN_NAMESPACE
Q_TRACE_POINT(qtcore, QEvent_ctor, QEvent *event, QEvent::Type type);
Q_TRACE_POINT(qtcore, QEvent_dtor, QEvent *event, QEvent::Type type);
/*!
\class QEvent
\inmodule QtCore

View File

@ -43,6 +43,17 @@
QT_BEGIN_NAMESPACE
Q_TRACE_POINT(qtcore, QObject_ctor, QObject *object);
Q_TRACE_POINT(qtcore, QObject_dtor, QObject *object);
Q_TRACE_POINT(qtcore, QMetaObject_activate_entry, QObject *sender, int signalIndex);
Q_TRACE_POINT(qtcore, QMetaObject_activate_exit);
Q_TRACE_POINT(qtcore, QMetaObject_activate_slot_entry, QObject *receiver, int slotIndex);
Q_TRACE_POINT(qtcore, QMetaObject_activate_slot_exit);
Q_TRACE_POINT(qtcore, QMetaObject_activate_slot_functor_entry, void *slotObject);
Q_TRACE_POINT(qtcore, QMetaObject_activate_slot_functor_exit);
Q_TRACE_POINT(qtcore, QMetaObject_activate_declarative_signal_entry, QObject *sender, int signalIndex);
Q_TRACE_POINT(qtcore, QMetaObject_activate_declarative_signal_exit);
static int DIRECT_CONNECTION_ONLY = 0;
Q_LOGGING_CATEGORY(lcConnectSlotsByName, "qt.core.qmetaobject.connectslotsbyname")

View File

@ -36,6 +36,8 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_TRACE_POINT(qtcore, QFactoryLoader_update, const QString &fileName);
bool QPluginParsedMetaData::parse(QByteArrayView raw)
{
QPluginMetaData::Header header;

View File

@ -34,6 +34,9 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
Q_TRACE_POINT(qtcore, QLibraryPrivate_load_entry, const QString &fileName);
Q_TRACE_POINT(qtcore, QLibraryPrivate_load_exit, bool success);
// On Unix systema and on Windows with MinGW, we can mix and match debug and
// release plugins without problems. (unless compiled in debug-and-release mode
// - why?)