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

Issue 1671933002: Create and pass shared-histogram-allocator from browser to renderer. (Closed)

Created:
4 years, 10 months ago by bcwhite
Modified:
4 years, 8 months ago
CC:
chromium-reviews, creis+watch_chromium.org, vmpstr+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@hsm-merge
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create and pass shared-histogram-allocator from browser to renderer. After the renderer is started, a shared-memory segment is created and sent to it; all renderer histograms created after that point will be stored there. The SubprocessMetricsProvider extracts that shared segment on the browser side and, when metrics are being uploaded, iterates through all the histograms stored there. When the renderer exits, the SMP will continue to hold a handle to the memory segment. Once all the histograms are uploaded (during the next cycle), it will finally release the memory back to the operating system. BUG=546019 Committed: https://crrev.com/df016a7ce60decb9174ab2201bf4864fc7cefa82 Cr-Commit-Position: refs/heads/master@{#385873} Committed: https://crrev.com/5370ba54d267e69cc055c75738306644a93454cf Cr-Commit-Position: refs/heads/master@{#386055}

Patch Set 1 #

Patch Set 2 : completed integration with metrics-service #

Patch Set 3 : can't forward-declare SharedMemoryHandle because it's not always a class #

Patch Set 4 : cleanup on RenderProcessHostDestroyed instead of RenderProcessExited; use existing ScopedObserver c… #

Total comments: 22

Patch Set 5 : rebased (use new PersistentHistogramAllocator) #

Total comments: 22

Patch Set 6 : addressd review comments by Alexei #

Total comments: 2

Patch Set 7 : addressd more review comments by Alexei; refactored & extended tests #

Total comments: 6

Patch Set 8 : addressed review comments by Alexei; fixed test on some builds #

Total comments: 20

Patch Set 9 : addressed review comments by Greg #

Total comments: 7

Patch Set 10 : minor histogram description changes #

Patch Set 11 : don't stop observing upon exit #

Patch Set 12 : rebased #

Total comments: 8

Patch Set 13 : change scoped_ptr to unique_ptr in new files #

Patch Set 14 : addressed review comments by Will #

