Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickprofiler.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | QQuickProfiler *QQuickProfiler::s_instance = nullptr; | - | ||||||
8 | quint64 QQuickProfiler::featuresEnabled = 0; | - | ||||||
9 | - | |||||||
10 | void QQuickProfiler::initialize(QObject *parent) | - | ||||||
11 | { | - | ||||||
12 | ((s_instance == nullptr) ? static_cast<void>(0) : qt_assert("s_instance == nullptr", __FILE__, 55)); | - | ||||||
13 | s_instance = new QQuickProfiler(parent); | - | ||||||
14 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
15 | - | |||||||
16 | void animationTimerCallback(qint64 delta) | - | ||||||
17 | { | - | ||||||
18 | if (QQuickProfiler::featuresEnabled & (1 << QQuickProfiler::ProfileAnimations)
executed 6 times by 1 test: else (end of block Executed by:
never executed: void)0(void)0 ; never executed: (void)0 ; | 0-6 | ||||||
19 | 0 | |||||||
20 | ; never executed: (void)0 ; | 0 | ||||||
21 | } | - | ||||||
22 | - | |||||||
23 | void QQuickProfiler::registerAnimationCallback() | - | ||||||
24 | { | - | ||||||
25 | QUnifiedTimer::instance()->registerProfilerCallback(&animationTimerCallback); | - | ||||||
26 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
27 | - | |||||||
28 | class CallbackRegistrationHelper : public QObject { | - | ||||||
29 | public: | - | ||||||
30 | #pragma GCC diagnostic push | - | ||||||
31 | - | |||||||
32 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
33 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - | ||||||
34 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
35 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
36 | #pragma GCC diagnostic pop | - | ||||||
37 | struct QPrivateSignal {}; | - | ||||||
38 | public: | - | ||||||
39 | void registerAnimationTimerCallback() | - | ||||||
40 | { | - | ||||||
41 | QQuickProfiler::registerAnimationCallback(); | - | ||||||
42 | delete this; | - | ||||||
43 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
44 | }; | - | ||||||
45 | - | |||||||
46 | - | |||||||
47 | QQuickProfiler::QQuickProfiler(QObject *parent) : QObject(parent) | - | ||||||
48 | { | - | ||||||
49 | - | |||||||
50 | m_timer.start(); | - | ||||||
51 | CallbackRegistrationHelper *helper = new CallbackRegistrationHelper; | - | ||||||
52 | helper->moveToThread(QCoreApplication::instance()->thread()); | - | ||||||
53 | - | |||||||
54 | - | |||||||
55 | QObject signalSource; | - | ||||||
56 | connect(&signalSource, &QObject::destroyed, | - | ||||||
57 | helper, &CallbackRegistrationHelper::registerAnimationTimerCallback, | - | ||||||
58 | Qt::QueuedConnection); | - | ||||||
59 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
60 | - | |||||||
61 | QQuickProfiler::~QQuickProfiler() | - | ||||||
62 | { | - | ||||||
63 | QMutexLocker lock(&m_dataMutex); | - | ||||||
64 | featuresEnabled = 0; | - | ||||||
65 | s_instance = nullptr; | - | ||||||
66 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
67 | - | |||||||
68 | void QQuickProfiler::startProfilingImpl(quint64 features) | - | ||||||
69 | { | - | ||||||
70 | QMutexLocker lock(&m_dataMutex); | - | ||||||
71 | featuresEnabled = features; | - | ||||||
72 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||
73 | - | |||||||
74 | void QQuickProfiler::stopProfilingImpl() | - | ||||||
75 | { | - | ||||||
76 | QMutexLocker lock(&m_dataMutex); | - | ||||||
77 | featuresEnabled = 0; | - | ||||||
78 | dataReady(m_data); | - | ||||||
79 | m_data.clear(); | - | ||||||
80 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||
81 | - | |||||||
82 | void QQuickProfiler::reportDataImpl() | - | ||||||
83 | { | - | ||||||
84 | QMutexLocker lock(&m_dataMutex); | - | ||||||
85 | dataReady(m_data); | - | ||||||
86 | m_data.clear(); | - | ||||||
87 | } never executed: end of block | 0 | ||||||
88 | - | |||||||
89 | void QQuickProfiler::setTimer(const QElapsedTimer &t) | - | ||||||
90 | { | - | ||||||
91 | QMutexLocker lock(&m_dataMutex); | - | ||||||
92 | m_timer = t; | - | ||||||
93 | } executed 24 times by 3 tests: end of block Executed by:
| 24 | ||||||
94 | - | |||||||
95 | - | |||||||
Switch to Source code | Preprocessed file |