Commit 7a76e6d3 authored by Stephan Herhut's avatar Stephan Herhut Committed by Commit Bot

Reduce false-positives in profiler tick filtering

When collecting stack frame information during a profiler tick event, we
apply a filter on the instructions at the current pc to avoid collecting
(wrong) stack frames while a frame is being setup/torn down. While this
detection makes sense for compiled JavaScript code, it also filters out
ticks in the C++ code base of v8.

This change only applies the filter if the pc lies within a region that
could potentially contain compiled JavaScript code.

Change-Id: I8c8d8d70823abcdc2c5ae0ebf78a5198ec855a79
Reviewed-on: https://chromium-review.googlesource.com/912470Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51238}
parent 713c5c8c
......@@ -204,7 +204,12 @@ bool TickSample::GetStackSample(Isolate* v8_isolate, RegisterState* regs,
#endif
DCHECK(regs->sp);
if (regs->pc && IsNoFrameRegion(static_cast<i::Address>(regs->pc))) {
// Check whether we interrupted setup/teardown of a stack frame in JS code.
// Avoid this check for C++ code, as that would trigger false positives.
if (regs->pc &&
isolate->heap()->memory_allocator()->code_range()->contains(
static_cast<i::Address>(regs->pc)) &&
IsNoFrameRegion(static_cast<i::Address>(regs->pc))) {
// The frame is not setup, so it'd be hard to iterate the stack. Bailout.
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment