diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-06-13 19:18:01 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-06-17 16:26:37 +0200 |
commit | b85a63d5d353c174e9f586148c8dfa0fd2b28466 (patch) | |
tree | 14f526bf12f65a2c5226a2d6f78a236d4822e8dc /src/plugins/qmlprofiler/qmlprofilertracefile.cpp | |
parent | f70f4e6f7cf69853a0b451355a08cd0720dfcdaa (diff) | |
download | qt-creator-b85a63d5d353c174e9f586148c8dfa0fd2b28466.tar.gz |
QmlProfiler: Save and load memory events in trace files
Change-Id: Id95a3adf2d97255f962cb16aa486a15cacc7c1d1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertracefile.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertracefile.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp index b101aad490..9fa4ab0319 100644 --- a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp @@ -275,7 +275,8 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream) if (elementName == _("bindingType") || elementName == _("cacheEventType") || - elementName == _("sgEventType")) { + elementName == _("sgEventType") || + elementName == _("memoryEventType")) { event.detailType = readData.toInt(); break; } @@ -340,6 +341,8 @@ void QmlProfilerFileReader::loadProfilerDataModel(QXmlStreamReader &stream) range.numericData2 = attributes.value(_("height")).toString().toLongLong(); if (attributes.hasAttribute(_("refCount"))) range.numericData3 = attributes.value(_("refCount")).toString().toLongLong(); + if (attributes.hasAttribute(_("amount"))) + range.numericData1 = attributes.value(_("amount")).toString().toLongLong(); if (attributes.hasAttribute(_("timing1"))) range.numericData1 = attributes.value(_("timing1")).toString().toLongLong(); if (attributes.hasAttribute(_("timing2"))) @@ -463,6 +466,8 @@ void QmlProfilerFileWriter::save(QIODevice *device) stream.writeTextElement(_("cacheEventType"), QString::number(event.detailType)); if (event.message == SceneGraphFrame) stream.writeTextElement(_("sgEventType"), QString::number(event.detailType)); + if (event.message == MemoryAllocation) + stream.writeTextElement(_("memoryEventType"), QString::number(event.detailType)); stream.writeEndElement(); } stream.writeEndElement(); // eventData @@ -512,6 +517,11 @@ void QmlProfilerFileWriter::save(QIODevice *device) if (range.numericData5 > 0) stream.writeAttribute(_("timing5"), QString::number(range.numericData5)); } + + // special: memory allocation event + if (event.message == QmlDebug::MemoryAllocation) + stream.writeAttribute(_("amount"), QString::number(range.numericData1)); + stream.writeEndElement(); } stream.writeEndElement(); // profilerDataModel |