OpenCoverage

qqmlprofilerclient.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qmldebug/qqmlprofilerclient.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qqmlprofilerclient_p_p.h"-
41#include "qqmldebugconnection_p.h"-
42-
43QT_BEGIN_NAMESPACE-
44-
45QQmlProfilerClientPrivate::~QQmlProfilerClientPrivate()-
46{-
47}-
48-
49int QQmlProfilerClientPrivate::resolveType(const QQmlProfilerTypedEvent &event)-
50{-
51 int typeIndex = -1;-
52 if (event.serverTypeId != 0) {
event.serverTypeId != 0Description
TRUEevaluated 296 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 594 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
296-594
53 QHash<qint64, int>::ConstIterator it = serverTypeIds.constFind(event.serverTypeId);-
54-
55 if (it != serverTypeIds.constEnd()) {
it != serverTypeIds.constEnd()Description
TRUEevaluated 210 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
86-210
56 typeIndex = it.value();-
57 } else {
executed 210 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
210
58 typeIndex = eventReceiver->numLoadedEventTypes();-
59 eventReceiver->addEventType(event.type);-
60 serverTypeIds[event.serverTypeId] = typeIndex;-
61 }
executed 86 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
86
62 } else {-
63 QHash<QQmlProfilerEventType, int>::ConstIterator it = eventTypeIds.constFind(event.type);-
64-
65 if (it != eventTypeIds.constEnd()) {
it != eventTypeIds.constEnd()Description
TRUEevaluated 462 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
132-462
66 typeIndex = it.value();-
67 } else {
executed 462 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
462
68 typeIndex = eventReceiver->numLoadedEventTypes();-
69 eventReceiver->addEventType(event.type);-
70 eventTypeIds[event.type] = typeIndex;-
71 }
executed 132 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
132
72 }-
73 return typeIndex;
executed 890 times by 1 test: return typeIndex;
Executed by:
  • tst_qqmlprofilerservice
890
74}-
75-
76int QQmlProfilerClientPrivate::resolveStackTop()-
77{-
78 if (rangesInProgress.isEmpty())
rangesInProgress.isEmpty()Description
TRUEevaluated 159 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 435 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
159-435
79 return -1;
executed 159 times by 1 test: return -1;
Executed by:
  • tst_qqmlprofilerservice
159
80-
81 QQmlProfilerTypedEvent &typedEvent = rangesInProgress.top();-
82 int typeIndex = typedEvent.event.typeIndex();-
83 if (typeIndex >= 0)
typeIndex >= 0Description
TRUEevaluated 139 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 296 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
139-296
84 return typeIndex;
executed 139 times by 1 test: return typeIndex;
Executed by:
  • tst_qqmlprofilerservice
139
85-
86 typeIndex = resolveType(typedEvent);-
87 typedEvent.event.setTypeIndex(typeIndex);-
88 while (!pendingMessages.isEmpty()
!pendingMessages.isEmpty()Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 260 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
78-260
89 && pendingMessages.head().timestamp() < typedEvent.event.timestamp()) {
pendingMessage...nt.timestamp()Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
36-42
90 forwardEvents(pendingMessages.dequeue());-
91 }
executed 42 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
42
92 forwardEvents(typedEvent.event);-
93 return typeIndex;
executed 296 times by 1 test: return typeIndex;
Executed by:
  • tst_qqmlprofilerservice
296
94}-
95-
96void QQmlProfilerClientPrivate::forwardEvents(const QQmlProfilerEvent &last)-
97{-
98 while (!pendingDebugMessages.isEmpty()
!pendingDebugM...ages.isEmpty()Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 554 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
182-554
99 && pendingDebugMessages.front().timestamp() <= last.timestamp()) {
pendingDebugMe...st.timestamp()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 166 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
16-166
100 eventReceiver->addEvent(pendingDebugMessages.dequeue());-
101 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
16
102 eventReceiver->addEvent(last);-
103}
executed 720 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
720
104-
105void QQmlProfilerClientPrivate::processCurrentEvent()-
106{-
107 // RangeData and RangeLocation always apply to the range on the top of the stack. Furthermore,-
108 // all ranges are perfectly nested. This is why we can defer the type resolution until either-
109 // the range ends or a child range starts. With only the information in RangeStart we wouldn't-
110 // be able to uniquely identify the event type.-
111 Message rangeStage = currentEvent.type.rangeType() == MaximumRangeType ?
currentEvent.t...ximumRangeTypeDescription
TRUEevaluated 594 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 744 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
594-744
112 currentEvent.type.message() : currentEvent.event.rangeStage();-
113 switch (rangeStage) {-
114 case RangeStart:
executed 296 times by 1 test: case RangeStart:
Executed by:
  • tst_qqmlprofilerservice
296
115 resolveStackTop();-
116 rangesInProgress.push(currentEvent);-
117 break;
executed 296 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
296
118 case RangeEnd: {
executed 298 times by 1 test: case RangeEnd:
Executed by:
  • tst_qqmlprofilerservice
298
119 int typeIndex = resolveStackTop();-
120 if (typeIndex == -1)
typeIndex == -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 296 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
2-296
121 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
2
122 currentEvent.event.setTypeIndex(typeIndex);-
123 while (!pendingMessages.isEmpty())
!pendingMessages.isEmpty()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 296 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
86-296
124 forwardEvents(pendingMessages.dequeue());
executed 86 times by 1 test: forwardEvents(pendingMessages.dequeue());
Executed by:
  • tst_qqmlprofilerservice
86
125 forwardEvents(currentEvent.event);-
126 rangesInProgress.pop();-
127 break;
executed 296 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
296
128 }-
129 case RangeData:
executed 64 times by 1 test: case RangeData:
Executed by:
  • tst_qqmlprofilerservice
64
130 if (!rangesInProgress.isEmpty())
!rangesInProgress.isEmpty()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-64
131 rangesInProgress.top().type.setData(currentEvent.type.data());
executed 64 times by 1 test: rangesInProgress.top().type.setData(currentEvent.type.data());
Executed by:
  • tst_qqmlprofilerservice
64
132 break;
executed 64 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
64
133 case RangeLocation:
executed 86 times by 1 test: case RangeLocation:
Executed by:
  • tst_qqmlprofilerservice
86
134 if (!rangesInProgress.isEmpty())
!rangesInProgress.isEmpty()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-86
135 rangesInProgress.top().type.setLocation(currentEvent.type.location());
executed 86 times by 1 test: rangesInProgress.top().type.setLocation(currentEvent.type.location());
Executed by:
  • tst_qqmlprofilerservice
86
136 break;
executed 86 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
86
137 case DebugMessage:
executed 18 times by 1 test: case DebugMessage:
Executed by:
  • tst_qqmlprofilerservice
18
138 currentEvent.event.setTypeIndex(resolveType(currentEvent));-
139 pendingDebugMessages.enqueue(currentEvent.event);-
140 break;
executed 18 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
18
141 default: {
executed 576 times by 1 test: default:
Executed by:
  • tst_qqmlprofilerservice
576
142 int typeIndex = resolveType(currentEvent);-
143 currentEvent.event.setTypeIndex(typeIndex);-
144 if (rangesInProgress.isEmpty())
rangesInProgress.isEmpty()Description
TRUEevaluated 448 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 128 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
128-448
145 eventReceiver->addEvent(currentEvent.event);
executed 448 times by 1 test: eventReceiver->addEvent(currentEvent.event);
Executed by:
  • tst_qqmlprofilerservice
448
146 else-
147 pendingMessages.enqueue(currentEvent.event);
executed 128 times by 1 test: pendingMessages.enqueue(currentEvent.event);
Executed by:
  • tst_qqmlprofilerservice
128
148 break;
executed 576 times by 1 test: break;
Executed by:
  • tst_qqmlprofilerservice
576
149 }-
150 }-
151}-
152-
153void QQmlProfilerClientPrivate::sendRecordingStatus(int engineId)-
154{-
155 Q_Q(QQmlProfilerClient);-
156 QPacket stream(connection->currentDataStreamVersion());-
157 stream << recording << engineId; // engineId -1 is OK. It means "all of them"-
158 if (recording) {
recordingDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
40-60
159 stream << requestedFeatures << flushInterval;-
160 stream << true; // yes, we support type IDs-
161 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
60
162 q->sendMessage(stream.data());-
163}
executed 100 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
100
164-
165QQmlProfilerClient::QQmlProfilerClient(QQmlDebugConnection *connection,-
166 QQmlProfilerEventReceiver *eventReceiver,-
167 quint64 features)-
168 : QQmlDebugClient(*(new QQmlProfilerClientPrivate(connection, eventReceiver)))-
169{-
170 Q_D(QQmlProfilerClient);-
171 setRequestedFeatures(features);-
172 connect(this, &QQmlDebugClient::stateChanged, this, &QQmlProfilerClient::onStateChanged);-
173 connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeAdded,-
174 this, &QQmlProfilerClient::sendRecordingStatus);-
175 connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeRemoved,-
176 this, [d](int engineId) {-
177 // We may already be done with that engine. Then we don't need to block it.-
178 if (d->trackedEngines.contains(engineId))
d->trackedEngi...ains(engineId)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
2-4
179 d->engineControl->blockEngine(engineId);
executed 4 times by 1 test: d->engineControl->blockEngine(engineId);
Executed by:
  • tst_qqmlprofilerservice
4
180 });
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
181 connect(this, &QQmlProfilerClient::traceFinished,-
182 d->engineControl.data(), [d](qint64 timestamp, const QList<int> &engineIds) {-
183 Q_UNUSED(timestamp);-
184 // The engines might not be blocked because the trace can get finished before engine control-
185 // sees them.-
186 for (int blocked : d->engineControl->blockedEngines()) {-
187 if (engineIds.contains(blocked))
engineIds.contains(blocked)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-4
188 d->engineControl->releaseEngine(blocked);
executed 4 times by 1 test: d->engineControl->releaseEngine(blocked);
Executed by:
  • tst_qqmlprofilerservice
4
189 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
4
190 });
executed 34 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
34
191}
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
192-
193QQmlProfilerClient::~QQmlProfilerClient()-
194{-
195 //Disable profiling if started by client-
196 //Profiling data will be lost!!-
197 if (isRecording())
isRecording()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
8-28
198 setRecording(false);
executed 8 times by 1 test: setRecording(false);
Executed by:
  • tst_qqmlprofilerservice
8
199}
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
200-
201void QQmlProfilerClient::clearEvents()-
202{-
203 Q_D(QQmlProfilerClient);-
204 d->rangesInProgress.clear();-
205 d->pendingMessages.clear();-
206 d->pendingDebugMessages.clear();-
207 if (d->recordedFeatures != 0) {
d->recordedFeatures != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
208 d->recordedFeatures = 0;-
209 emit recordedFeaturesChanged(0);-
210 }
never executed: end of block
0
211 emit cleared();-
212}
never executed: end of block
0
213-
214void QQmlProfilerClient::clearAll()-
215{-
216 Q_D(QQmlProfilerClient);-
217 d->serverTypeIds.clear();-
218 d->eventTypeIds.clear();-
219 d->trackedEngines.clear();-
220 clearEvents();-
221}
never executed: end of block
0
222-
223void QQmlProfilerClientPrivate::finalize()-
224{-
225 while (!rangesInProgress.isEmpty()) {
!rangesInProgress.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
2-34
226 currentEvent = rangesInProgress.top();-
227 currentEvent.event.setRangeStage(RangeEnd);-
228 currentEvent.event.setTimestamp(maximumTime);-
229 processCurrentEvent();-
230 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
2
231 while (!pendingDebugMessages.isEmpty())
!pendingDebugM...ages.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
0-34
232 eventReceiver->addEvent(pendingDebugMessages.dequeue());
never executed: eventReceiver->addEvent(pendingDebugMessages.dequeue());
0
233}
executed 34 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
34
234-
235-
236void QQmlProfilerClient::sendRecordingStatus(int engineId)-
237{-
238 Q_D(QQmlProfilerClient);-
239 d->sendRecordingStatus(engineId);-
240}
executed 100 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
100
241-
242bool QQmlProfilerClient::isRecording() const-
243{-
244 Q_D(const QQmlProfilerClient);-
245 return d->recording;
executed 36 times by 1 test: return d->recording;
Executed by:
  • tst_qqmlprofilerservice
36
246}-
247-
248void QQmlProfilerClient::setRecording(bool v)-
249{-
250 Q_D(QQmlProfilerClient);-
251 if (v == d->recording)
v == d->recordingDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
12-68
252 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_qqmlprofilerservice
12
253-
254 d->recording = v;-
255-
256 if (state() == Enabled)
state() == EnabledDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
32-36
257 sendRecordingStatus();
executed 36 times by 1 test: sendRecordingStatus();
Executed by:
  • tst_qqmlprofilerservice
36
258-
259 emit recordingChanged(v);-
260}
executed 68 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
68
261-
262quint64 QQmlProfilerClient::recordedFeatures() const-
263{-
264 Q_D(const QQmlProfilerClient);-
265 return d->recordedFeatures;
never executed: return d->recordedFeatures;
0
266}-
267-
268void QQmlProfilerClient::setRequestedFeatures(quint64 features)-
269{-
270 Q_D(QQmlProfilerClient);-
271 d->requestedFeatures = features;-
272 if (features & static_cast<quint64>(1) << ProfileDebugMessages) {
features & sta...eDebugMessagesDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-36
273 if (d->messageClient.isNull()) {
d->messageClient.isNull()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-36
274 d->messageClient.reset(new QQmlDebugMessageClient(connection()));-
275 connect(d->messageClient.data(), &QQmlDebugMessageClient::message, this,-
276 [this](QtMsgType type, const QString &text, const QQmlDebugContextInfo &context)-
277 {-
278 Q_D(QQmlProfilerClient);-
279 d->updateFeatures(ProfileDebugMessages);-
280 d->currentEvent.event.setTimestamp(context.timestamp > 0 ? context.timestamp : 0);-
281 d->currentEvent.event.setTypeIndex(-1);-
282 d->currentEvent.event.setString(text);-
283 d->currentEvent.type = QQmlProfilerEventType(-
284 DebugMessage, MaximumRangeType, type,-
285 QQmlProfilerEventLocation(context.file, context.line, 1));-
286 d->currentEvent.serverTypeId = 0;-
287 d->processCurrentEvent();-
288 });
executed 18 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
18
289 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
290 } else {
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
291 d->messageClient.reset();-
292 }
never executed: end of block
0
293}-
294-
295void QQmlProfilerClient::setFlushInterval(quint32 flushInterval)-
296{-
297 Q_D(QQmlProfilerClient);-
298 d->flushInterval = flushInterval;-
299}
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
300-
301QQmlProfilerClient::QQmlProfilerClient(QQmlProfilerClientPrivate &dd) :-
302 QQmlDebugClient(dd)-
303{-
304 Q_D(QQmlProfilerClient);-
305 connect(d->engineControl.data(), &QQmlEngineControlClient::engineAboutToBeAdded,-
306 this, &QQmlProfilerClient::sendRecordingStatus);-
307}
never executed: end of block
0
308-
309bool QQmlProfilerClientPrivate::updateFeatures(ProfileFeature feature)-
310{-
311 Q_Q(QQmlProfilerClient);-
312 quint64 flag = 1ULL << feature;-
313 if (!(requestedFeatures & flag))
!(requestedFeatures & flag)Description
TRUEnever evaluated
FALSEevaluated 1336 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
0-1336
314 return false;
never executed: return false;
0
315 if (!(recordedFeatures & flag)) {
!(recordedFeatures & flag)Description
TRUEevaluated 124 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
124-1212
316 recordedFeatures |= flag;-
317 emit q->recordedFeaturesChanged(recordedFeatures);-
318 }
executed 124 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
124
319 return true;
executed 1336 times by 1 test: return true;
Executed by:
  • tst_qqmlprofilerservice
1336
320}-
321-
322void QQmlProfilerClient::onStateChanged(State status)-
323{-
324 if (status == Enabled) {
status == EnabledDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-36
325 sendRecordingStatus(-1);-
326 } else {
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
36
327 Q_D(QQmlProfilerClient);-
328 d->finalize();-
329 }
never executed: end of block
0
330-
331}-
332-
333void QQmlProfilerClient::messageReceived(const QByteArray &data)-
334{-
335 Q_D(QQmlProfilerClient);-
336 QPacket stream(d->connection->currentDataStreamVersion(), data);-
337-
338 stream >> d->currentEvent;-
339-
340 d->maximumTime = qMax(d->currentEvent.event.timestamp(), d->maximumTime);-
341 if (d->currentEvent.type.message() == Complete) {
d->currentEven...() == CompleteDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 1388 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
34-1388
342 d->finalize();-
343 emit complete(d->maximumTime);-
344 } else if (d->currentEvent.type.message() == Event
executed 34 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
d->currentEven...age() == EventDescription
TRUEevaluated 173 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 1215 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
34-1215
345 && d->currentEvent.type.detailType() == StartTrace) {
d->currentEven... == StartTraceDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 137 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
36-137
346 const QList<int> engineIds = d->currentEvent.event.numbers<QList<int>, qint32>();-
347 d->trackedEngines.append(engineIds);-
348 emit traceStarted(d->currentEvent.event.timestamp(), engineIds);-
349 } else if (d->currentEvent.type.message() == Event
executed 36 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
d->currentEven...age() == EventDescription
TRUEevaluated 137 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 1215 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
36-1215
350 && d->currentEvent.type.detailType() == EndTrace) {
d->currentEven...() == EndTraceDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 103 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
34-103
351 const QList<int> engineIds = d->currentEvent.event.numbers<QList<int>, qint32>();-
352 for (int engineId : engineIds)-
353 d->trackedEngines.removeAll(engineId);
executed 34 times by 1 test: d->trackedEngines.removeAll(engineId);
Executed by:
  • tst_qqmlprofilerservice
34
354 emit traceFinished(d->currentEvent.event.timestamp(), engineIds);-
355 } else if (d->updateFeatures(d->currentEvent.type.feature())) {
executed 34 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
d->updateFeatu...ype.feature())Description
TRUEevaluated 1318 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
0-1318
356 d->processCurrentEvent();-
357 }
executed 1318 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
1318
358}
executed 1422 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
1422
359-
360QT_END_NAMESPACE-
361-
362#include "moc_qqmlprofilerclient_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0