diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-04-28 15:57:12 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-05-09 08:20:22 +0000 |
commit | 8d15633a22d5fb72db3342626e001bfbcf0e0d7b (patch) | |
tree | c63c6d7e735f5f1acce5df2e2780f560c71ff6b7 /src/plugins/qmlprofiler/memoryusagemodel.cpp | |
parent | 61d94c5ccd12f676079a0d4c1fa7c4c0c73fc609 (diff) |
QmlProfiler: Add a QmlTypedEvent and extend QmlEvent
The QmlTypedEvent is mainly useful to read a generic QmlEvent and
QmlEventType from a QPacket. QmlEventType has a stream operator to do
exactly that. QmlEvent also gets further options to store 32-bit data
in addition to 64- and 8-bit data. Also, with the more generic storage
layout we can reduce the memory consumption of range events by 50%.
This comes at the cost of additional memory allocations for non-range
events, but as non-range events are significantly less frequent than
range events, this is a good tradeoff. Finally the new storage layout
lends itself to efficient serialization, which will help when
developing new storage and transfer formats for QML traces.
Change-Id: I420de68b0142f23c8fb2ca8b329d7ffe69c83fe0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/memoryusagemodel.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/memoryusagemodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmlprofiler/memoryusagemodel.cpp b/src/plugins/qmlprofiler/memoryusagemodel.cpp index 013a4ff6890..178a07400f0 100644 --- a/src/plugins/qmlprofiler/memoryusagemodel.cpp +++ b/src/plugins/qmlprofiler/memoryusagemodel.cpp @@ -177,12 +177,12 @@ void MemoryUsageModel::loadData() type.detailType == selectionId(currentUsageIndex) && m_data[currentUsageIndex].originTypeIndex == rangeStack.top().originTypeIndex && rangeStack.top().startTime < startTime(currentUsageIndex)) { - m_data[currentUsageIndex].update(event.numericData(0)); + m_data[currentUsageIndex].update(event.number<qint64>(0)); currentUsage = m_data[currentUsageIndex].size; } else { MemoryAllocationItem allocation(event.typeIndex(), currentUsage, rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex); - allocation.update(event.numericData(0)); + allocation.update(event.number<qint64>(0)); currentUsage = allocation.size; if (currentUsageIndex != -1) { @@ -200,12 +200,12 @@ void MemoryUsageModel::loadData() m_data[currentJSHeapIndex].originTypeIndex == rangeStack.top().originTypeIndex && rangeStack.top().startTime < startTime(currentJSHeapIndex)) { - m_data[currentJSHeapIndex].update(event.numericData(0)); + m_data[currentJSHeapIndex].update(event.number<qint64>(0)); currentSize = m_data[currentJSHeapIndex].size; } else { MemoryAllocationItem allocation(event.typeIndex(), currentSize, rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex); - allocation.update(event.numericData(0)); + allocation.update(event.number<qint64>(0)); currentSize = allocation.size; if (currentSize > m_maxSize) |