Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Issue 14253015: Skip samples where top function's stack frame is not setup properly (Closed)

Created:
7 years, 8 months ago by yurys
Modified:
7 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Skip samples where top function's stack frame is not setup properly Stack iterator takes return address based on the frame pointer (ebp) and detects JS frames based on value at fp + StandardFrameConstants::kMarkerOffset. So in order the iterator to work correctly this values should be already setup for the current function. Stack frame is constructed at the very beginning of JS function code and destroyed before return. If sample is taken before before the frame construction is completed or after it was destroyed the stack iterator will wrongly think that FP points at the current functions frame base and will skip callers frame. To avoid this we mark code ranges where stack frame doesn't exist and completely ignore such samples. This fixes cctest/test-cpu-profiler/CollectCpuProfile flakiness. BUG=v8:2628 R=jkummerow@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=14670

Patch Set 1 #

Patch Set 2 : Reverted build/common.gypi #

Total comments: 12

Patch Set 3 : Removed printf #

Total comments: 1

Patch Set 4 : Supported other archs #

Total comments: 12

Patch Set 5 : comments addressed #

Patch Set 6 : skipped new test on simulators #

Patch Set 7 : mips->mipsel #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -16 lines) Patch
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M src/compiler.h View 1 2 3 4 3 chunks +22 lines, -0 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 7 chunks +11 lines, -0 lines 0 comments Download
M src/cpu-profiler.h View 3 chunks +7 lines, -3 lines 0 comments Download
M src/cpu-profiler.cc View 1 2 3 7 chunks +13 lines, -3 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 3 chunks +6 lines, -0 lines 2 comments Download
M src/log.h View 2 chunks +3 lines, -0 lines 0 comments Download
M src/log.cc View 1 2 3 4 chunks +6 lines, -4 lines 0 comments Download
M src/mips/full-codegen-mips.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 1 2 3 4 5 6 3 chunks +7 lines, -0 lines 0 comments Download
M src/profile-generator.h View 1 2 3 5 chunks +10 lines, -1 line 0 comments Download
M src/profile-generator.cc View 1 2 3 4 4 chunks +32 lines, -3 lines 0 comments Download
M src/profile-generator-inl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 3 chunks +6 lines, -0 lines 0 comments Download
M test/cctest/cctest.status View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 1 2 3 4 5 2 chunks +71 lines, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
yurys
The patch provides implementation only for x64. I'd like to get feedback on the approach ...
7 years, 8 months ago (2013-04-26 13:24:35 UTC) #1
loislo
https://codereview.chromium.org/14253015/diff/2001/src/cpu-profiler.cc File src/cpu-profiler.cc (right): https://codereview.chromium.org/14253015/diff/2001/src/cpu-profiler.cc#newcode510 src/cpu-profiler.cc:510: printf("CompilationInfo size = %lu\n", sizeof(CompilationInfo)); please remove that https://codereview.chromium.org/14253015/diff/2001/src/cpu-profiler.cc#newcode510 ...
7 years, 8 months ago (2013-04-26 13:36:56 UTC) #2
yurys
https://codereview.chromium.org/14253015/diff/2001/src/cpu-profiler.cc File src/cpu-profiler.cc (right): https://codereview.chromium.org/14253015/diff/2001/src/cpu-profiler.cc#newcode510 src/cpu-profiler.cc:510: printf("CompilationInfo size = %lu\n", sizeof(CompilationInfo)); On 2013/04/26 13:36:56, loislo ...
7 years, 8 months ago (2013-04-26 13:43:51 UTC) #3
loislo
https://codereview.chromium.org/14253015/diff/5001/src/x64/lithium-codegen-x64.cc File src/x64/lithium-codegen-x64.cc (right): https://codereview.chromium.org/14253015/diff/5001/src/x64/lithium-codegen-x64.cc#newcode2547 src/x64/lithium-codegen-x64.cc:2547: info_->set_frame_destroy_offset(masm_->pc_offset()); do we have the same code on the ...
7 years, 8 months ago (2013-04-26 13:46:19 UTC) #4
yurys
On 2013/04/26 13:46:19, loislo wrote: > https://codereview.chromium.org/14253015/diff/5001/src/x64/lithium-codegen-x64.cc > File src/x64/lithium-codegen-x64.cc (right): > > https://codereview.chromium.org/14253015/diff/5001/src/x64/lithium-codegen-x64.cc#newcode2547 > ...
7 years, 8 months ago (2013-04-26 13:52:32 UTC) #5
loislo
sounds good to me
7 years, 8 months ago (2013-04-26 16:11:00 UTC) #6
yurys
Added support for the rest architectures. PTAL.
7 years, 7 months ago (2013-04-30 15:57:25 UTC) #7
yurys
Jakob could you review this?
7 years, 7 months ago (2013-05-12 17:28:07 UTC) #8
Jakob Kummerow
LGTM with nits. Please also update the test expectations for the CPU profiler test (see ...
7 years, 7 months ago (2013-05-14 12:38:51 UTC) #9
yurys
https://codereview.chromium.org/14253015/diff/14001/src/arm/full-codegen-arm.cc File src/arm/full-codegen-arm.cc (right): https://codereview.chromium.org/14253015/diff/14001/src/arm/full-codegen-arm.cc#newcode431 src/arm/full-codegen-arm.cc:431: Label exit_codesize; On 2013/05/14 12:38:51, Jakob wrote: > I ...
7 years, 7 months ago (2013-05-14 22:51:19 UTC) #10
yurys
Committed patchset #7 manually as r14670 (presubmit successful).
7 years, 7 months ago (2013-05-14 22:51:49 UTC) #11
Vyacheslav Egorov (Google)
Late DBC https://codereview.chromium.org/14253015/diff/29001/src/ia32/lithium-codegen-ia32.cc File src/ia32/lithium-codegen-ia32.cc (right): https://codereview.chromium.org/14253015/diff/29001/src/ia32/lithium-codegen-ia32.cc#newcode2782 src/ia32/lithium-codegen-ia32.cc:2782: void LCodeGen::DoReturn(LReturn* instr) { optimized code can ...
7 years, 6 months ago (2013-06-03 13:51:03 UTC) #12
yurys
7 years, 6 months ago (2013-06-04 05:59:25 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/14253015/diff/29001/src/ia32/lithium-codegen-...
File src/ia32/lithium-codegen-ia32.cc (right):

https://codereview.chromium.org/14253015/diff/29001/src/ia32/lithium-codegen-...
src/ia32/lithium-codegen-ia32.cc:2782: void LCodeGen::DoReturn(LReturn* instr) {
On 2013/06/03 13:51:03, Vyacheslav Egorov (Google) wrote:
> optimized code can have arbitrary many HReturns unlike non-optimized code
which
> branches to the single return sequence from all return points.

Profiler part is designed to allow multiple returns, did I miss some points in
the code generator where returns should be reported?

Powered by Google App Engine
This is Rietveld 408576698