QmlProfiler: Don't accept compile events in memory usage model

As compiling happens asynchronously it messes up the stack based
approach used to attribute memory usage to QML/JS events. Compiling
generally doesn't use the JavaScript heap, so we can ignore it here.

Change-Id: If8cc4b0ad2b8c2e0531260a8b92b7e2cd76a6d56
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Ulf Hermann
2016-09-09 11:12:24 +02:00
parent 257d1990c6
commit 6b79bba985

View File

@@ -36,7 +36,7 @@ MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager, QObject *pa
QmlProfilerTimelineModel(manager, MemoryAllocation, MaximumRangeType, ProfileMemory, parent) QmlProfilerTimelineModel(manager, MemoryAllocation, MaximumRangeType, ProfileMemory, parent)
{ {
// Announce additional features. The base class already announces the main feature. // Announce additional features. The base class already announces the main feature.
announceFeatures(Constants::QML_JS_RANGE_FEATURES); announceFeatures(Constants::QML_JS_RANGE_FEATURES ^ (1 << Compiling));
} }
int MemoryUsageModel::rowMaxValue(int rowNumber) const int MemoryUsageModel::rowMaxValue(int rowNumber) const
@@ -128,7 +128,8 @@ QVariantMap MemoryUsageModel::details(int index) const
bool MemoryUsageModel::accepted(const QmlEventType &type) const bool MemoryUsageModel::accepted(const QmlEventType &type) const
{ {
return QmlProfilerTimelineModel::accepted(type) || type.rangeType() != MaximumRangeType; return QmlProfilerTimelineModel::accepted(type)
|| (type.rangeType() != MaximumRangeType && type.rangeType() != Compiling);
} }
void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type) void MemoryUsageModel::loadEvent(const QmlEvent &event, const QmlEventType &type)