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

Issue 1425533011: Support "shared" histograms between processes. (Closed)

Created:
5 years, 1 month ago by bcwhite
Modified:
4 years, 10 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support "shared" histograms between processes. Histograms have tradionally been held on the local heap and passed between processes using RPCs or simply lost when that process stops. Shared histograms are read directly by another process. https://docs.google.com/document/d/1YvBXzi745UDjiFVLjP8IWUMFgYL9gDb2J4xuwcv-c7o/edit?usp=sharing BUG=546019 TBR=mmenke,nasko,thakis for base/*.{gn,gypi}, components/cronet/*, and content/child/* Committed: https://crrev.com/5cb99ebcf2cf1450e7a68e7d7fd3d11ce0549175 Cr-Commit-Position: refs/heads/master@{#372760}

Patch Set 1 #

Patch Set 2 : working version for all histograms except Sparse #

Patch Set 3 : iterate over shared histograms during snapshot #

Patch Set 4 : work in progress #

Patch Set 5 : use iterator to inform HistogramSnapshotManager of what to do #

Patch Set 6 : first working solution (uses hash for id) #

Patch Set 7 : extracted cl/1471073007 #

Patch Set 8 : rebased (and renamed id() to hash() for histograms) #

Patch Set 9 : added a couple tests (and fixed related issues) #

Total comments: 4

Patch Set 10 : extract common histogram FactoryGet code; extract histogram persistence into seperate files #

Total comments: 6

Patch Set 11 : change from lambdas to Factory classes for creating histograms with common code #

Total comments: 16

Patch Set 12 : changed to Feature from fixed command-line parameters #

Patch Set 13 : merge histogram name with other data to reduce allocations #

Patch Set 14 : reorganized Factory class to be cleaner #

Total comments: 20

Patch Set 15 : addressed review comments by Alexei #

Total comments: 4

Patch Set 16 : rebased #

Total comments: 7

Patch Set 17 : reorganized persistence around PersistentGet methods to fix visibility problems #

Total comments: 30

Patch Set 18 : addressed review comments by Alexei #

Total comments: 34

Patch Set 19 : addressed review comments by Alexei #

Patch Set 20 : extract persistent histogram iterator from MetricsService #

Patch Set 21 : fixed compile problems on non-Windows builds #

Total comments: 24

Patch Set 22 : add histogram tracking histogram creation success #

Patch Set 23 : addressed remaining review comments by Alexei #

Patch Set 24 : fixed compile problems on non-Windows builds #

Total comments: 17

Patch Set 25 : addressed review comments by Alexei #

Patch Set 26 : fixed compile problems on non-Windows builds #

Patch Set 27 : rebased #

