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

Issue 2053523003: Refactor CpuProfiler. (Closed)

Created:
4 years, 6 months ago by lpy
Modified:
4 years, 6 months ago
CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com, Michael Achenbach
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Reland] Refactor CpuProfiler. Currently CpuProfiler is a subclass of CodeEventListener, it listens code events from Logger, constructs and stores CodeEventsContainer. This patch is part of the effort to split the logic of CodeEventListener as ProfilerListener out of the profiling functionality logic in CpuProfiler. A ProfilerListener will listen to code events, construct code event to CodeEventsContainer and pass it to code event handler. The reason we refactor CpuProfiler is that eventually we want to move CpuProfiler as part of sampler library and code event listener should stay inside V8. Main changes: 1. Refactored CpuProfiler into two parts, the CpuProfiler with profling functionality and the ProfilerListener listening to code events from Logger. 2. Created CodeEventObserver and made CpuProfiler inherit from it. ProfilerListener will have a list of observers and call CodeEventHandler once a code event is created. 3. Moved code entry list from CodeEntry to ProfilerListener. Minor changes: 1. Moved static code entry as part of CodeEntry. 2. Added ProfilerListener to Logger. BUG=v8:4789 Committed: https://crrev.com/cb59fc1facc9b390e2c7544b4da56a4e0a9b3222 Committed: https://crrev.com/04f710ac20e30ca2d903b0853947b6660ad1e16d Cr-Original-Commit-Position: refs/heads/master@{#37112} Cr-Commit-Position: refs/heads/master@{#37195}

Patch Set 1 #

Patch Set 2 : Move CpuProfilerManager to .cc #

Total comments: 1

Patch Set 3 : rebase #

Patch Set 4 : remove cpuprofilermanager, use code event observer #

Patch Set 5 #

Patch Set 6 #

Total comments: 6

Patch Set 7 #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Total comments: 14

Patch Set 10 : address alph's comments #

Total comments: 16

Patch Set 11 #

Total comments: 10

Patch Set 12 : stop profiler listener when there's no cpu profiler #

Total comments: 14

Patch Set 13 : addressed alph's nits. #

