New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 827545 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 758739



Sign in to add a comment

Hook up heap profiling service on android webview.

Project Member Reported by erikc...@chromium.org, Mar 30 2018

Issue description

There are currently two implementations of heap profiling in Chrome. I'd like to remove the older one [--enable-heap-profiling] and replace it with the newer one [--memlog]. 

This work is tracked in: https://bugs.chromium.org/p/chromium/issues/detail?id=758739

I recently discovered that --enable-heap-profiling works for Android Webview [because it's implemented in base], but --memlog is not, because it's implemented in chrome/, which isn't compiled for Android webview. While this feature has historically not been used, I've been informed that the WebView team intends to use it in the future to study memory usage.

My current plan is to move the logic from chrome/ to components/services/heap_profiling. But I will still need to hook up the control logic for Android WebView. I'm not familiar with the process architecture and control flow for Android WebView. Is there documentation/design docs somewhere?
 
Blocking: 758739
Cc: changwan@chromium.org
+ changwan.

Torne, changwan - we should meet on monday to discuss requirements.
Posting meeting notes.

"""

Context: Legacy Heap Profiling [LHP] currently works for Android WebView. Out of Process Heap Profiling [OOPHP] does not. Goal is to obtain comparable functionality in OOP HP so that we can get rid of LHP. 

staffing: erikchen@ will work on this [but is transitioning off memory this quarter, so is trying to get MVP out the door]

Questions: Primary use case? External Developers create WebView, then destroy. Leaks 10MB of native memory. WebView Developers want to be able to track down source of leak.

Q2 OKR: Get metrics (?) - begin exploration.
Actual usage will probably happen in Q3-Q4.

WebView supports multiprocess on N+. OOPHP requires multiprocess. We will only target support for WebView w/ multiprocess. [we do not expect there to be many bugs that only occur on M and older].

Data acquisition - WebView supports chrome://tracing, which contains the heap dump. No extra work should be necessary.

Symbolization - ssid@ reports that symbolize_trace.py should "just work". 

Tests: There are currently no tests for LHP + WebView. Tests are nice to have, but not MVP for OOP HP + WebView.

Renderer profiling: Use case is not clear. Nice to have but not MVP.
"""
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d4a60101e60e09d13481969043fcccc1e3e92e3

commit 0d4a60101e60e09d13481969043fcccc1e3e92e3
Author: erikchen <erikchen@chromium.org>
Date: Tue Apr 03 16:06:33 2018

Create components/services/heap_profiling.

This CL sets up the directory structure of components/services/heap_profiling
and moves in the profiling mojom files. It has no intended behavioral change.

This is in preparation for moving the rest of the heap profiling logic into
components/services/heap_profiling in order to support Android WebView.

Bug:  827545 
Change-Id: I8409c2fc67d96b18ac148538da7f2a0f7a79b9dd
Reviewed-on: https://chromium-review.googlesource.com/990495
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547724}
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/common/profiling/BUILD.gn
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/common/profiling/DEPS
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/common/profiling/memlog_allocator_shim.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/common/profiling/profiling_client.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/profiling/DEPS
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/profiling/json_exporter.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/profiling/memlog_connection_manager.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/profiling/profiling_service.h
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/utility/DEPS
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/chrome/utility/chrome_content_utility_client.cc
[add] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/OWNERS
[add] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/README.md
[add] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/public/BUILD.gn
[add] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/public/mojom/OWNERS
[rename] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/public/mojom/constants.mojom
[rename] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/public/mojom/heap_profiling_client.mojom
[rename] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/components/services/heap_profiling/public/mojom/heap_profiling_service.mojom
[modify] https://crrev.com/0d4a60101e60e09d13481969043fcccc1e3e92e3/services/README.md

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/550509780bc4960495de55aa092b77809be8c42c

commit 550509780bc4960495de55aa092b77809be8c42c
Author: erikchen <erikchen@chromium.org>
Date: Wed Apr 04 23:30:47 2018

Move code from chrome/common/profiling into components/services/heap_profiling.

This CL has no intended behavior change.

In addition to moving and renaming the classes, this CL:
  * Renamed all classes to remove "memlog_" or "profiling_" prefixes.
  * Removed profiling_constants.h and profiling_constants.cc, which were unused.
  * Moved binding logic from profiling_client.cc into chrome_content_client.cc
    to meet DEPs requirements.

