|
|
Description[Tracing] Make TracingCategoryObserver v8 internal.
This patch removes TracingCategoryObserver API and moves the creation of
observer inside platform initialization, by assuming that either
Platform::AddTraceStateObserver is implemented correctly to add observer to
tracing controller that implemented by embedders, or default tracing controller
has already been set up and attached to platform before
v8::V8::InitializePlatform is called.
BUG=v8:5590
Committed: https://crrev.com/2525b0573b28e929a25a41ac7b57bdb84d9abf40
Cr-Commit-Position: refs/heads/master@{#40739}
Patch Set 1 #
Total comments: 6
Patch Set 2 : address alph's comments #
Total comments: 1
Patch Set 3 : use unique_ptr #
Total comments: 1
Messages
Total messages: 69 (52 generated)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lpy@chromium.org changed reviewers: + alph@chromium.org, fmeawad@chromium.org
PTAL.
I like this approach better because I believe that Embedders should not be aware of the TraceCategoryObserver which is what this CL accomplish. On the other hand, since we need a V8 internal code to initialize the observer, we need to make sure that this code is called after Creating the TracingController and setting it in the profiler. So the choice here for that is v8::V8::InitializePlatform. If the V8 team is aware of another piece of code that is also internal in V8 and that is guaranteed to run early enough but after the platform creation, please let us know. lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng/builds/15524) v8_linux64_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng_triggered...)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_compile_dbg on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_compile_dbg/builds/2...)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_compile_dbg on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_compile_dbg/builds/2...)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng...)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng...)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #7 (id:120001) has been deleted
Patchset #6 (id:100001) has been deleted
Patchset #5 (id:80001) has been deleted
Patchset #4 (id:60001) has been deleted
Patchset #3 (id:40001) has been deleted
Patchset #2 (id:20001) has been deleted
Dry run: Try jobs failed on following builders: v8_linux_chromium_gn_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_chromium_gn_rel/bu...) v8_win_compile_dbg on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_compile_dbg/builds/2...) v8_win_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel_ng/builds/17197)
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng...) v8_win_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_rel_ng/builds/17199)
Thank you. lgtm https://codereview.chromium.org/2471583004/diff/1/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/2471583004/diff/1/src/d8.cc#newcode2834 src/d8.cc:2834: platform::SetTracingController(g_platform, tracing_controller); who is responsible for deleting tracing_controller under FLAG_verify_predictable? https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... File src/tracing/tracing-category-observer.cc (right): https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... src/tracing/tracing-category-observer.cc:15: std::unique_ptr<TracingCategoryObserver> g_tracing_category_observer; nit: You can make it a static field inside the class. https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... File src/tracing/tracing-category-observer.h (right): https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... src/tracing/tracing-category-observer.h:28: ~TracingCategoryObserver() = default; nit: not needed
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #2 (id:140001) has been deleted
Thanks, I updated the comments. https://codereview.chromium.org/2471583004/diff/1/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/2471583004/diff/1/src/d8.cc#newcode2834 src/d8.cc:2834: platform::SetTracingController(g_platform, tracing_controller); On 2016/11/02 20:18:23, alph wrote: > who is responsible for deleting tracing_controller under > FLAG_verify_predictable? Done. https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... File src/tracing/tracing-category-observer.cc (right): https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... src/tracing/tracing-category-observer.cc:15: std::unique_ptr<TracingCategoryObserver> g_tracing_category_observer; On 2016/11/02 20:18:23, alph wrote: > nit: You can make it a static field inside the class. Done. https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... File src/tracing/tracing-category-observer.h (right): https://codereview.chromium.org/2471583004/diff/1/src/tracing/tracing-categor... src/tracing/tracing-category-observer.h:28: ~TracingCategoryObserver() = default; On 2016/11/02 20:18:23, alph wrote: > nit: not needed Done.
On 2016/11/02 21:52:27, lpy wrote: > Thanks, I updated the comments. > ah sorry, I meant I updated the patch.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by lpy@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from fmeawad@chromium.org, alph@chromium.org Link to the patchset: https://codereview.chromium.org/2471583004/#ps160001 (title: "address alph's comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/27708)
lpy@chromium.org changed reviewers: + jochen@chromium.org
+ jochen@ for review. PTAL.
https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc#newcode2955 src/d8.cc:2955: delete tracing_controller; nit: using unique_ptr would help you avoid dealing with delete here.
On 2016/11/02 22:31:52, alph wrote: > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc > File src/d8.cc (right): > > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc#newcode2955 > src/d8.cc:2955: delete tracing_controller; > nit: using unique_ptr would help you avoid dealing with delete here. platform holds tracing controller in unique_ptr, see https://cs.chromium.org/chromium/src/v8/src/libplatform/default-platform.cc?s... is it safe to have another unique_ptr here to hold the tracing controller?
lgtm
On 2016/11/02 22:34:41, lpy wrote: > On 2016/11/02 22:31:52, alph wrote: > > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc > > File src/d8.cc (right): > > > > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc#newcode2955 > > src/d8.cc:2955: delete tracing_controller; > > nit: using unique_ptr would help you avoid dealing with delete here. > > platform holds tracing controller in unique_ptr, see > https://cs.chromium.org/chromium/src/v8/src/libplatform/default-platform.cc?s... > > is it safe to have another unique_ptr here to hold the tracing controller? It is safe. You call release on the pointer when you pass ownership to the platform.
The CQ bit was checked by lpy@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/11/03 15:07:39, alph wrote: > On 2016/11/02 22:34:41, lpy wrote: > > On 2016/11/02 22:31:52, alph wrote: > > > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc > > > File src/d8.cc (right): > > > > > > https://codereview.chromium.org/2471583004/diff/160001/src/d8.cc#newcode2955 > > > src/d8.cc:2955: delete tracing_controller; > > > nit: using unique_ptr would help you avoid dealing with delete here. > > > > platform holds tracing controller in unique_ptr, see > > > https://cs.chromium.org/chromium/src/v8/src/libplatform/default-platform.cc?s... > > > > is it safe to have another unique_ptr here to hold the tracing controller? > > It is safe. You call release on the pointer when you pass ownership to the > platform. Thanks, done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by lpy@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org, alph@chromium.org, fmeawad@chromium.org Link to the patchset: https://codereview.chromium.org/2471583004/#ps180001 (title: "use unique_ptr")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #3 (id:180001)
Message was sent while issue was closed.
https://codereview.chromium.org/2471583004/diff/180001/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/2471583004/diff/180001/src/d8.cc#newcode2834 src/d8.cc:2834: platform::SetTracingController(g_platform, tracing_controller.get()); you can use release right here. it returns raw pointer.
Message was sent while issue was closed.
Description was changed from ========== [Tracing] Make TracingCategoryObserver v8 internal. This patch removes TracingCategoryObserver API and moves the creation of observer inside platform initialization, by assuming that either Platform::AddTraceStateObserver is implemented correctly to add observer to tracing controller that implemented by embedders, or default tracing controller has already been set up and attached to platform before v8::V8::InitializePlatform is called. BUG=v8:5590 ========== to ========== [Tracing] Make TracingCategoryObserver v8 internal. This patch removes TracingCategoryObserver API and moves the creation of observer inside platform initialization, by assuming that either Platform::AddTraceStateObserver is implemented correctly to add observer to tracing controller that implemented by embedders, or default tracing controller has already been set up and attached to platform before v8::V8::InitializePlatform is called. BUG=v8:5590 Committed: https://crrev.com/2525b0573b28e929a25a41ac7b57bdb84d9abf40 Cr-Commit-Position: refs/heads/master@{#40739} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/2525b0573b28e929a25a41ac7b57bdb84d9abf40 Cr-Commit-Position: refs/heads/master@{#40739} |