diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2019-03-27 13:56:57 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2019-04-05 11:57:52 +0000 |
commit | 127518deda5a05fda2ce24be98aaaeb7b975f163 (patch) | |
tree | c7d48589a50e065e47838928578737eed0a6359c /src/corelib/kernel/qcoreapplication.cpp | |
parent | 5f62202e6c89269da3e9faaea4c88d0f19416cc1 (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/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 6d7985c91b..d173ec029b 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -778,7 +778,7 @@ QCoreApplication::QCoreApplication(int &argc, char **argv void QCoreApplicationPrivate::init() { - Q_TRACE(QCoreApplicationPrivate_init_entry); + Q_TRACE_SCOPE(QCoreApplicationPrivate_init); #if defined(Q_OS_MACOS) QMacAutoReleasePool pool; @@ -883,8 +883,6 @@ void QCoreApplicationPrivate::init() #ifndef QT_NO_QOBJECT is_app_running = true; // No longer starting up. #endif - - Q_TRACE(QCoreApplicationPrivate_init_exit); } /*! |