• erikchen's avatar
    [Reland #1] Clean up of memory instrumentation interface. · 53cddfe6
    erikchen authored
    The original CL caused two race conditions to trigger more frequently. These
    have been fixed at
    https://chromium-review.googlesource.com/c/chromium/src/+/917243.
    
    > This CL cleans up both the public interface and private implementation of memory
    > instrumentation. It is in preparation for allowing memory instrumentation to
    > asynchronously add heap dumps to traces.
    >
    > memory_instrumentation supports two interfaces: HeapProfilerHelper and
    > Coordinator [specifically RequestGlobalMemoryDump]. They are used by different
    > clients, with different privileges, for different purposes. The internal
    > implementation used a single code path to support both, which further results in
    > leakage of implementation details into the mojom interface, in the form of
    > LevelOfDetail::VM_REGIONS_ONLY_FOR_HEAP_PROFILER.
    >
    > The previous implementation only allowed 1 global dump to be issued at a time.
    > This causes problems for my upcoming refactor, which makes
    > memory_instrumentation, during a global dump, request a heap dump from the
    > profiling service. The profiling service in turn requests heaps from
    > memory_instrumentation, resulting in a deadlock.
    >
    > This CL updates the implementation of CoordinatorImpl to use a separate queue of
    > |in_progress_vm_region_requests_| to track heap dump requests. These are
    > executed as soon as they are received. This CL also removes
    > LevelOfDetail::VM_REGIONS_ONLY_FOR_HEAP_PROFILER, and updates
    > GetVmRegionsForHeapProfiler to explicitly specify PIDs to dump.
    >
    > Bug: 758739
    > Change-Id: I4add68c2e3acc8eeb66d99731fce59063ac5e23f
    > Reviewed-on: https://chromium-review.googlesource.com/900222
    > Commit-Queue: Erik Chen <erikchen@chromium.org>
    > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    > Reviewed-by: Ilya Sherman <isherman@chromium.org>
    > Reviewed-by: Primiano Tucci <primiano@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#536263}
    
    Change-Id: I4add68c2e3acc8eeb66d99731fce59063ac5e23f
    Bug: 758739
    TBR: isherman@chromium.org, dcheng@chromium.org, primiano@chromium.org
    Reviewed-on: https://chromium-review.googlesource.com/916501
    Commit-Queue: Erik Chen <erikchen@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#536878}
    53cddfe6
memlog_connection_manager.cc 14.2 KB