aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qqmlprofilerservice
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-06-02 18:33:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-06 18:18:35 +0200
commitac56e7cda724aa7463ef6ffe5f0e93bd3208cb51 (patch)
treec96c9a5e611937b658f13ab21e9d71787c12b512 /tests/auto/qml/debugger/qqmlprofilerservice
parent4a127e3b2e98c1d690d9baf346e4d3ee8aa4edf1 (diff)
Javascript heap profiler
This profiler tracks every memory allocation and deallocation, by the MemoryManager as well as the V4 VM, and exposes them as a stream of events to the profiler service. Change-Id: I85297d498f0a7eb55df5d7829c4b7307de980519 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/debugger/qqmlprofilerservice')
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 5fd985f6d5..2b1b7ce6ec 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -79,6 +79,7 @@ public:
Complete, // end of transmission
PixmapCacheEvent,
SceneGraphFrame,
+ MemoryAllocation,
MaximumMessage
};
@@ -131,6 +132,12 @@ public:
MaximumSceneGraphFrameType
};
+ enum MemoryType {
+ HeapPage,
+ LargeItem,
+ SmallItem
+ };
+
QQmlProfilerClient(QQmlDebugConnection *connection)
: QQmlDebugClient(QLatin1String("CanvasFrameRate"), connection)
{
@@ -302,6 +309,12 @@ void QQmlProfilerClient::messageReceived(const QByteArray &message)
}
break;
}
+ case QQmlProfilerClient::MemoryAllocation: {
+ stream >> data.detailType;
+ qint64 amount;
+ stream >> amount;
+ return;
+ }
default:
QString failMsg = QString("Unknown message type:") + data.messageType;
QFAIL(qPrintable(failMsg));