OpenCoverage

qv4profiling.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4profiling.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4namespace QV4 {-
5namespace Profiling {-
6-
7FunctionLocation FunctionCall::resolveLocation() const-
8{-
9 return
executed 8 times by 1 test: return FunctionLocation(m_function->name()->toQString(), m_function->compilationUnit->fileName(), m_function->compiledFunction->location.line, m_function->compiledFunction->location.column);
Executed by:
  • tst_qqmlprofilerservice
FunctionLocation(m_function->name()->toQString(),
executed 8 times by 1 test: return FunctionLocation(m_function->name()->toQString(), m_function->compilationUnit->fileName(), m_function->compiledFunction->location.line, m_function->compiledFunction->location.column);
Executed by:
  • tst_qqmlprofilerservice
8
10 m_function->compilationUnit->fileName(),
executed 8 times by 1 test: return FunctionLocation(m_function->name()->toQString(), m_function->compilationUnit->fileName(), m_function->compiledFunction->location.line, m_function->compiledFunction->location.column);
Executed by:
  • tst_qqmlprofilerservice
8
11 m_function->compiledFunction->location.line,
executed 8 times by 1 test: return FunctionLocation(m_function->name()->toQString(), m_function->compilationUnit->fileName(), m_function->compiledFunction->location.line, m_function->compiledFunction->location.column);
Executed by:
  • tst_qqmlprofilerservice
8
12 m_function->compiledFunction->location.column);
executed 8 times by 1 test: return FunctionLocation(m_function->name()->toQString(), m_function->compilationUnit->fileName(), m_function->compiledFunction->location.line, m_function->compiledFunction->location.column);
Executed by:
  • tst_qqmlprofilerservice
8
13}-
14-
15FunctionCallProperties FunctionCall::properties() const-
16{-
17 FunctionCallProperties props = {-
18 m_start,-
19 m_end,-
20 reinterpret_cast<quintptr>(m_function)-
21 };-
22 return
executed 14 times by 1 test: return props;
Executed by:
  • tst_qqmlprofilerservice
props;
executed 14 times by 1 test: return props;
Executed by:
  • tst_qqmlprofilerservice
14
23}-
24-
25Profiler::Profiler(QV4::ExecutionEngine *engine) : featuresEnabled(0), m_engine(engine)-
26{-
27 static const int metatypes[] = {-
28 qRegisterMetaType<QVector<QV4::Profiling::FunctionCallProperties> >(),-
29 qRegisterMetaType<QVector<QV4::Profiling::MemoryAllocationProperties> >(),-
30 qRegisterMetaType<FunctionLocationHash>()-
31 };-
32 (void)metatypes;;-
33 m_timer.start();-
34}
executed 32 times by 3 tests: end of block
Executed by:
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlprofilerservice
32
35-
36void Profiler::stopProfiling()-
37{-
38 featuresEnabled = 0;-
39 reportData();-
40 m_sentLocations.clear();-
41}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
42-
43bool operator<(const FunctionCall &call1, const FunctionCall &call2)-
44{-
45 return
executed 8 times by 1 test: return call1.m_start < call2.m_start || (call1.m_start == call2.m_start && (call1.m_end < call2.m_end || (call1.m_end == call2.m_end && call1.m_function < call2.m_function)));
Executed by:
  • tst_qqmlprofilerservice
call1.m_start < call2.m_start ||
executed 8 times by 1 test: return call1.m_start < call2.m_start || (call1.m_start == call2.m_start && (call1.m_end < call2.m_end || (call1.m_end == call2.m_end && call1.m_function < call2.m_function)));
Executed by:
  • tst_qqmlprofilerservice
8
46 (call1.m_start == call2.m_start && (call1.m_end < call2.m_end ||
executed 8 times by 1 test: return call1.m_start < call2.m_start || (call1.m_start == call2.m_start && (call1.m_end < call2.m_end || (call1.m_end == call2.m_end && call1.m_function < call2.m_function)));
Executed by:
  • tst_qqmlprofilerservice
8
47 (call1.m_end == call2.m_end && call1.m_function < call2.m_function)));
executed 8 times by 1 test: return call1.m_start < call2.m_start || (call1.m_start == call2.m_start && (call1.m_end < call2.m_end || (call1.m_end == call2.m_end && call1.m_function < call2.m_function)));
Executed by:
  • tst_qqmlprofilerservice
8
48}-
49-
50void Profiler::reportData()-
51{-
52 std::sort(m_data.begin(), m_data.end());-
53 QVector<FunctionCallProperties> properties;-
54 FunctionLocationHash locations;-
55 properties.reserve(m_data.size());-
56-
57 for (const FunctionCall &call : qAsConst(m_data)) {-
58 properties.append(call.properties());-
59 Function *function = call.function();-
60 SentMarker &marker = m_sentLocations[reinterpret_cast<quintptr>(function)];-
61 if (!marker.isValid()
!marker.isValid()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
) {
6-8
62 FunctionLocation &location = locations[properties.constLast().id];-
63 if (!location.isValid()
!location.isValid()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
)
0-8
64 location = call.resolveLocation();
executed 8 times by 1 test: location = call.resolveLocation();
Executed by:
  • tst_qqmlprofilerservice
8
65 marker.setFunction(function);-
66 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
8
67 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
14
68-
69 dataReady(locations, properties, m_memory_data);-
70 m_data.clear();-
71 m_memory_data.clear();-
72}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
73-
74void Profiler::startProfiling(quint64 features)-
75{-
76 if (featuresEnabled == 0
featuresEnabled == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-6
77 if (features & (1 << FeatureMemoryAllocation)
features & (1 ...oryAllocation)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-6
78 qint64 timestamp = m_timer.nsecsElapsed();-
79 MemoryAllocationProperties heap = {timestamp,-
80 (qint64)m_engine->memoryManager->getAllocatedMem() --
81 (qint64)m_engine->memoryManager->getLargeItemsMem(),-
82 HeapPage};-
83 m_memory_data.append(heap);-
84 MemoryAllocationProperties small = {timestamp,-
85 (qint64)m_engine->memoryManager->getUsedMem(),-
86 SmallItem};-
87 m_memory_data.append(small);-
88 MemoryAllocationProperties large = {timestamp,-
89 (qint64)m_engine->memoryManager->getLargeItemsMem(),-
90 LargeItem};-
91 m_memory_data.append(large);-
92 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
93-
94 featuresEnabled = features;-
95 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
96}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
6
97-
98}-
99}-
100-
101-
102-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0