Change-Id: I1ea59ef056c0592c29ff4b1a39412c17ed1c0219
Bug:  827545 
Reviewed-on: https://chromium-review.googlesource.com/995872
Reviewed-by: Cait Phillips <caitkp@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548247}
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/DEPS
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/app/chrome_main_delegate.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/common/BUILD.gn
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/common/chrome_content_client.cc
[delete] https://crrev.com/5adb5e2a22ca75a5579cb97bd050803cbdc809d2/chrome/common/profiling/BUILD.gn
[delete] https://crrev.com/5adb5e2a22ca75a5579cb97bd050803cbdc809d2/chrome/common/profiling/OWNERS
[delete] https://crrev.com/5adb5e2a22ca75a5579cb97bd050803cbdc809d2/chrome/common/profiling/profiling_client.cc
[delete] https://crrev.com/5adb5e2a22ca75a5579cb97bd050803cbdc809d2/chrome/common/profiling/profiling_constants.cc
[delete] https://crrev.com/5adb5e2a22ca75a5579cb97bd050803cbdc809d2/chrome/common/profiling/profiling_constants.h
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/allocation_event.h
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/json_exporter.h
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/memlog_connection_manager.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/memlog_receiver.h
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/memlog_receiver_pipe_posix.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/memlog_receiver_pipe_win.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/profiling/memlog_stream_parser.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/renderer/chrome_content_renderer_client.cc
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/test/BUILD.gn
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/chrome/utility/BUILD.gn
[modify] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/BUILD.gn
[add] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/DEPS
[add] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/BUILD.gn
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/DEPS
[add] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/OWNERS
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/allocator_shim.cc
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/allocator_shim.h
[add] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/client.cc
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/client.h
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/sender_pipe.h
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/sender_pipe_posix.cc
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/sender_pipe_unittest.cc
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/sender_pipe_win.cc
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/cpp/stream.h
[rename] https://crrev.com/550509780bc4960495de55aa092b77809be8c42c/components/services/heap_profiling/public/mojom/BUILD.gn

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa983faa876600dd08b423e91d4810591e90dfc7

commit fa983faa876600dd08b423e91d4810591e90dfc7
Author: erikchen <erikchen@chromium.org>
Date: Thu Apr 05 18:56:42 2018

Move code from chrome/profiling to components/services/heap_profiling

This CL has no intended behavior change.

In addition to moving the code, this CL:
  * Updates the names of classes/files to remove the Memlog prefix.
  * Updates the name of the service to be "Heap Profiling Service" from
    "Profiling Service".
  * profiling_browsertest was removed as it wasn't testing anything useful.
    There is a large suite of end-to-end browser tests in memlog_browsertest.cc
    [untouched by this CL].

Bug:  827545 
Change-Id: I7ef0947d7de4070d1863c509e2d280cefd4fec2d
Reviewed-on: https://chromium-review.googlesource.com/995641
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Cait Phillips <caitkp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548510}
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/BUILD.gn
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/app/BUILD.gn
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/browser/chrome_content_browser_manifest_overlay.json
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/BUILD.gn
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/OWNERS
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/README.md
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/memlog_receiver_pipe.cc
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/memlog_receiver_pipe_posix.h
[delete] https://crrev.com/7176aed568d29b70812a4827f4ae39678c2b9b19/chrome/profiling/profiling_browsertest.cc
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/test/BUILD.gn
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/utility/BUILD.gn
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/utility/DEPS
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/chrome/utility/chrome_content_utility_client.cc
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/BUILD.gn
[add] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/BUILD.gn
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/DEPS
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/OWNERS
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/address.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/allocation_event.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/allocation_event.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/allocation_tracker.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/allocation_tracker.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/backtrace.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/backtrace.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/backtrace_storage.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/backtrace_storage.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/backtrace_storage_unittest.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/connection_manager.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/connection_manager.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/heap_profiling_manifest.json
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/heap_profiling_service.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/heap_profiling_service.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/json_exporter.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/json_exporter.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/json_exporter_unittest.cc
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/public/mojom/constants.mojom
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver.h
[add] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe_posix.cc
[add] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe_posix.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe_win.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/receiver_pipe_win.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_fuzzer.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_fuzzer.dict
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_parser.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_parser.h
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_parser_unittest.cc
[rename] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/components/services/heap_profiling/stream_receiver.h
[modify] https://crrev.com/fa983faa876600dd08b423e91d4810591e90dfc7/docs/memory/tools.md

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/34810df09b44b3b3e4eae27244877d68b7157d44

