summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2019-03-27 13:56:57 +0100
committerMilian Wolff <milian.wolff@kdab.com>2019-04-05 11:57:52 +0000
commit127518deda5a05fda2ce24be98aaaeb7b975f163 (patch)
treec7d48589a50e065e47838928578737eed0a6359c /src/gui
parent5f62202e6c89269da3e9faaea4c88d0f19416cc1 (diff)
Introduce Q_TRACE_SCOPE to simplify tracing of a function entry/exit
Additionally, we also add a Q_TRACE_EXIT which runs a trace point when the scope is exited, leveraging qScopeGuard behind the scenes. Q_TRACE_SCOPE uses Q_TRACE_EXIT internally - the difference is that the _SCOPE version enforces the naming scheme of _entry / _exit for the tracepoints, whereas Q_TRACE_EXIT can be used generically. Change-Id: I4a2f5ea09f451fcf664d07fd493b679f7527ac06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index fd01f8bb7b..424af20f26 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1421,7 +1421,7 @@ void QGuiApplicationPrivate::eventDispatcherReady()
void QGuiApplicationPrivate::init()
{
- Q_TRACE(QGuiApplicationPrivate_init_entry);
+ Q_TRACE_SCOPE(QGuiApplicationPrivate_init);
#if defined(Q_OS_MACOS)
QMacAutoReleasePool pool;
@@ -1585,8 +1585,6 @@ void QGuiApplicationPrivate::init()
if (!QGuiApplicationPrivate::displayName)
QObject::connect(q, &QGuiApplication::applicationNameChanged,
q, &QGuiApplication::applicationDisplayNameChanged);
-
- Q_TRACE(QGuiApplicationPrivate_init_exit);
}
extern void qt_cleanupFontDatabase();
@@ -1830,7 +1828,7 @@ bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArra
void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
{
- Q_TRACE(QGuiApplicationPrivate_processWindowSystemEvent_entry, e->type);
+ Q_TRACE_SCOPE(QGuiApplicationPrivate_processWindowSystemEvent, e->type);
switch(e->type) {
case QWindowSystemInterfacePrivate::Mouse:
@@ -1940,8 +1938,6 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
qWarning() << "Unknown user input event type:" << e->type;
break;
}
-
- Q_TRACE(QGuiApplicationPrivate_processWindowSystemEvent_exit, e->type);
}
/*! \internal