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

Issue 682143003: Reland of Extend CPU profiler with mapping ticks to source lines (Closed)

Created:
6 years, 1 month ago by Weiliang
Modified:
6 years, 1 month ago
Reviewers:
Sven Panne, alph, yurys, danno
CC:
v8-dev, Paweł Hajdan Jr., Denis Pravdin
Project:
v8
Visibility:
Public.

Description

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>; R=svenpanne@chromium.org, yurys@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=25182

Patch Set 1 #

Patch Set 2 : rebased #

Total comments: 4

Patch Set 3 : addressed comments #

Patch Set 4 : rebased #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+343 lines, -50 lines) Patch
M include/v8-profiler.h View 2 chunks +20 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 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/profile-generator.h View 1 2 3 11 chunks +50 lines, -11 lines 0 comments Download
M src/profile-generator.cc View 1 2 3 14 chunks +121 lines, -23 lines 0 comments Download
M src/profile-generator-inl.h View 1 2 3 3 chunks +7 lines, -4 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 1 2 1 chunk +98 lines, -0 lines 1 comment Download

Messages

Total messages: 16 (1 generated)
Weiliang
Hi yurys and all Could you please take a look this relanding patch? The failure ...
6 years, 1 month ago (2014-10-29 05:09:15 UTC) #2
yurys
lgtm
6 years, 1 month ago (2014-10-29 14:52:08 UTC) #3
yurys
On 2014/10/29 05:09:15, Weiliang wrote: > Hi yurys and all > > Could you please ...
6 years, 1 month ago (2014-10-29 14:52:56 UTC) #4
Weiliang
On 2014/10/29 14:52:56, yurys wrote: > On 2014/10/29 05:09:15, Weiliang wrote: > > Hi yurys ...
6 years, 1 month ago (2014-10-30 07:29:12 UTC) #5
yurys
Sven, can you do OWNERS review please. It is the same CL as https://codereview.chromium.org/616963005 but ...
6 years, 1 month ago (2014-10-30 08:35:55 UTC) #6
Weiliang
On 2014/10/30 08:35:55, yurys wrote: > Sven, can you do OWNERS review please. It is ...
6 years, 1 month ago (2014-11-03 06:00:08 UTC) #7
yurys
Still waiting for OWNERS review.
6 years, 1 month ago (2014-11-04 17:24:35 UTC) #8
Weiliang
On 2014/11/04 17:24:35, yurys wrote: > Still waiting for OWNERS review. @danno, @seven Could you ...
6 years, 1 month ago (2014-11-05 02:36:39 UTC) #9
Sven Panne
LGTM with 2 nits. https://codereview.chromium.org/682143003/diff/20001/src/profile-generator-inl.h File src/profile-generator-inl.h (right): https://codereview.chromium.org/682143003/diff/20001/src/profile-generator-inl.h#newcode42 src/profile-generator-inl.h:42: static bool LineTickMatch(void* a, void* ...
6 years, 1 month ago (2014-11-05 10:41:25 UTC) #10
Weiliang
Thanks for review. Please have a look at the patch set 4 and help landing. ...
6 years, 1 month ago (2014-11-05 15:15:08 UTC) #11
Weiliang
On 2014/11/05 15:15:08, Weiliang wrote: > Thanks for review. > > Please have a look ...
6 years, 1 month ago (2014-11-06 07:16:54 UTC) #12
Sven Panne
NOT LGTM https://codereview.chromium.org/682143003/diff/60001/test/cctest/test-cpu-profiler.cc File test/cctest/test-cpu-profiler.cc (right): https://codereview.chromium.org/682143003/diff/60001/test/cctest/test-cpu-profiler.cc#newcode1111 test/cctest/test-cpu-profiler.cc:1111: ProfilerEventsProcessor* processor = new ProfilerEventsProcessor( Now we've ...
6 years, 1 month ago (2014-11-06 07:51:41 UTC) #13
Weiliang
On 2014/11/06 07:51:41, Sven Panne wrote: > NOT LGTM > > https://codereview.chromium.org/682143003/diff/60001/test/cctest/test-cpu-profiler.cc > File test/cctest/test-cpu-profiler.cc ...
6 years, 1 month ago (2014-11-06 08:27:06 UTC) #14
Sven Panne
On 2014/11/06 08:27:06, Weiliang wrote: > Actually I don't quite understand what your old comment ...
6 years, 1 month ago (2014-11-06 09:14:16 UTC) #15
Sven Panne
6 years, 1 month ago (2014-11-06 09:16:45 UTC) #16
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as 25182 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698