commit 34810df09b44b3b3e4eae27244877d68b7157d44
Author: erikchen <erikchen@chromium.org>
Date: Thu Apr 05 21:40:38 2018

Move memlog flags into components/services/heap_profiling.

This CL is a refactor with no intended behavior change.

Bug:  827545 
Change-Id: Ibdbcdad3f2e6f0d14a8cb1bc15cc797af6224a98
Reviewed-on: https://chromium-review.googlesource.com/998572
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548565}
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/browser/about_flags.cc
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/browser/profiling_host/profiling_process_host_unittest.cc
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/common/chrome_switches.cc
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/chrome/common/chrome_switches.h
[modify] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/components/services/heap_profiling/public/cpp/BUILD.gn
[add] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/components/services/heap_profiling/public/cpp/switches.cc
[add] https://crrev.com/34810df09b44b3b3e4eae27244877d68b7157d44/components/services/heap_profiling/public/cpp/switches.h

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/102fe21b11eae6c677631b15b81a86468d457814

commit 102fe21b11eae6c677631b15b81a86468d457814
Author: erikchen <erikchen@chromium.org>
Date: Fri Apr 06 13:02:10 2018

Rename "namespace profiling" to "namespace heap_profiling".

This CL is a refactor with no intended behavior change.

Bug:  827545 
Change-Id: Id764a233ed364ec1d23f8540dfd1b1257fd7bb96
TBR: chrisha@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/998712
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548756}
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/base/threading/thread_local_storage.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/app/chrome_main_delegate.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/chrome_content_browser_manifest_overlay.json
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/chrome_content_gpu_manifest_overlay.json
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/chrome_content_renderer_manifest_overlay.json
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/chrome_content_utility_manifest_overlay.json
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/metrics/chrome_metrics_service_accessor.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/background_profiling_triggers.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/background_profiling_triggers.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/background_profiling_triggers_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/profiling_process_host_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/profiling_test_driver.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/profiling_host/test_android_shim.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/common/chrome_content_client.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/renderer/chrome_content_renderer_client.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/chrome/utility/chrome_content_utility_client.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/address.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/allocation_event.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/allocation_event.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/allocation_tracker.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/allocation_tracker.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/backtrace.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/backtrace.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/backtrace_storage.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/backtrace_storage.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/backtrace_storage_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/connection_manager.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/connection_manager.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/heap_profiling_manifest.json
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/heap_profiling_service.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/heap_profiling_service.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/json_exporter.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/json_exporter.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/json_exporter_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/allocator_shim.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/allocator_shim.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/client.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/client.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/sender_pipe.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/sender_pipe_posix.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/sender_pipe_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/sender_pipe_win.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/cpp/stream.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/mojom/constants.mojom
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/mojom/heap_profiling_client.mojom
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/public/mojom/heap_profiling_service.mojom
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe_posix.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe_posix.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe_win.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/receiver_pipe_win.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/stream_fuzzer.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/stream_parser.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/stream_parser.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/stream_parser_unittest.cc
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/components/services/heap_profiling/stream_receiver.h
[modify] https://crrev.com/102fe21b11eae6c677631b15b81a86468d457814/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics.h

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6192373ec47ae3e19c8eadc40830f4a96dec5692

commit 6192373ec47ae3e19c8eadc40830f4a96dec5692
Author: erikchen <erikchen@chromium.org>
Date: Fri Apr 06 13:14:51 2018

Move heap_profiling settings out of ProfilingProcessHost.

This CL is a refactor with no intended behavior change.

By moving the settings into components/services/heap_profiling, they will be
usable by Android Webview, which does not compile chrome/

Bug:  827545 
Change-Id: I8b217344fcbc259499b5f7622cbfc9b8d21e3e83
Reviewed-on: https://chromium-review.googlesource.com/998017
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548758}
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/profiling_process_host_unittest.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/profiling_test_driver.h
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/profiling_host/test_android_shim.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/components/services/heap_profiling/public/cpp/BUILD.gn
[add] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/components/services/heap_profiling/public/cpp/settings.cc
[add] https://crrev.com/6192373ec47ae3e19c8eadc40830f4a96dec5692/components/services/heap_profiling/public/cpp/settings.h

