[tracing] Warmup the ThreadLocalEventBuffer when MemoryInfra is enabled
When memory tracing is enabled, the initialization of
ThreadLocalEventBuffer registers its own MemoryDumpProvider to account
for the memory overhead caused by tracing itself.
Before this CL, the ThreadLocalEventBuffer is lazily initialized the
first time a TRACE_EVENT* is called. Doing that w/ MemoryInfra enabled
though could lead to a deadlock if the first TRACE_EVENT happens in
the middle of a memory dump, in which case the ThreadLocalEventBuffer
would try to register a dump provider while dumping.
Races are broken by ensuring that, when a dump provider is being
registered, the ThreadLocalEventBuffer for its thread is being
initialized.
BUG=500569
Review URL: https://codereview.chromium.org/
1191473004
Cr-Commit-Position: refs/heads/master@{#334689}