summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2019-04-29 10:39:37 +0200
committerMilian Wolff <milian.wolff@kdab.com>2019-05-02 14:15:58 +0000
commit75634c9a53133d03c245bbaab4b2047ff823ef03 (patch)
tree74406887d0f6df5b2f56618f75c001ce5e7f19be /src/widgets/kernel
parentbfe8b506c7d28538430d9e036f14b074cf52762a (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index fdece8414c..c3e10063e1 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3697,14 +3697,17 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
// to the ones in QCoreApplicationPrivate::notify_helper; the reason for their
// duplication is because tracepoint symbols are not exported by QtCore.
// If you adjust the tracepoints here, consider adjusting QCoreApplicationPrivate too.
- Q_TRACE_SCOPE(QApplication_notify, receiver, e, e->type());
+ Q_TRACE(QApplication_notify_entry, receiver, e, e->type());
+ bool consumed = false;
+ bool filtered = false;
+ Q_TRACE_EXIT(QApplication_notify_exit, consumed, filtered);
// send to all application event filters
if (threadRequiresCoreApplication()
&& receiver->d_func()->threadData->thread == mainThread()
&& sendThroughApplicationEventFilters(receiver, e)) {
- Q_TRACE(QApplication_notify_event_filtered, receiver, e, e->type());
- return true;
+ filtered = true;
+ return filtered;
}
if (receiver->isWidgetType()) {
@@ -3726,16 +3729,12 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
// send to all receiver event filters
if (sendThroughObjectEventFilters(receiver, e)) {
- Q_TRACE(QApplication_notify_event_filtered, receiver, e, e->type());
- return true;
+ filtered = true;
+ return filtered;
}
- Q_TRACE(QApplication_notify_before_delivery, receiver, e, e->type());
-
// deliver the event
- const bool consumed = receiver->event(e);
-
- Q_TRACE(QApplication_notify_after_delivery, receiver, e, e->type(), consumed);
+ consumed = receiver->event(e);
QCoreApplicationPrivate::setEventSpontaneous(e, false);
return consumed;