Project Member

Comment 10 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a03566bccee796ee545e7121c2a5db6bbde78b77

commit a03566bccee796ee545e7121c2a5db6bbde78b77
Author: erikchen <erikchen@chromium.org>
Date: Fri Apr 06 18:14:47 2018

Move core logic for dealing with HeapProfilingService into its own class.

The core logic for dealing with the HeapProfiler has three major components:
1) Interfacing with the service [depends on components/services/heap_profiling]
2) Connecting new clients [depends on content/]
3) Uploading heap dumps [depends on chrome/]

This CL moves the logic for (1) into components/services/heap_profiling. This
allows android_webview to reuse the logic.

Change-Id: Idd307c805746cacd8760b71addc88650cd81402f
Bug:  827545 
Reviewed-on: https://chromium-review.googlesource.com/999328
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548859}
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/components/services/heap_profiling/public/cpp/BUILD.gn
[add] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/components/services/heap_profiling/public/cpp/controller.cc
[add] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/components/services/heap_profiling/public/cpp/controller.h
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/components/services/heap_profiling/public/cpp/settings.cc
[modify] https://crrev.com/a03566bccee796ee545e7121c2a5db6bbde78b77/components/services/heap_profiling/public/cpp/settings.h

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1da5042a11a140d31eda75693c7e02171d02ed71

commit 1da5042a11a140d31eda75693c7e02171d02ed71
Author: erikchen <erikchen@chromium.org>
Date: Mon Apr 09 18:08:07 2018

Hook up Heap Profiling Service to Android WebView.

This CL adds support for Heap Profiling via an out-of-process service to
Android WebView. The architecture matches that of Chrome for Android and Desktop
platforms.

This is intended to help developers working on Android WebView trace down issues
in the implementation of Android WebView.

* This feature can only be enabled via command-line flags, set via adb.

adb shell 'echo "_ --memlog=browser" > /data/local/tmp/webview-command-line'

Other flags are also available, see
src/docs/memory/debugging_memory_issues.md#taking-a-heap-dump

* This CL only adds support for heap profiling the browser process.

* When the feature is enabled:
  * The browser process starts the Heap Profiling Service in a sandboxed utility
    process.
  * The browser process begins profiling itself via the HeapProfilingClient
    interface.
  * Heap dumps are availabe via memory-infra traces from chrome://tracing.

* Note: This feature requires the profiling service to be hosted in a separate
process than the one being profiled. This means that it only works on Android
O+, and N when multi-process WebView is enabled.

Bug:  827545 
Change-Id: I96d4b42945ea81bae5b32bdea802fd788d963b8d
Reviewed-on: https://chromium-review.googlesource.com/999993
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549224}
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/BUILD.gn
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/DEPS
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/OWNERS
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_browser_main_parts.cc
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_browser_main_parts.h
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_browser_manifest_overlay.json
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_content_browser_client.cc
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_content_browser_client.h
[add] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/browser/aw_utility_manifest_overlay.json
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/common/aw_content_client.cc
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/common/aw_content_client.h
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/lib/aw_main_delegate.cc
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/lib/aw_main_delegate.h
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/ui/aw_resources.grd
[add] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/utility/DEPS
[add] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/utility/aw_content_utility_client.cc
[add] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/android_webview/utility/aw_content_utility_client.h
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/chrome/app/BUILD.gn
[modify] https://crrev.com/1da5042a11a140d31eda75693c7e02171d02ed71/content/public/app/BUILD.gn

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a1b10c1dca397090500dce985568f4091580c438

commit a1b10c1dca397090500dce985568f4091580c438
Author: erikchen <erikchen@chromium.org>
Date: Tue Apr 10 17:54:27 2018

Add the skeleton of a heap profiling component.

The component will contain heap_profiling code that depends on content/, and
needs to be used by Desktop Chrome, Android, and Android Webview.

Bug:  827545 
Change-Id: I32e93b800d315c9e99df8cc778bc770c640953ba
Reviewed-on: https://chromium-review.googlesource.com/1005319
Reviewed-by: Cait Phillips <caitkp@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549584}
[add] https://crrev.com/a1b10c1dca397090500dce985568f4091580c438/components/heap_profiling/OWNERS
[add] https://crrev.com/a1b10c1dca397090500dce985568f4091580c438/components/heap_profiling/README.md

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9db3a720ad06be533f142e0f7ecbc0e503d8c63

