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

Issue 616963005: Extend CPU profiler with mapping ticks to source lines (Closed)

Created:
6 years, 2 months ago by yurys
Modified:
6 years, 2 months ago
CC:
v8-dev, Paweł Hajdan Jr.
Project:
v8
Visibility:
Public.

Description

Extend CPU profiler with mapping ticks to source lines The idea behind of this solution is to use the existing "relocation info" instead of consumption the CodeLinePosition events emitted by the V8 compilers. During generation code and relocation info are generated simultaneously. When code generation is done you each code object has associated "relocation info". Relocation information lets V8 to mark interesting places in the generated code: the pointers that might need to be relocated (after garbage collection), correspondences between the machine program counter and source locations for stack walking. This patch: 1. Add more source positions info in reloc info to make it suitable for source level mapping. The amount of data should not be increased dramatically because (1) V8 already marks interesting places in the generated code and (2) V8 does not write redundant information (it writes a pair (pc_offset, pos) only if pos is changed and skips other). I measured it on Octane benchmark - for unoptimized code the number of source positions may achieve 2x ('lin_solve' from NavierStokes benchmark). 2. When a sample happens, CPU profiler finds a code object by pc, then use its reloc info to match the sample to a source line. If a source line is found that hit counter is increased by one for this line. 3. Add a new public V8 API to get the hit source lines by CDT CPU profiler. Note that it's expected a minor patch in Blink to pack the source level info in JSON to be shown. 4.Add a test that checks how the samples are distributed through source lines. It tests two cases: (1) relocation info created during code generation and (2) relocation info associated with precompiled function's version. Patch from Denis Pravdin <denis.pravdin@intel.com>; BUG=None LOG=Y R=svenpanne@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=24389

Patch Set 1 #

Patch Set 2 : Moved JITLineInfoTable into profile-generator.cc #

Patch Set 3 : Fixed x64.debug linker error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+346 lines, -55 lines) Patch
M include/v8-profiler.h View 2 chunks +20 lines, -0 lines 0 comments Download
M src/api.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M src/cpu-profiler.cc View 6 chunks +34 lines, -12 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/profile-generator.h View 1 10 chunks +48 lines, -11 lines 0 comments Download
M src/profile-generator.cc View 1 2 14 chunks +120 lines, -23 lines 0 comments Download
M src/profile-generator-inl.h View 3 chunks +12 lines, -9 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 1 chunk +98 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
yurys
Patch set #1 is exact copy of https://codereview.chromium.org/424973004/. I moved implementation JITLineInfoTable into profile-generator.cc (PS#2) ...
6 years, 2 months ago (2014-10-02 08:40:34 UTC) #2
yurys
Sven, can you stamp this please?
6 years, 2 months ago (2014-10-02 08:42:20 UTC) #3
Sven Panne
lgtm
6 years, 2 months ago (2014-10-02 08:43:30 UTC) #4
yurys
Committed patchset #3 (id:40001) manually as 24389 (presubmit successful).
6 years, 2 months ago (2014-10-02 09:20:48 UTC) #5
yurys
A revert of this CL (patchset #3 id:40001) has been created in https://codereview.chromium.org/624443005/ by yurys@chromium.org. ...
6 years, 2 months ago (2014-10-02 11:52:37 UTC) #6
Denis Pravdin
On 2014/10/02 11:52:37, yurys wrote: > A revert of this CL (patchset #3 id:40001) has ...
6 years, 2 months ago (2014-10-03 07:50:23 UTC) #7
yurys
On 2014/10/03 07:50:23, Denis Pravdin wrote: > On 2014/10/02 11:52:37, yurys wrote: > > A ...
6 years, 2 months ago (2014-10-03 08:03:42 UTC) #8
Denis Pravdin
6 years, 2 months ago (2014-10-03 08:07:33 UTC) #9
Message was sent while issue was closed.
On 2014/10/03 08:03:42, yurys wrote:
> On 2014/10/03 07:50:23, Denis Pravdin wrote:
> > On 2014/10/02 11:52:37, yurys wrote:
> > > A revert of this CL (patchset #3 id:40001) has been created in
> > > https://codereview.chromium.org/624443005/ by mailto:yurys@chromium.org.
> > > 
> > > The reason for reverting is: It broke layout test
> > > fast/events/window-onerror-02.html:
> > > 
> > >
> >
>
http://build.chromium.org/p/client.v8/builders/V8-Blink%20Linux%2064%20%28dbg....
> > 
> > Yurys,
> > 
> > Which steps are expected in this case from my end? I should triage why the
> test
> > fails and fix it. Once it's done that a new patch should be uploaded for
> review.
> > Right?
> > 
> Correct. Looks like your patch regresses behavior of window.onerror so this
> needs to be fixed before landing. You can reproduce it by checking out and
> building Blink, instructions for running layout tests can be found at
>
http://www.chromium.org/developers/testing/webkit-layout-tests#TOC-Running-th...
> 
> Alternatively if you don't want to build Blink you can try to come up with a
> reduced test case that could be executed with bare V8. The error event passed
> into window.onerror is constructed based on the data passed into message
> listener added to v8 via v8::V8::AddMessageListener();. So you can probably
add
> a new test to test/cctest/ that would execute script similar to the one in
> fast/events/window-onerror-02.htm and check that the error column passed into
> the message listener is correct.
> 
> 
> 
> > Thanks,
> > Denis

Got it. Thanks for advice!

Powered by Google App Engine
This is Rietveld 408576698