summaryrefslogtreecommitdiffstats
path: root/src/core/jobs/qthreadpooler_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2016-02-26 19:29:38 +0100
committerPaul Lemire <paul.lemire@kdab.com>2016-03-04 19:12:43 +0000
commit27d42a9894cdf31af5bf7c82343da9ea4ef3b64c (patch)
treed90064f8a377574989bf6099a5248f705b788d66 /src/core/jobs/qthreadpooler_p.h
parent52859382c900614a3a88eb3d7aa5af60d2d4a103 (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/qthreadpooler_p.h')
-rw-r--r--src/core/jobs/qthreadpooler_p.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/jobs/qthreadpooler_p.h b/src/core/jobs/qthreadpooler_p.h
index 2475841c0..6ae411d07 100644
--- a/src/core/jobs/qthreadpooler_p.h
+++ b/src/core/jobs/qthreadpooler_p.h
@@ -53,13 +53,17 @@
#include "task_p.h"
#include "dependencyhandler_p.h"
-
+#include "qaspectjob_p.h"
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include <QtCore/QFutureInterface>
#include <QtCore/QFuture>
#include <QThreadPool>
+#ifdef QT3D_JOBS_RUN_STATS
+#include <QElapsedTimer>
+#endif
+
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
@@ -79,6 +83,13 @@ public:
void setDependencyHandler(DependencyHandler *handler);
int maxThreadCount() const;
+#ifdef QT3D_JOBS_RUN_STATS
+ static QElapsedTimer m_jobsStatTimer;
+
+ static void addJobLogStatsEntry(JobRunStats &stats);
+ static void starNewFrameJobLogsStats();
+ static void writeFrameJobLogStats();
+#endif
private:
void enqueueTasks(const QVector<RunnableInterface *> &tasks);