commit a9db3a720ad06be533f142e0f7ecbc0e503d8c63
Author: erikchen <erikchen@chromium.org>
Date: Thu Apr 12 16:24:00 2018

Move logic from ProfilingProcessHost into ClientConnectionManager.

This CL is a refactor and has no intended behavior change.

This CL creates a new class ClientConnectionManager in
components/heap_profiling. This class connects HeapProfilingClients to the
HeapProfilingService by observing process creation events.

This CL creates a tiny subclass ChromeClientConnectionManager in chrome/ which
prevents incognito renderers from being profiled.

This refactor is necessary in order to expose this shared logic [previously
located in chrome/] to Android WebView. Furthermore, this is a necessary first
step in bringing end-to-end tests to Android WebView.

In addition to moving the logic, this CL makes several improvements:
  * The threading model is now sane. ClientConnectionManager must only be
    accessed from the UI thread. Previously the logic was scattered between the
    UI and IO threads.
  * ClientConnectionManager always attempts to hook up existing processes at
    start.

The changes in this CL are tested by the end to end tests in
ProfilingTestDriver.

Bug:  827545 
Change-Id: I0a0fdf6a2f3984188aee54c10041822b412e6815
Reviewed-on: https://chromium-review.googlesource.com/1006096
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550230}
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager.h
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager_unittest.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/test/BUILD.gn
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/BUILD.gn
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/DEPS
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/client_connection_manager.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/client_connection_manager.h
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/controller.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/controller.h
[rename] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/switches_unittest.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74cba8c2eaccabc8823d113d54fc5ab3003c912a

commit 74cba8c2eaccabc8823d113d54fc5ab3003c912a
Author: Erik Chen <erikchen@chromium.org>
Date: Mon Apr 16 18:49:49 2018

Move logic from ProfilingProcessHost into Supervisor.

This CL is a refactor and has no intended behavior change.

This CL:
  * Creates a new class Supervisor in components/heap_profiling. This class
    presents a single interface for tests and consumers of the Heap Profiling
    Service.
  * Moves end to end test logic into components/heap_profiling.
  * Leaves the emit metrics, save to file, and upload in background logic in
    ProfilingProcessHost.

This refactor is necessary in order to expose this shared logic [previously
located in chrome/] to Android WebView.

The changes in this CL are tested by the end to end tests in
ProfilingTestDriver.

Change-Id: I3fda597b210522404203ac9cf932f7bccd76cad7
Bug:  827545 
Reviewed-on: https://chromium-review.googlesource.com/1008366
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551055}
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/android/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/background_profiling_triggers.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/test_android_shim.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/DEPS
[add] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/supervisor.cc
[add] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/supervisor.h
[rename] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/test_driver.cc
[rename] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/test_driver.h

Project Member

Comment 15 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd79b4e1174125fe4592686ae729fc2cdf166a67

commit cd79b4e1174125fe4592686ae729fc2cdf166a67
Author: Erik Chen <erikchen@chromium.org>
Date: Tue Apr 17 04:46:07 2018

Prepare heap profiling for integration with Android WebView.

This CL is a refactor with no intended behavior change outside of tests.

Test behavior change:
* TestDriver::CheckOrStartProfiling now waits for the allocator shim to be
  initialized even if profiling was enabled for the current process via command
  line flags. This is because initialization is asynchronous.
* TestDriver::ValidateRendererAllocations no longer makes any checks if the
  renderer is not being profiled, since on Android WebView there may not even be
  a renderer process in this case.

Refactor:
* Moves the C++ side of the android test shim into components/heap_profiling, so
  that the logic can be shared with Android Webview.
* Renames the test shim from TestAndroidShim to HeapProfilingTestShim.
* Removes redundant checks in TestDriver::ValidateRendererAllocations.

