diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2019-10-11 18:10:29 +0200 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2019-12-13 17:43:08 +0100 |
commit | 3ea16d737b8b3750c0c8d2d4bf2c8bb24037329c (patch) | |
tree | 7c3bdd582eb9ab429b3d438ef5d3adf85126b323 /src/quick/scenegraph/qsgrenderloop.cpp | |
parent | 8acbfa1553277d6ca140940c5f196095844048a8 (diff) |
Add trace points for Qt Quick Scene Graph
This adds Q_TRACE tracepoints for all places that are covered by
the QML profiler's QSG integration. The big advantage over the
existing framework is that these trace points can be visualized
next to other system tracepoints to correlate the data better with
load and resource consumption induced by other processes on the
system.
Change-Id: I0c5b70a0870f0b89e4533c351c099e13fd18a55f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index fb460f28d6..94f15b55d4 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -60,6 +60,7 @@ #include <QtQuick/private/qsgcontext_p.h> #include <QtQuick/private/qsgrenderer_p.h> #include <private/qquickprofiler_p.h> +#include <qtquick_tracepoints_p.h> #include <private/qsgrhishadereffectnode_p.h> @@ -680,20 +681,25 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) return; } + Q_TRACE_SCOPE(QSG_renderWindow); QElapsedTimer renderTimer; qint64 renderTime = 0, syncTime = 0, polishTime = 0; bool profileFrames = QSG_LOG_TIME_RENDERLOOP().isDebugEnabled(); if (profileFrames) renderTimer.start(); + Q_TRACE(QSG_polishItems_entry); Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphPolishFrame); cd->polishItems(); if (profileFrames) polishTime = renderTimer.nsecsElapsed(); + + Q_TRACE(QSG_polishItems_exit); Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame, QQuickProfiler::SceneGraphRenderLoopFrame, QQuickProfiler::SceneGraphPolishPolish); + Q_TRACE(QSG_sync_entry); emit window->afterAnimating(); @@ -748,15 +754,20 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) if (profileFrames) syncTime = renderTimer.nsecsElapsed(); + + Q_TRACE(QSG_sync_exit); Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame, QQuickProfiler::SceneGraphRenderLoopSync); + Q_TRACE(QSG_render_entry); cd->renderSceneGraph(window->size(), effectiveOutputSize); if (profileFrames) renderTime = renderTimer.nsecsElapsed(); + Q_TRACE(QSG_render_exit); Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame, QQuickProfiler::SceneGraphRenderLoopRender); + Q_TRACE(QSG_swap_entry); if (data.grabOnly) { const bool alpha = window->format().alphaBufferSize() > 0 && window->color().alpha() != 255; @@ -790,6 +801,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) qint64 swapTime = 0; if (profileFrames) swapTime = renderTimer.nsecsElapsed(); + + Q_TRACE(QSG_swap_exit); Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame, QQuickProfiler::SceneGraphRenderLoopSwap); |