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) #Dependent Patchsets: Messages
Total messages: 17 (4 generated)
|