Change-Id: I4755f6169b0f9c556a86005916aa9150dec6853b
BUG:  827545 
Reviewed-on: https://chromium-review.googlesource.com/1012542
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551242}
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/chrome/android/BUILD.gn
[rename] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/HeapProfilingTestShim.java
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/chrome/browser/profiling_host/BUILD.gn
[delete] https://crrev.com/f76ea8f9f0a5173831de65fcd913f6675b492b5f/chrome/browser/profiling_host/test_android_shim.h
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/heap_profiling/DEPS
[rename] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/heap_profiling/heap_profiling_test_shim.cc
[add] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/heap_profiling/heap_profiling_test_shim.h
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/heap_profiling/test_driver.cc
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/services/heap_profiling/public/cpp/allocator_shim.cc
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/services/heap_profiling/public/cpp/allocator_shim.h
[modify] https://crrev.com/cd79b4e1174125fe4592686ae729fc2cdf166a67/components/services/heap_profiling/public/cpp/client.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9db3a720ad06be533f142e0f7ecbc0e503d8c63

commit a9db3a720ad06be533f142e0f7ecbc0e503d8c63
Author: erikchen <erikchen@chromium.org>
Date: Thu Apr 12 16:24:00 2018

Move logic from ProfilingProcessHost into ClientConnectionManager.

This CL is a refactor and has no intended behavior change.

This CL creates a new class ClientConnectionManager in
components/heap_profiling. This class connects HeapProfilingClients to the
HeapProfilingService by observing process creation events.

This CL creates a tiny subclass ChromeClientConnectionManager in chrome/ which
prevents incognito renderers from being profiled.

This refactor is necessary in order to expose this shared logic [previously
located in chrome/] to Android WebView. Furthermore, this is a necessary first
step in bringing end-to-end tests to Android WebView.

In addition to moving the logic, this CL makes several improvements:
  * The threading model is now sane. ClientConnectionManager must only be
    accessed from the UI thread. Previously the logic was scattered between the
    UI and IO threads.
  * ClientConnectionManager always attempts to hook up existing processes at
    start.

The changes in this CL are tested by the end to end tests in
ProfilingTestDriver.

Bug:  827545 
Change-Id: I0a0fdf6a2f3984188aee54c10041822b412e6815
Reviewed-on: https://chromium-review.googlesource.com/1006096
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550230}
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager.h
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/chrome_client_connection_manager_unittest.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/profiling_host/profiling_test_driver.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/chrome/test/BUILD.gn
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/BUILD.gn
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/DEPS
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/client_connection_manager.cc
[add] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/heap_profiling/client_connection_manager.h
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/BUILD.gn
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/controller.cc
[modify] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/controller.h
[rename] https://crrev.com/a9db3a720ad06be533f142e0f7ecbc0e503d8c63/components/services/heap_profiling/public/cpp/switches_unittest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74cba8c2eaccabc8823d113d54fc5ab3003c912a

commit 74cba8c2eaccabc8823d113d54fc5ab3003c912a
Author: Erik Chen <erikchen@chromium.org>
Date: Mon Apr 16 18:49:49 2018

Move logic from ProfilingProcessHost into Supervisor.

This CL is a refactor and has no intended behavior change.

This CL:
  * Creates a new class Supervisor in components/heap_profiling. This class
    presents a single interface for tests and consumers of the Heap Profiling
    Service.
  * Moves end to end test logic into components/heap_profiling.
  * Leaves the emit metrics, save to file, and upload in background logic in
    ProfilingProcessHost.

This refactor is necessary in order to expose this shared logic [previously
located in chrome/] to Android WebView.

The changes in this CL are tested by the end to end tests in
ProfilingTestDriver.

Change-Id: I3fda597b210522404203ac9cf932f7bccd76cad7
Bug:  827545 
Reviewed-on: https://chromium-review.googlesource.com/1008366
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551055}
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/android/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/background_profiling_triggers.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/profiling_host/test_android_shim.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/BUILD.gn
[modify] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/DEPS
[add] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/supervisor.cc
[add] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/supervisor.h
[rename] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/test_driver.cc
[rename] https://crrev.com/74cba8c2eaccabc8823d113d54fc5ab3003c912a/components/heap_profiling/test_driver.h

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06a20b56e0d4770985f477d51641563a33030f24

commit 06a20b56e0d4770985f477d51641563a33030f24
Author: Erik Chen <erikchen@chromium.org>
Date: Tue Apr 17 19:05:32 2018

Clean up components/heap_profiling.

This CL has no intended behavior change.

This CL cleans up test structure and updates some comments.

