From 75634c9a53133d03c245bbaab4b2047ff823ef03 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Mon, 29 Apr 2019 10:39:37 +0200 Subject: Reduce amount of tracepoints required for event tracking Encode the consumed/filtered state in the _exit tracepoint and remove the separate tracking of receiver event handling. Combined, this reduces the size of the trace file. Change-Id: Icb3cb2dd47798543905cea450046d6fad559a15b Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 596941b5a9..e5f39a8d35 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1197,28 +1197,26 @@ bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event) { // Note: when adjusting the tracepoints in here // consider adjusting QApplicationPrivate::notify_helper too. - Q_TRACE_SCOPE(QCoreApplication_notify, receiver, event, event->type()); + Q_TRACE(QCoreApplication_notify_entry, receiver, event, event->type()); + bool consumed = false; + bool filtered = false; + Q_TRACE_EXIT(QCoreApplication_notify_exit, consumed, filtered); // send to all application event filters (only does anything in the main thread) if (QCoreApplication::self && receiver->d_func()->threadData->thread == mainThread() && QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event)) { - Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type()); - return true; + filtered = true; + return filtered; } // send to all receiver event filters if (sendThroughObjectEventFilters(receiver, event)) { - Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type()); - return true; + filtered = true; + return filtered; } - Q_TRACE(QCoreApplication_notify_before_delivery, receiver, event, event->type()); - // deliver the event - const bool consumed = receiver->event(event); - - Q_TRACE(QCoreApplication_notify_after_delivery, receiver, event, event->type(), consumed); - + consumed = receiver->event(event); return consumed; } -- cgit v1.2.3