Bug 1177293 - Don't overcount samples when flattening recursion. r=jsantell

This commit is contained in:
Shu-yu Guo 2015-06-24 17:06:00 -04:00
Родитель e8d20bd42c
Коммит 3f8566884e
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -219,7 +219,8 @@ ThreadNode.prototype = {
// If we shouldn't flatten the current frame into the previous one, advance a
// level in the call tree.
if (!flattenRecursion || frameKey !== prevFrameKey) {
let shouldFlatten = flattenRecursion && frameKey === prevFrameKey;
if (!shouldFlatten) {
calls = prevCalls;
}
@ -233,7 +234,11 @@ ThreadNode.prototype = {
sampleTime, stringTable);
}
}
frameNode.samples++;
// Don't overcount flattened recursive frames.
if (!shouldFlatten) {
frameNode.samples++;
}
prevFrameKey = frameKey;
prevCalls = frameNode.calls;