From ac56e7cda724aa7463ef6ffe5f0e93bd3208cb51 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 2 Jun 2014 18:33:19 +0200 Subject: 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 --- .../qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/auto/qml/debugger') 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)); -- cgit v1.2.3