Patch Set 15 : fixed test to not use SharedMemory which doesn't work on all builds (and rebased) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+609 lines, -21 lines) Patch
M base/metrics/persistent_histogram_allocator.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -7 lines 0 comments Download
M base/metrics/persistent_histogram_allocator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -8 lines 0 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -0 lines 0 comments Download
A chrome/browser/metrics/subprocess_metrics_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +97 lines, -0 lines 0 comments Download
A chrome/browser/metrics/subprocess_metrics_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +165 lines, -0 lines 0 comments Download
A chrome/browser/metrics/subprocess_metrics_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +199 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/histogram_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +11 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +37 lines, -0 lines 0 comments Download
M content/child/child_histogram_message_filter.h View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M content/child/child_histogram_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +18 lines, -1 line 0 comments Download
M content/common/child_process_messages.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +9 lines, -1 line 0 comments Download
M content/public/browser/render_process_host.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +28 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 62 (26 generated)
bcwhite
This is working on a local build and I can see through the browser histograms ...
4 years, 10 months ago (2016-02-23 02:33:00 UTC) #2
bcwhite
Greg and I discussed changing this to pass the handle during process creation instead of ...
4 years, 9 months ago (2016-03-23 15:50:26 UTC) #7
Alexei Svitkine (slow)
Some initial comments. https://codereview.chromium.org/1671933002/diff/140001/base/metrics/histogram_persistence.h File base/metrics/histogram_persistence.h (right): https://codereview.chromium.org/1671933002/diff/140001/base/metrics/histogram_persistence.h#newcode49 base/metrics/histogram_persistence.h:49: // on the other side. Please ...
4 years, 9 months ago (2016-03-24 17:29:53 UTC) #8
bcwhite
https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode17 chrome/browser/metrics/subprocess_metrics_provider.cc:17: namespace metrics { On 2016/03/24 17:29:53, Alexei Svitkine (OOO ...
4 years, 8 months ago (2016-03-29 11:53:27 UTC) #11
Alexei Svitkine (slow)
https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.h File chrome/browser/metrics/subprocess_metrics_provider.h (right): https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.h#newcode84 chrome/browser/metrics/subprocess_metrics_provider.h:84: base::ThreadChecker thread_checker_; On 2016/03/29 11:53:27, bcwhite wrote: > On ...
4 years, 8 months ago (2016-03-29 17:51:25 UTC) #12
bcwhite
https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.h File chrome/browser/metrics/subprocess_metrics_provider.h (right): https://codereview.chromium.org/1671933002/diff/140001/chrome/browser/metrics/subprocess_metrics_provider.h#newcode84 chrome/browser/metrics/subprocess_metrics_provider.h:84: base::ThreadChecker thread_checker_; On 2016/03/29 17:51:24, Alexei Svitkine wrote: > ...
4 years, 8 months ago (2016-03-30 21:25:56 UTC) #14
Alexei Svitkine (slow)
https://codereview.chromium.org/1671933002/diff/200001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/200001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode111 chrome/browser/metrics/subprocess_metrics_provider.cc:111: host->ExtractMetricsAllocator(); On 2016/03/30 21:25:55, bcwhite wrote: > On 2016/03/29 ...
4 years, 8 months ago (2016-03-31 15:22:04 UTC) #15
bcwhite
https://codereview.chromium.org/1671933002/diff/200001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/200001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode111 chrome/browser/metrics/subprocess_metrics_provider.cc:111: host->ExtractMetricsAllocator(); On 2016/03/31 15:22:04, Alexei Svitkine wrote: > On ...
4 years, 8 months ago (2016-03-31 18:27:49 UTC) #17
Alexei Svitkine (slow)
Looks great, just some comments about histograms and then I think it's ready to go. ...
4 years, 8 months ago (2016-03-31 22:00:58 UTC) #18
bcwhite
https://codereview.chromium.org/1671933002/diff/260001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/260001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode105 chrome/browser/metrics/subprocess_metrics_provider.cc:105: "UMA.SubprocessMetricsProvider.SubproccessCount", On 2016/03/31 22:00:57, Alexei Svitkine wrote: > Add ...
4 years, 8 months ago (2016-03-31 23:53:47 UTC) #19
grt (UTC plus 2)
It appears that this requires more work up in src/chrome than the polling mechanism, which ...
4 years, 8 months ago (2016-04-01 14:22:49 UTC) #20
bcwhite
As per face-to-face discussion with Greg, efforts to move this up to the content layer ...
4 years, 8 months ago (2016-04-01 16:50:26 UTC) #22
Alexei Svitkine (slow)
lgtm
4 years, 8 months ago (2016-04-01 16:55:41 UTC) #23
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1671933002/diff/320001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1671933002/diff/320001/tools/metrics/histograms/histograms.xml#newcode54278 tools/metrics/histograms/histograms.xml:54278: +<histogram name="UMA.SubprocessMetricsProvider.SubprocessCount" units="count"> Nit: units="subprocesses" https://codereview.chromium.org/1671933002/diff/320001/tools/metrics/histograms/histograms.xml#newcode54283 tools/metrics/histograms/histograms.xml:54283: + ...
4 years, 8 months ago (2016-04-01 16:56:28 UTC) #24
bcwhite
https://codereview.chromium.org/1671933002/diff/320001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1671933002/diff/320001/tools/metrics/histograms/histograms.xml#newcode54278 tools/metrics/histograms/histograms.xml:54278: +<histogram name="UMA.SubprocessMetricsProvider.SubprocessCount" units="count"> On 2016/04/01 16:56:28, Alexei Svitkine wrote: ...
4 years, 8 months ago (2016-04-01 17:37:59 UTC) #25
grt (UTC plus 2)
https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode154 chrome/browser/metrics/subprocess_metrics_provider.cc:154: scoped_observer_.Remove(host); should this removal be here? don't you need ...
4 years, 8 months ago (2016-04-01 20:45:33 UTC) #26
bcwhite
jschuh@chromium.org: Please review changes in content/common/child_process_messages.h Justin, this enables the shared memory between the Browser ...
4 years, 8 months ago (2016-04-01 20:47:30 UTC) #28
jschuh
Sorry, I'm not going to have time to look at this. Maybe wfh@?
4 years, 8 months ago (2016-04-01 22:09:39 UTC) #29
grt (UTC plus 2)
https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode154 chrome/browser/metrics/subprocess_metrics_provider.cc:154: scoped_observer_.Remove(host); On 2016/04/01 20:45:33, grt (very slow) wrote: > ...
4 years, 8 months ago (2016-04-04 16:46:44 UTC) #30
bcwhite
https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc File chrome/browser/metrics/subprocess_metrics_provider.cc (right): https://codereview.chromium.org/1671933002/diff/320001/chrome/browser/metrics/subprocess_metrics_provider.cc#newcode154 chrome/browser/metrics/subprocess_metrics_provider.cc:154: scoped_observer_.Remove(host); On 2016/04/04 16:46:44, grt (very slow) wrote: > ...
4 years, 8 months ago (2016-04-04 19:32:27 UTC) #31
bcwhite
4 years, 8 months ago (2016-04-04 19:36:08 UTC) #33
Will Harris
I am reviewing now... you might want to change all your scoped_ptr since the scoped_ptr ...
4 years, 8 months ago (2016-04-06 23:38:00 UTC) #38
bcwhite
On 2016/04/06 23:38:00, Will Harris wrote: > I am reviewing now... you might want to ...
4 years, 8 months ago (2016-04-06 23:51:45 UTC) #39
Will Harris
Few questions: Can you briefly explain when RecordHistogramSnapshots is called from the snapshot manager? I ...
4 years, 8 months ago (2016-04-07 00:29:41 UTC) #40
bcwhite
> Can you briefly explain when RecordHistogramSnapshots > is called from the snapshot manager? It's ...
4 years, 8 months ago (2016-04-07 01:15:55 UTC) #41
Will Harris
security lgtm.
4 years, 8 months ago (2016-04-07 19:53:55 UTC) #42
bcwhite
avi@chromium.org: Please review changes in content/
4 years, 8 months ago (2016-04-07 20:01:48 UTC) #44
Avi (use Gerrit)
lgtm
4 years, 8 months ago (2016-04-07 20:14:19 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1671933002/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1671933002/500001
4 years, 8 months ago (2016-04-07 20:16:19 UTC) #48
commit-bot: I haz the power
Committed patchset #14 (id:500001)
4 years, 8 months ago (2016-04-07 21:30:16 UTC) #50
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/df016a7ce60decb9174ab2201bf4864fc7cefa82 Cr-Commit-Position: refs/heads/master@{#385873}
4 years, 8 months ago (2016-04-07 21:32:41 UTC) #52
bcwhite
Looks like Android doesn't like how the memory is duplicated for testing. Will revert, change ...
4 years, 8 months ago (2016-04-08 01:43:57 UTC) #53
bcwhite
https://uberchromegw.corp.google.com/i/chromium.linux/builders/Android%20GN/builds/33691
4 years, 8 months ago (2016-04-08 01:44:24 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1671933002/520001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1671933002/520001
4 years, 8 months ago (2016-04-08 12:37:17 UTC) #58
commit-bot: I haz the power
Committed patchset #15 (id:520001)
4 years, 8 months ago (2016-04-08 12:44:12 UTC) #60
commit-bot: I haz the power
4 years, 8 months ago (2016-04-08 12:45:24 UTC) #62
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/5370ba54d267e69cc055c75738306644a93454cf
Cr-Commit-Position: refs/heads/master@{#386055}

Powered by Google App Engine
This is Rietveld 408576698