summaryrefslogtreecommitdiff
path: root/src/libs/flamegraph
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-03-29 15:17:31 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-03-31 08:31:04 +0000
commit2080096ec3d9edbd03711b4da53d19d2afa3f940 (patch)
tree0f2f110e06eb0ece3e60426ff31526ef428a7ddc /src/libs/flamegraph
parent36a913b47039b6f040b567dd9d4d4793b1226e5d (diff)
downloadqt-creator-2080096ec3d9edbd03711b4da53d19d2afa3f940.tar.gz
FlameGraph: Attribute extra space in root item to "others"
The QML profiler's memory and allocations mode includes allocations from non-QML code. The space allocated for those in the flame graph shouldn't just be empty. Change-Id: I390bf880097d51a19d5027b06bda25dbfaecc09e Task-number: QTCREATORBUG-17939 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/libs/flamegraph')
-rw-r--r--src/libs/flamegraph/flamegraph.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libs/flamegraph/flamegraph.cpp b/src/libs/flamegraph/flamegraph.cpp
index 79627c2dc5..eb7431d179 100644
--- a/src/libs/flamegraph/flamegraph.cpp
+++ b/src/libs/flamegraph/flamegraph.cpp
@@ -155,6 +155,10 @@ int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject,
}
}
+ // Root object: attribute all remaining width to "others"
+ if (!parentIndex.isValid())
+ skipped = parentSize - position;
+
if (skipped > 0) {
appendChild(parentObject, parentItem, context, QModelIndex(), position / parentSize,
skipped / parentSize);