Patch Set 14 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+357 lines, -1049 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M src/log.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +10 lines, -0 lines 0 comments Download
M src/log.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +19 lines, -0 lines 0 comments Download
M src/profiler/cpu-profiler.h View 1 2 3 4 5 6 7 8 5 chunks +6 lines, -28 lines 0 comments Download
M src/profiler/cpu-profiler.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +22 lines, -290 lines 0 comments Download
M src/profiler/profile-generator.h View 1 2 3 4 5 6 7 8 4 chunks +40 lines, -33 lines 0 comments Download
M src/profiler/profile-generator.cc View 1 2 3 4 5 6 7 8 7 chunks +41 lines, -41 lines 0 comments Download
A + src/profiler/profiler-listener.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +58 lines, -227 lines 0 comments Download
A + src/profiler/profiler-listener.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +94 lines, -392 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +46 lines, -24 lines 0 comments Download
M test/cctest/test-profile-generator.cc View 1 2 3 4 5 6 7 8 6 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 36 (12 generated)
lpy
PTAL.
4 years, 6 months ago (2016-06-09 17:56:07 UTC) #2
alph
https://codereview.chromium.org/2053523003/diff/20001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/20001/src/profiler/cpu-profiler.cc#newcode28 src/profiler/cpu-profiler.cc:28: static void DispatchCodeEvents(const CodeEventsContainer& evt_rec) { Hmm, not sure ...
4 years, 6 months ago (2016-06-10 22:00:24 UTC) #3
lpy
On 2016/06/10 22:00:24, alph wrote: > https://codereview.chromium.org/2053523003/diff/20001/src/profiler/cpu-profiler.cc > File src/profiler/cpu-profiler.cc (right): > > https://codereview.chromium.org/2053523003/diff/20001/src/profiler/cpu-profiler.cc#newcode28 > ...
4 years, 6 months ago (2016-06-13 12:21:49 UTC) #5
alph
https://codereview.chromium.org/2053523003/diff/100001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/100001/src/profiler/cpu-profiler.cc#newcode293 src/profiler/cpu-profiler.cc:293: RESOLVE_CODE_EVENT(isolate_); Why it needs to be a macro? https://codereview.chromium.org/2053523003/diff/100001/src/profiler/profiler-listener.cc ...
4 years, 6 months ago (2016-06-14 03:48:45 UTC) #6
lpy
I updated the CL. PTAL. https://codereview.chromium.org/2053523003/diff/100001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/100001/src/profiler/cpu-profiler.cc#newcode293 src/profiler/cpu-profiler.cc:293: RESOLVE_CODE_EVENT(isolate_); On 2016/06/14 03:48:45, ...
4 years, 6 months ago (2016-06-14 09:53:47 UTC) #7
lpy
I rebased the CL. gentle ping.
4 years, 6 months ago (2016-06-15 15:20:25 UTC) #8
Yang
On 2016/06/15 15:20:25, lpy wrote: > I rebased the CL. > gentle ping. lgtm.
4 years, 6 months ago (2016-06-16 04:38:20 UTC) #9
alph
https://codereview.chromium.org/2053523003/diff/160001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/160001/src/profiler/cpu-profiler.cc#newcode206 src/profiler/cpu-profiler.cc:206: case CodeEventRecord::CODE_DISABLE_OPT: { nit: drop {} https://codereview.chromium.org/2053523003/diff/160001/src/profiler/cpu-profiler.cc#newcode212 src/profiler/cpu-profiler.cc:212: CodeDeoptEventRecord* ...
4 years, 6 months ago (2016-06-16 09:31:22 UTC) #10
lpy
Thanks for the comments. PTAL. https://codereview.chromium.org/2053523003/diff/160001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/160001/src/profiler/cpu-profiler.cc#newcode206 src/profiler/cpu-profiler.cc:206: case CodeEventRecord::CODE_DISABLE_OPT: { On ...
4 years, 6 months ago (2016-06-16 12:40:52 UTC) #11
alph
https://codereview.chromium.org/2053523003/diff/180001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/180001/src/profiler/cpu-profiler.cc#newcode291 src/profiler/cpu-profiler.cc:291: profiler_listener->StartBuildingCodeEntry(); EnableBuildingCodeEntries ? https://codereview.chromium.org/2053523003/diff/180001/src/profiler/profile-generator.h File src/profiler/profile-generator.h (right): https://codereview.chromium.org/2053523003/diff/180001/src/profiler/profile-generator.h#newcode124 src/profiler/profile-generator.h:124: ...
4 years, 6 months ago (2016-06-17 10:38:45 UTC) #12
lpy
Thanks, I addressed comments. https://codereview.chromium.org/2053523003/diff/180001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/180001/src/profiler/cpu-profiler.cc#newcode291 src/profiler/cpu-profiler.cc:291: profiler_listener->StartBuildingCodeEntry(); On 2016/06/17 10:38:44, alph_slow ...
4 years, 6 months ago (2016-06-17 13:55:00 UTC) #13
alph
https://codereview.chromium.org/2053523003/diff/200001/src/profiler/cpu-profiler.cc File src/profiler/cpu-profiler.cc (right): https://codereview.chromium.org/2053523003/diff/200001/src/profiler/cpu-profiler.cc#newcode290 src/profiler/cpu-profiler.cc:290: logger->SetUpProfilerListener(); So basically now once profiler is started if ...
4 years, 6 months ago (2016-06-17 14:25:18 UTC) #14
lpy
PTAL. I updated the CL. Now profiler listener will be removed from code event dispatcher ...
4 years, 6 months ago (2016-06-17 23:09:02 UTC) #15
alph
Thank you. lgtm % nits https://codereview.chromium.org/2053523003/diff/220001/src/log.cc File src/log.cc (right): https://codereview.chromium.org/2053523003/diff/220001/src/log.cc#newcode763 src/log.cc:763: profiler_listener_.reset(); nit: don't need ...
4 years, 6 months ago (2016-06-19 03:05:41 UTC) #16
lpy
Thanks for the review. https://codereview.chromium.org/2053523003/diff/220001/src/log.cc File src/log.cc (right): https://codereview.chromium.org/2053523003/diff/220001/src/log.cc#newcode763 src/log.cc:763: profiler_listener_.reset(); On 2016/06/19 03:05:40, alph_slow ...
4 years, 6 months ago (2016-06-20 17:16:55 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2053523003/240001
4 years, 6 months ago (2016-06-20 17:23:31 UTC) #20
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 6 months ago (2016-06-20 17:25:37 UTC) #22
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/cb59fc1facc9b390e2c7544b4da56a4e0a9b3222 Cr-Commit-Position: refs/heads/master@{#37112}
4 years, 6 months ago (2016-06-20 17:26:51 UTC) #24
lpy
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.chromium.org/2079273003/ by lpy@chromium.org. ...
4 years, 6 months ago (2016-06-20 17:51:45 UTC) #25
lpy
cc v8-mips-ports@ group This CL couldn't be compiled in V8 ports on V8 Mips builder ...
4 years, 6 months ago (2016-06-20 20:32:20 UTC) #27
lpy
As we discussed, I will check in the code one more time to see if ...
4 years, 6 months ago (2016-06-22 16:15:47 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2053523003/260001
4 years, 6 months ago (2016-06-22 16:16:04 UTC) #32
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 6 months ago (2016-06-22 16:43:59 UTC) #34
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 16:47:09 UTC) #36
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/04f710ac20e30ca2d903b0853947b6660ad1e16d
Cr-Commit-Position: refs/heads/master@{#37195}

Powered by Google App Engine
This is Rietveld 408576698