Change-Id: I3b5ed07813ec416dd67098d9f93b702a115cee09
Bug:  827545 
Reviewed-on: https://chromium-review.googlesource.com/1014371
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551418}
[modify] https://crrev.com/06a20b56e0d4770985f477d51641563a33030f24/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/06a20b56e0d4770985f477d51641563a33030f24/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/06a20b56e0d4770985f477d51641563a33030f24/components/heap_profiling/test_driver.cc
[modify] https://crrev.com/06a20b56e0d4770985f477d51641563a33030f24/components/heap_profiling/test_driver.h

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/441af9dced33e813be1788c3c0b0a9232526f660

commit 441af9dced33e813be1788c3c0b0a9232526f660
Author: Erik Chen <erikchen@chromium.org>
Date: Wed Apr 18 14:37:04 2018

Hook up Android Webview with refactored heap profiling service.

This CL:
* Hooks up heap_profiling::Supervisor to AwBrowserMainParts. This removes boiler
  plate logic and adds support for heap profiling of non-browser processes.
* Adds HeapProfilingTest. This end to end test reuses shared logic with
  desktop/Android Chrome, see heap_profiling::TestDriver for test details.
* Adds the decorator SkipSingleProcessTests. Applies the decorator to
  HeapProfilingTest. By default, Android Webview launches all instrumentation
  tests twice - once in single process and once in multi process mode. In single
  process mode, the test uses the flag --single-process, which is incompatible
  with the current implementation of the heap profiling service.

Bug:  827545 
Change-Id: I7fb67585cd132e8326c55c1b0a6e6987c6b3905d
Reviewed-on: https://chromium-review.googlesource.com/1012739
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551669}
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/BUILD.gn
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/browser/DEPS
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/browser/aw_browser_main_parts.cc
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/browser/aw_browser_main_parts.h
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/browser/aw_content_browser_client.cc
[add] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/javatests/src/org/chromium/android_webview/test/HeapProfilingTest.java
[add] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/javatests/src/org/chromium/android_webview/test/HeapProfilingTestShim.java
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/test/BUILD.gn
[modify] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java
[add] https://crrev.com/441af9dced33e813be1788c3c0b0a9232526f660/android_webview/test/shell/src/org/chromium/android_webview/test/SkipSingleProcessTests.java

no manual verification is needed as its dev bug
Project Member

Comment 21 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/28af268a9e4c38f9d502a4fe1858b483cca8f70e

commit 28af268a9e4c38f9d502a4fe1858b483cca8f70e
Author: Erik Chen <erikchen@chromium.org>
Date: Mon Apr 23 16:11:21 2018

Add more end to end heap profiling tests for android webview.

Bug:  827545 
Change-Id: I7dc3331fa10e4e01ebcf9c2eca073612801fd7aa
Reviewed-on: https://chromium-review.googlesource.com/1016844
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552721}
[modify] https://crrev.com/28af268a9e4c38f9d502a4fe1858b483cca8f70e/android_webview/javatests/src/org/chromium/android_webview/test/HeapProfilingTest.java

Status: Fixed (was: Assigned)
Project Member

Comment 23 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3866efbb466187d648395c94e93c47f5085fc122

commit 3866efbb466187d648395c94e93c47f5085fc122
Author: erikchen <erikchen@chromium.org>
Date: Tue Apr 24 15:48:19 2018

Clean up build files for heap profiling end to end tests.

This CL fixes layering for the heap profiling end to end tests.
//components/heap_profiling now exposes two targets:
heap_profiling_java_test_support and test_support. Instrumentation tests for
both Chrome and Android WebView must include heap_profiling_java_test_support as
a dependency in the apk being tested, and test_support as a dependency of the
C++ shared library in the apk being tested.

Bug:  827545 
Change-Id: I02e12ff1a435ecd4529108e07dc9c00ede1af64b
Reviewed-on: https://chromium-review.googlesource.com/1024698
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553139}
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/android_webview/DEPS
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/android_webview/javatests/src/org/chromium/android_webview/test/HeapProfilingTest.java
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/android_webview/test/BUILD.gn
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/chrome/android/BUILD.gn
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/chrome/android/javatests/DEPS
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/chrome/browser/profiling_host/BUILD.gn
[modify] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/components/heap_profiling/BUILD.gn
[rename] https://crrev.com/3866efbb466187d648395c94e93c47f5085fc122/components/heap_profiling/javatests/src/org/chromium/components/heap_profiling/HeapProfilingTestShim.java

Sign in to add a comment