diff options
author | Paul Lemire <paul.lemire350@gmail.com> | 2016-02-26 19:29:38 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-03-04 19:12:43 +0000 |
commit | 27d42a9894cdf31af5bf7c82343da9ea4ef3b64c (patch) | |
tree | d90064f8a377574989bf6099a5248f705b788d66 /src/core/jobs/qaspectjob_p.h | |
parent | 52859382c900614a3a88eb3d7aa5af60d2d4a103 (diff) |
Qt3D job run stats
Add a way to write to a trace.qt3d file stats about the frame jobs
Then use the qt3dprofiler tool to visualize the trace file
This is enabled by defining QT3D_JOBS_RUN_STATS at compile time
Change-Id: I4d2faaf5189cd91ecc88b7ca0ca3e3e1f2f60498
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/jobs/qaspectjob_p.h')
-rw-r--r-- | src/core/jobs/qaspectjob_p.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/core/jobs/qaspectjob_p.h b/src/core/jobs/qaspectjob_p.h index 8de27c004..df788c091 100644 --- a/src/core/jobs/qaspectjob_p.h +++ b/src/core/jobs/qaspectjob_p.h @@ -51,8 +51,8 @@ // We mean it. // -#include <QtGlobal> #include <QWeakPointer> +#include <Qt3DCore/private/qt3dcore_global_p.h> QT_BEGIN_NAMESPACE @@ -60,12 +60,45 @@ namespace Qt3DCore { class QAspectJob; -class QAspectJobPrivate +#ifdef QT3D_JOBS_RUN_STATS +struct FrameHeader +{ + quint32 frameId; + quint32 jobCount; +}; + +union JobId +{ + quint32 typeAndInstance[2]; + quint64 id; +}; + +struct JobRunStats +{ + JobRunStats() + { + jobId.id = 0; + } + + qint64 startTime; + qint64 endTime; + JobId jobId; + // QAspectJob subclasses should properly populate the jobId + quint64 threadId; +}; +#endif + +class QT3DCORE_PRIVATE_EXPORT QAspectJobPrivate { public: QAspectJobPrivate(); + static QAspectJobPrivate *get(QAspectJob *job); + QVector<QWeakPointer<QAspectJob> > m_dependencies; +#ifdef QT3D_JOBS_RUN_STATS + JobRunStats m_stats; +#endif }; } // Qt3D |