Patch Set 28 : moved Create-Result histogram to private space and added to histograms.xml #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1258 lines, -145 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M base/metrics/histogram.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 10 chunks +78 lines, -2 lines 0 comments Download
M base/metrics/histogram.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 14 chunks +327 lines, -107 lines 0 comments Download
M base/metrics/histogram_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +8 lines, -0 lines 0 comments Download
M base/metrics/histogram_delta_serialization.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +6 lines, -3 lines 0 comments Download
M base/metrics/histogram_delta_serialization.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +4 lines, -1 line 0 comments Download
M base/metrics/histogram_delta_serialization_unittest.cc View 1 2 3 9 2 chunks +2 lines, -2 lines 0 comments Download
A base/metrics/histogram_persistence.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +89 lines, -0 lines 0 comments Download
A base/metrics/histogram_persistence.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +422 lines, -0 lines 0 comments Download
M base/metrics/histogram_snapshot_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -2 lines 0 comments Download
M base/metrics/histogram_snapshot_manager.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -14 lines 0 comments Download
M base/metrics/histogram_snapshot_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +5 lines, -2 lines 0 comments Download
M base/metrics/histogram_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +123 lines, -1 line 0 comments Download
M base/metrics/sample_vector.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M base/metrics/statistics_recorder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 4 chunks +34 lines, -4 lines 0 comments Download
M base/metrics/statistics_recorder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 5 chunks +46 lines, -4 lines 0 comments Download
M base/metrics/statistics_recorder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +25 lines, -1 line 0 comments Download
M chrome/browser/chrome_browser_field_trials.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 3 chunks +25 lines, -0 lines 0 comments Download
M chrome/service/service_ipc_server.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -1 line 0 comments Download
M components/cronet/histogram_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +5 lines, -0 lines 0 comments Download
M components/metrics/metrics_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +14 lines, -0 lines 0 comments Download
M content/child/child_histogram_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +4 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (13 generated)
bcwhite
Here's the last big piece of the persistent/shared histogram puzzle. We talked this morning about ...
5 years ago (2015-12-03 17:57:06 UTC) #3
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/170001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/170001/base/metrics/histogram.cc#newcode850 base/metrics/histogram.cc:850: } The code from 817 to 850 is repeated ...
5 years ago (2015-12-04 18:27:36 UTC) #4
bcwhite
https://codereview.chromium.org/1425533011/diff/170001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/170001/base/metrics/histogram.cc#newcode850 base/metrics/histogram.cc:850: } On 2015/12/04 18:27:36, Alexei Svitkine (slow) wrote: > ...
5 years ago (2015-12-07 23:27:19 UTC) #5
bcwhite
> > The code from 817 to 850 is repeated in several places (with some ...
5 years ago (2015-12-11 02:04:34 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/190001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/1425533011/diff/190001/chrome/browser/chrome_browser_field_trials.cc#newcode49 chrome/browser/chrome_browser_field_trials.cc:49: !parsed_command_line_.HasSwitch(switches::kDisablePersistentMetrics)) { Please use the base/feature_list.h API instead. This ...
5 years ago (2015-12-15 22:48:53 UTC) #9
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram_persistence.cc#newcode243 base/metrics/histogram_persistence.cc:243: // Only continue here if all allocations were successful. ...
5 years ago (2015-12-15 22:54:03 UTC) #10
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram.cc#newcode117 base/metrics/histogram.cc:117: int32 flags_; Do these need to be members or ...
5 years ago (2015-12-15 23:03:37 UTC) #11
bcwhite
https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/250001/base/metrics/histogram.cc#newcode117 base/metrics/histogram.cc:117: int32 flags_; On 2015/12/15 23:03:37, Alexei Svitkine (slow) wrote: ...
5 years ago (2015-12-16 13:36:34 UTC) #12
bcwhite
https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h File components/metrics/metrics_service.h (right): https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h#newcode333 components/metrics/metrics_service.h:333: } On 2015/12/15 22:48:52, Alexei Svitkine (slow) wrote: > ...
5 years ago (2015-12-16 13:54:29 UTC) #13
bcwhite
https://codereview.chromium.org/1425533011/diff/190001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/1425533011/diff/190001/chrome/browser/chrome_browser_field_trials.cc#newcode49 chrome/browser/chrome_browser_field_trials.cc:49: !parsed_command_line_.HasSwitch(switches::kDisablePersistentMetrics)) { On 2015/12/15 22:48:52, Alexei Svitkine (slow) wrote: ...
5 years ago (2015-12-16 16:23:46 UTC) #14
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h File components/metrics/metrics_service.h (right): https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h#newcode333 components/metrics/metrics_service.h:333: } On 2015/12/16 13:54:29, bcwhite wrote: > On 2015/12/15 ...
5 years ago (2015-12-16 16:33:49 UTC) #15
bcwhite
https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h File components/metrics/metrics_service.h (right): https://codereview.chromium.org/1425533011/diff/190001/components/metrics/metrics_service.h#newcode333 components/metrics/metrics_service.h:333: } On 2015/12/16 16:33:48, Alexei Svitkine (slow) wrote: > ...
5 years ago (2015-12-17 15:55:48 UTC) #16
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/310001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/310001/base/metrics/histogram.cc#newcode124 base/metrics/histogram.cc:124: virtual void FillHistogram(HistogramBase* histogram) {} Please document these methods ...
5 years ago (2015-12-21 19:32:11 UTC) #17
bcwhite
https://codereview.chromium.org/1425533011/diff/310001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/310001/base/metrics/histogram.cc#newcode124 base/metrics/histogram.cc:124: virtual void FillHistogram(HistogramBase* histogram) {} On 2015/12/21 19:32:10, Alexei ...
5 years ago (2015-12-22 20:50:38 UTC) #18
Alexei Svitkine (slow)
Sorry, turns out I hadn't previously looked at the histogram_persistence.cc code in enough detail, so ...
4 years, 11 months ago (2016-01-08 18:52:49 UTC) #19
bcwhite
https://codereview.chromium.org/1425533011/diff/330001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/330001/base/metrics/histogram.cc#newcode951 base/metrics/histogram.cc:951: DISALLOW_COPY_AND_ASSIGN(Factory); On 2016/01/08 18:52:48, Alexei Svitkine wrote: > Nit: ...
4 years, 11 months ago (2016-01-12 16:34:57 UTC) #20
bcwhite
On 2016/01/12 16:34:57, bcwhite wrote: > https://codereview.chromium.org/1425533011/diff/330001/base/metrics/histogram.cc > File base/metrics/histogram.cc (right): > > https://codereview.chromium.org/1425533011/diff/330001/base/metrics/histogram.cc#newcode951 > ...
4 years, 11 months ago (2016-01-12 21:12:29 UTC) #21
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/350001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/350001/base/metrics/histogram_persistence.cc#newcode50 base/metrics/histogram_persistence.cc:50: scoped_ptr<PersistentMemoryAllocator> allocator_; On 2016/01/12 16:34:57, bcwhite wrote: > There ...
4 years, 11 months ago (2016-01-12 21:54:45 UTC) #22
bcwhite
https://codereview.chromium.org/1425533011/diff/350001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/350001/base/metrics/histogram_persistence.cc#newcode78 base/metrics/histogram_persistence.cc:78: // be simple references to histograms in other processes). ...
4 years, 11 months ago (2016-01-13 13:38:29 UTC) #23
Alexei Svitkine (slow)
Another round of comments. Generally ok with most of the structure except would like to ...
4 years, 11 months ago (2016-01-14 16:43:14 UTC) #24
bcwhite
https://codereview.chromium.org/1425533011/diff/390001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/390001/base/metrics/histogram.cc#newcode98 base/metrics/histogram.cc:98: HistogramBase* Build(); On 2016/01/14 16:43:13, Alexei Svitkine wrote: > ...
4 years, 11 months ago (2016-01-14 19:20:26 UTC) #25
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/390001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/1425533011/diff/390001/base/metrics/histogram.cc#newcode151 base/metrics/histogram.cc:151: if (!histogram) { On 2016/01/14 19:20:25, bcwhite wrote: > ...
4 years, 11 months ago (2016-01-14 21:53:41 UTC) #26
bcwhite
https://codereview.chromium.org/1425533011/diff/390001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/1425533011/diff/390001/chrome/browser/chrome_browser_field_trials.cc#newcode48 chrome/browser/chrome_browser_field_trials.cc:48: if (base::FeatureList::IsEnabled(base::kPersistentHistogramsFeature)) { > I thought we weren't certain ...
4 years, 11 months ago (2016-01-15 15:24:38 UTC) #27
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/390001/components/metrics/metrics_service.cc File components/metrics/metrics_service.cc (right): https://codereview.chromium.org/1425533011/diff/390001/components/metrics/metrics_service.cc#newcode1157 components/metrics/metrics_service.cc:1157: histogram_snapshot_manager_.PrepareDeltas( On 2016/01/15 15:24:38, bcwhite wrote: > On 2016/01/14 ...
4 years, 11 months ago (2016-01-15 15:43:47 UTC) #28
bcwhite
Looks like the try-bots might include dependent CLs. Will likely have compile errors on other ...
4 years, 11 months ago (2016-01-15 19:23:41 UTC) #30
Alexei Svitkine (slow)
You have some build errors - looks like you forgot to update some files, e.g.: ...
4 years, 11 months ago (2016-01-18 18:51:25 UTC) #32
Alexei Svitkine (slow)
Looks really good - just a few more nits and then I think it's good ...
4 years, 11 months ago (2016-01-18 19:25:36 UTC) #33
bcwhite
https://codereview.chromium.org/1425533011/diff/370001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/370001/base/metrics/histogram_persistence.cc#newcode90 base/metrics/histogram_persistence.cc:90: LOG(WARNING) << "Persistent histogram data was not valid; skipped."; ...
4 years, 11 months ago (2016-01-20 15:26:15 UTC) #34
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/370001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/370001/base/metrics/histogram_persistence.cc#newcode90 base/metrics/histogram_persistence.cc:90: LOG(WARNING) << "Persistent histogram data was not valid; skipped."; ...
4 years, 11 months ago (2016-01-20 16:26:41 UTC) #35
bcwhite
On 2016/01/20 16:26:41, Alexei Svitkine (very slow) wrote: > https://codereview.chromium.org/1425533011/diff/370001/base/metrics/histogram_persistence.cc > File base/metrics/histogram_persistence.cc (right): > ...
4 years, 11 months ago (2016-01-21 16:56:13 UTC) #36
Alexei Svitkine (slow)
Thanks - I still need to look at the histogram code a bit more closely, ...
4 years, 11 months ago (2016-01-21 17:31:05 UTC) #37
bcwhite
https://codereview.chromium.org/1425533011/diff/490001/base/metrics/histogram_delta_serialization.h File base/metrics/histogram_delta_serialization.h (right): https://codereview.chromium.org/1425533011/diff/490001/base/metrics/histogram_delta_serialization.h#newcode31 base/metrics/histogram_delta_serialization.h:31: // If |serialized_deltas| is NULL, no data is serialized, ...
4 years, 11 months ago (2016-01-22 15:24:53 UTC) #38
Alexei Svitkine (slow)
Please update histograms.xml with the new histogram you're adding. https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.cc#newcode88 base/metrics/histogram_persistence.cc:88: ...
4 years, 11 months ago (2016-01-22 16:15:16 UTC) #39
bcwhite
https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.cc File base/metrics/histogram_persistence.cc (right): https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.cc#newcode88 base/metrics/histogram_persistence.cc:88: static base::subtle::AtomicWord atomic_histogram_pointer = 0; \ On 2016/01/22 16:15:16, ...
4 years, 11 months ago (2016-01-22 17:17:48 UTC) #41
Alexei Svitkine (slow)
https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.h File base/metrics/histogram_persistence.h (right): https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.h#newcode17 base/metrics/histogram_persistence.h:17: enum CreateHistogramResultType { On 2016/01/22 17:17:48, bcwhite wrote: > ...
4 years, 11 months ago (2016-01-22 17:23:40 UTC) #42
bcwhite
On 2016/01/22 17:23:40, Alexei Svitkine (very slow) wrote: > https://codereview.chromium.org/1425533011/diff/550001/base/metrics/histogram_persistence.h > File base/metrics/histogram_persistence.h (right): > ...
4 years, 11 months ago (2016-01-22 17:39:48 UTC) #43
Alexei Svitkine (slow)
On 2016/01/22 17:39:48, bcwhite wrote: > On 2016/01/22 17:23:40, Alexei Svitkine (very slow) wrote: > ...
4 years, 10 months ago (2016-02-01 16:28:09 UTC) #45
Alexei Svitkine (slow)
Also, please add the new histogram to histograms.xml per my previous comment.
4 years, 10 months ago (2016-02-01 16:28:33 UTC) #46
bcwhite
On 2016/02/01 16:28:33, Alexei Svitkine (very slow) wrote: > Also, please add the new histogram ...
4 years, 10 months ago (2016-02-01 19:04:15 UTC) #47
Alexei Svitkine (slow)
lgtm
4 years, 10 months ago (2016-02-01 19:08:40 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1425533011/670001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1425533011/670001
4 years, 10 months ago (2016-02-01 19:45:43 UTC) #51
commit-bot: I haz the power
Committed patchset #28 (id:670001)
4 years, 10 months ago (2016-02-01 21:08:07 UTC) #54
commit-bot: I haz the power
4 years, 10 months ago (2016-02-01 21:10:29 UTC) #56
Message was sent while issue was closed.
Patchset 28 (id:??) landed as
https://crrev.com/5cb99ebcf2cf1450e7a68e7d7fd3d11ce0549175
Cr-Commit-Position: refs/heads/master@{#372760}

Powered by Google App Engine
This is Rietveld 408576698