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

Issue 6551011: Fix CPU profiling for Crankshaft. (Closed)

Created:
9 years, 10 months ago by mnaganov (inactive)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Fix CPU profiling for Crankshaft. The main issue was due to multiple recompilations of functions. Now code objects are grouped by function using SFI object address. JSFunction objects are no longer tracked, instead we track SFI object moves. To pick a correct code version, we now sample return addresses instead of JSFunction addresses. tools/{linux|mac|windows}-tickprocessor scripts differentiate between code optimization states for the same function (using * and ~ prefixes introduced earlier). DevTools CPU profiler treats all variants of function code as a single function. ll_prof treats each optimized variant as a separate entry, because it can disassemble each one of them. tickprocessor.py not updated -- it is deprecated and will be removed. BUG=v8/1087,b/3178160 TEST=all existing tests pass, including Chromium layout tests Committed: http://code.google.com/p/v8/source/detail?r=6902

Patch Set 1 #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -460 lines) Patch
M src/compiler.h View 1 chunk +2 lines, -3 lines 2 comments Download
M src/compiler.cc View 8 chunks +24 lines, -30 lines 0 comments Download
M src/cpu-profiler.h View 9 chunks +16 lines, -32 lines 0 comments Download
M src/cpu-profiler.cc View 11 chunks +38 lines, -102 lines 4 comments Download
M src/cpu-profiler-inl.h View 2 chunks +5 lines, -2 lines 0 comments Download
M src/handles.cc View 2 chunks +0 lines, -4 lines 2 comments Download
M src/heap.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/log.h View 4 chunks +12 lines, -14 lines 4 comments Download
M src/log.cc View 12 chunks +59 lines, -88 lines 6 comments Download
M src/log-utils.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M src/mark-compact.cc View 3 chunks +4 lines, -8 lines 0 comments Download
M src/profile-generator.h View 5 chunks +9 lines, -3 lines 2 comments Download
M src/profile-generator.cc View 6 chunks +36 lines, -39 lines 0 comments Download
M src/profile-generator-inl.h View 2 chunks +1 line, -10 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 3 chunks +2 lines, -6 lines 0 comments Download
M test/cctest/test-log.cc View 2 chunks +4 lines, -19 lines 0 comments Download
M test/cctest/test-log-stack-tracer.cc View 5 chunks +15 lines, -17 lines 0 comments Download
M test/mjsunit/tools/tickprocessor-test-func-info.log View 1 chunk +4 lines, -6 lines 0 comments Download
M tools/ll_prof.py View 2 chunks +6 lines, -3 lines 2 comments Download
M tools/profile.js View 7 chunks +103 lines, -38 lines 0 comments Download
M tools/tickprocessor.js View 8 chunks +37 lines, -28 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
mnaganov (inactive)
9 years, 10 months ago (2011-02-22 14:05:22 UTC) #1
Vitaly Repeshko
LGTM. I'm not a huge fan of the "SFI" abbreviation. Can we at least make ...
9 years, 10 months ago (2011-02-22 15:11:19 UTC) #2
mnaganov (inactive)
Thanks! http://codereview.chromium.org/6551011/diff/1/src/compiler.h File src/compiler.h (right): http://codereview.chromium.org/6551011/diff/1/src/compiler.h#newcode269 src/compiler.h:269: Handle<SharedFunctionInfo> shared); On 2011/02/22 15:11:19, Vitaly wrote: > ...
9 years, 10 months ago (2011-02-22 16:18:22 UTC) #3
mnaganov (inactive)
9 years, 10 months ago (2011-02-22 16:54:32 UTC) #4
On 2011/02/22 15:11:19, Vitaly wrote:
> LGTM.
> 
> I'm not a huge fan of the "SFI" abbreviation. Can we at least make it local to
> the profiler internals (where, BTW, we're already inconsistent: "shared_id"
vs.
> "sfi_address") and have "SharedFunctionInfoMoveEvent" in the interface?
>

Oh, sorry. I forgot to address this comment. Yes, I will make names more
aligned.
 
> Also I didn't find the place where "sample->function" is used to find the
> calling function. Does it just work automagically?
> 
> http://codereview.chromium.org/6551011/diff/1/src/compiler.h
> File src/compiler.h (right):
> 
> http://codereview.chromium.org/6551011/diff/1/src/compiler.h#newcode269
> src/compiler.h:269: Handle<SharedFunctionInfo> shared);
> Can we use info->shared_info() instead of passing another shared function
info?
> If not, please document here why.
> 
> http://codereview.chromium.org/6551011/diff/1/src/cpu-profiler.cc
> File src/cpu-profiler.cc (right):
> 
> http://codereview.chromium.org/6551011/diff/1/src/cpu-profiler.cc#newcode358
> src/cpu-profiler.cc:358: SharedFunctionInfo *shared,
> nit: Move *.
> 
> http://codereview.chromium.org/6551011/diff/1/src/cpu-profiler.cc#newcode373
> src/cpu-profiler.cc:373: SharedFunctionInfo *shared,
> Same nit.
> 
> http://codereview.chromium.org/6551011/diff/1/src/handles.cc
> File src/handles.cc (right):
> 
> http://codereview.chromium.org/6551011/diff/1/src/handles.cc#newcode869
> src/handles.cc:869: bool result = CompileLazyHelper(&info, KEEP_EXCEPTION);
> Temporary "result" variable is now unnecessary.
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.cc
> File src/log.cc (right):
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.cc#newcode164
> src/log.cc:164: sample->function = Memory::Address_at(sample->sp);
> We should rename the "function" field in TickSample. How about "tos_value"?
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.cc#newcode762
> src/log.cc:762: if (code == Builtins::builtin(Builtins::LazyCompile)) return;
> Can we make the caller do this check for us? (I think it should only matter
for
> calls made from compiler.cc.)
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.cc#newcode785
> src/log.cc:785: SharedFunctionInfo *shared,
> Same nit.
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.h
> File src/log.h (right):
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.h#newcode210
> src/log.h:210: SharedFunctionInfo *shared,
> nit: Move *.
> 
> http://codereview.chromium.org/6551011/diff/1/src/log.h#newcode214
> src/log.h:214: SharedFunctionInfo *shared,
> Same nit.
> 
> http://codereview.chromium.org/6551011/diff/1/src/profile-generator.h
> File src/profile-generator.h (right):
> 
>
http://codereview.chromium.org/6551011/diff/1/src/profile-generator.h#newcode273
> src/profile-generator.h:273: static const CodeEntry* kSfiCodeEntry;
> Add one more "const" to make it really constant.
> 
> http://codereview.chromium.org/6551011/diff/1/tools/ll_prof.py
> File tools/ll_prof.py (right):
> 
> http://codereview.chromium.org/6551011/diff/1/tools/ll_prof.py#newcode403
> tools/ll_prof.py:403: if match.group(6):
> Could you please assign these groups (1, 4, 6) to locals (like it's done for
> "start_address") to make this code readable?

Powered by Google App Engine
This is Rietveld 408576698