diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2018-05-09 20:52:29 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2018-06-28 20:40:33 +0000 |
commit | dbcaa6d01ed6fd510f8b36bbe69fc1c9d8e21d88 (patch) | |
tree | 39b531e90e0d717562705db6ca68172b3e31d4f1 /src/corelib/kernel/qcoreevent.cpp | |
parent | 5e39b832e23889af0a5d39586fd3ccf0b1882667 (diff) |
Tracepoints: add tracing for QEvents
Add tracepoints in all the main codepaths for event handling:
* QEvent ctors/dtor
* QCoreApplication::postEvent, sendEvent and sendSpontaneousEvent
* QCoreApplication / QApplication::notify, and around the handling
of event filters as well
I'm switching the name of the tracepoints themselves to have the
very same casing of the functions in Qt's own source code, this
improves readability a lot. The pre-existing ones will be changed
in an upcoming patch.
Change-Id: Iae2ba2bfdd76a82c85445bb5b86434e910427a70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qcoreevent.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreevent.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 58ca8279ea..e34fe3f955 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -44,6 +44,8 @@ #include "qbasicatomic.h" +#include <qtcore_tracepoints_p.h> + #include <limits> QT_BEGIN_NAMESPACE @@ -288,7 +290,9 @@ QT_BEGIN_NAMESPACE */ QEvent::QEvent(Type type) : d(0), t(type), posted(false), spont(false), m_accept(true) -{} +{ + Q_TRACE(QEvent_ctor, this, t); +} /*! \internal @@ -301,6 +305,7 @@ QEvent::QEvent(const QEvent &other) : d(other.d), t(other.t), posted(other.posted), spont(other.spont), m_accept(other.m_accept) { + Q_TRACE(QEvent_ctor, this, t); // if QEventPrivate becomes available, make sure to implement a // virtual QEventPrivate *clone() const; function so we can copy here Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); @@ -333,6 +338,7 @@ QEvent &QEvent::operator=(const QEvent &other) QEvent::~QEvent() { + Q_TRACE(QEvent_dtor, this, t); if (posted && QCoreApplication::instance()) QCoreApplicationPrivate::removePostedEvent(this); Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); |