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

Issue 1333873002: [tracing] Fix MemoryDumpManager to support startup tracing (Closed)

Created:
5 years, 3 months ago by Primiano Tucci (use gerrit)
Modified:
5 years, 2 months ago
CC:
Daniel Bratell, chromium-reviews, darin-cc_chromium.org, jam, tracing+reviews_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Fix MemoryDumpManager to support startup tracing This CL simplifies a lot the design of the MemoryDumpManager (MDM) initialization (\o/). Before this change the MDM had a two-stage initialization: 1. Initialize() that was registering to the TraceLog enabled stateobserver; 2. SetDelegate() that was setting the inversion-of-control delegate. This design was fragile as it required to think about the two possible sequences of events (1 -> 2 or 2 -> 1) and not really necessary. The simplification herein introduced consists in: - Drop the IsCoordinatorProcess() method from the delegate. That information is not supposed to change over time and is known at MDM initialization time. - Merge the SetDelegate() into the Initialize() call. There is no point allowing to initialize the MDM without a delegate, so why bother? Moved all the initialization to the point where the delegate (concretelly the TracingControllerImpl) is ready. As a side effect, startup tracing now works properly (tests are coming in a separate CL). BUG=524057 TEST=--trace-startup=-*,disabled-by-default-memory-infra --trace-startup-file=/tmp/startup.json Committed: https://crrev.com/ba4ca8421832350dd3335a8bd7abea9f0e1311b6 Cr-Commit-Position: refs/heads/master@{#348168}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Fix browsertest #

Total comments: 3

Patch Set 3 : Re dsinclair #5 (nits, invert Initialize args) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -105 lines) Patch
M base/trace_event/memory_dump_manager.h View 1 2 4 chunks +16 lines, -13 lines 0 comments Download
M base/trace_event/memory_dump_manager.cc View 1 2 7 chunks +31 lines, -31 lines 0 comments Download
M base/trace_event/memory_dump_manager_unittest.cc View 1 2 25 chunks +51 lines, -37 lines 0 comments Download
M components/tracing/child_memory_dump_manager_delegate_impl.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/tracing/child_memory_dump_manager_delegate_impl.cc View 1 2 2 chunks +3 lines, -7 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/tracing/memory_tracing_browsertest.cc View 1 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/tracing/tracing_controller_impl.cc View 1 2 2 chunks +2 lines, -5 lines 0 comments Download
M content/child/child_thread_impl.cc View 2 chunks +0 lines, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 17 (4 generated)
Primiano Tucci (use gerrit)
Dan, could you PTAL to this? Test is coming separately in crrev.com/1335503003 I'm doing that ...
5 years, 3 months ago (2015-09-10 11:34:10 UTC) #2
Primiano Tucci (use gerrit)
In the meantime +sievers for 2 lines changes in: content/browser/browser_main_loop.cc content/child/child_thread_impl.cc I hope you don't ...
5 years, 3 months ago (2015-09-10 14:09:38 UTC) #4
dsinclair
https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc#newcode153 base/trace_event/memory_dump_manager.cc:153: bool is_tracing_already_enabled = TraceLog::GetInstance()->IsEnabled(); Move the bool and the ...
5 years, 3 months ago (2015-09-10 14:16:28 UTC) #5
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc#newcode153 base/trace_event/memory_dump_manager.cc:153: bool is_tracing_already_enabled = TraceLog::GetInstance()->IsEnabled(); On 2015/09/10 14:16:28, dsinclair wrote: ...
5 years, 3 months ago (2015-09-10 14:48:12 UTC) #6
dsinclair
https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc#newcode153 base/trace_event/memory_dump_manager.cc:153: bool is_tracing_already_enabled = TraceLog::GetInstance()->IsEnabled(); On 2015/09/10 14:48:12, Primiano Tucci ...
5 years, 3 months ago (2015-09-10 14:53:49 UTC) #7
dsinclair
lgtm https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1333873002/diff/1/base/trace_event/memory_dump_manager.cc#newcode153 base/trace_event/memory_dump_manager.cc:153: bool is_tracing_already_enabled = TraceLog::GetInstance()->IsEnabled(); On 2015/09/10 14:53:49, dsinclair ...
5 years, 3 months ago (2015-09-10 15:01:47 UTC) #8
Primiano Tucci (use gerrit)
Thanks. Tested startup tracing, seems to work even on Windows \o/ CC: +bratell so he ...
5 years, 3 months ago (2015-09-10 15:03:15 UTC) #9
Primiano Tucci (use gerrit)
+jochen for removing 2 lines in: content/browser/browser_main_loop.cc content/child/child_thread_impl.cc
5 years, 3 months ago (2015-09-10 15:37:15 UTC) #11
jochen (gone - plz use gerrit)
lgtm
5 years, 3 months ago (2015-09-10 15:57:37 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1333873002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1333873002/40001
5 years, 3 months ago (2015-09-10 15:58:05 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 3 months ago (2015-09-10 16:51:07 UTC) #15
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/ba4ca8421832350dd3335a8bd7abea9f0e1311b6 Cr-Commit-Position: refs/heads/master@{#348168}
5 years, 3 months ago (2015-09-10 16:51:55 UTC) #16
commit-bot: I haz the power
5 years, 2 months ago (2015-09-23 12:11:22 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/ba4ca8421832350dd3335a8bd7abea9f0e1311b6
Cr-Commit-Position: refs/heads/master@{#348168}

Powered by Google App Engine
This is Rietveld 408576698