Bug 1691092 - When capturing a marker stack, stop when the PROFILER category is encountered, r=gerald.

Differential Revision: https://phabricator.services.mozilla.com/D104248
This commit is contained in:
Florian Quèze 2021-02-16 19:04:03 +00:00
Родитель 7f356c706e
Коммит 2df72b6edb
2 изменённых файлов: 14 добавлений и 0 удалений

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

@ -1368,6 +1368,13 @@ static void MergeStacks(uint32_t aFeatures, bool aIsSynchronous,
// Sp marker frames are just annotations and should not be recorded in
// the profile.
if (!profilingStackFrame.isSpMarkerFrame()) {
if (aIsSynchronous && profilingStackFrame.categoryPair() ==
ProfilingCategoryPair::PROFILER) {
// For stacks captured synchronously (ie. marker stacks), stop
// walking the stack as soon as we enter the profiler category,
// to avoid showing profiler internal code in marker stacks.
return;
}
aCollector.CollectProfilingStackFrame(profilingStackFrame);
}
profilingStackIndex++;

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

@ -1843,6 +1843,13 @@ static void MergeStacks(uint32_t aFeatures, bool aIsSynchronous,
!profilingStackFrame.pc(),
&profilingStackFrame ==
&profilingStack.frames[profilingStack.stackSize() - 1]);
if (aIsSynchronous && profilingStackFrame.categoryPair() ==
JS::ProfilingCategoryPair::PROFILER) {
// For stacks captured synchronously (ie. marker stacks), stop
// walking the stack as soon as we enter the profiler category,
// to avoid showing profiler internal code in marker stacks.
return;
}
aCollector.CollectProfilingStackFrame(profilingStackFrame);
}
profilingStackIndex++;