Tracepoints: trace QObject construction and destruction

Change-Id: I10f5ef391a2d3059ed5e8a26afe5e191adc31e85
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
Giuseppe D'Angelo 2018-06-18 17:46:44 +02:00
parent 222e85d434
commit 5e5072c654
2 changed files with 8 additions and 0 deletions

View File

@ -64,6 +64,7 @@
#include <private/qorderedmutexlocker_p.h>
#include <private/qhooks_p.h>
#include <qtcore_tracepoints_p.h>
#include <new>
@ -820,6 +821,7 @@ QObject::QObject(QObject *parent)
#endif
if (Q_UNLIKELY(qtHookData[QHooks::AddQObject]))
reinterpret_cast<QHooks::AddQObjectCallback>(qtHookData[QHooks::AddQObject])(this);
Q_TRACE(QObject_ctor, this);
}
/*!
@ -855,6 +857,7 @@ QObject::QObject(QObjectPrivate &dd, QObject *parent)
#endif
if (Q_UNLIKELY(qtHookData[QHooks::AddQObject]))
reinterpret_cast<QHooks::AddQObjectCallback>(qtHookData[QHooks::AddQObject])(this);
Q_TRACE(QObject_ctor, this);
}
/*!
@ -1030,6 +1033,8 @@ QObject::~QObject()
if (Q_UNLIKELY(qtHookData[QHooks::RemoveQObject]))
reinterpret_cast<QHooks::RemoveQObjectCallback>(qtHookData[QHooks::RemoveQObject])(this);
Q_TRACE(QObject_dtor, this);
if (d->parent) // remove it from parent object
d->setParent_helper(0);
}

View File

@ -20,3 +20,6 @@ QCoreApplication_notify_entry(QObject *receiver, QEvent *event, int type)
QCoreApplication_notify_event_filtered(QObject *receiver, QEvent *event, int type)
QCoreApplication_notify_before_delivery(QObject *receiver, QEvent *event, int type)
QCoreApplication_notify_after_delivery(QObject *receiver, QEvent *event, int type, bool consumed)
QObject_ctor(QObject *object)
QObject_dtor(QObject *object)