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

Issue 1681263003: metrics: Add leak detector controller in Chrome OS metrics system (Closed)

Created:
4 years, 10 months ago by Simon Que
Modified:
4 years, 9 months ago
CC:
asvitkine+watch_chromium.org, bccheng, chromium-reviews, dhsharp, rapati, tipp
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

metrics: Add leak detector controller in Chrome OS metrics system The new class, LeakDetectorController, provides an interface to the leak detector. It initializes the leak detector and registers itself to receive leak reports. It converts the leak reports into protobuf format, and can later pass them to UMA. BUG=382705 TEST=build successfully, run unit_tests Committed: https://crrev.com/82e4d1559b83487b7d75527a8d74bdb41b5f5472 Cr-Commit-Position: refs/heads/master@{#378011}

Patch Set 1 #

Patch Set 2 : Add new files #

Total comments: 18

Patch Set 3 : Addressed comments, updated LeakDetector with default constructor #

Total comments: 11

Patch Set 4 : Make member functions protected, then exposed in test classes; Update comment of inherited method O… #

Patch Set 5 : Fix sign compaison mismatch, add override to derived destructor, update GN build #

Patch Set 6 : Update GYP build dependencies; Add build flag to GN build #

Patch Set 7 : Properly implement gn build #

Total comments: 2

Patch Set 8 : Remove frame ptr flag, add thread checker, add #define flag locally (gn build only) #

Total comments: 6

Patch Set 9 : Use new build flag generation system; Define var 'enable_leak_detector' locally #

Total comments: 1

Patch Set 10 : Replace GYP/GN flags with runtime command line flag #

Patch Set 11 : Make LeakDetector thread-safe #

Total comments: 10

Patch Set 12 : Responded to wfh's comments #

Total comments: 6

Patch Set 13 : "Addressed asvitkine's comments: remove using statement, move runtime flag to chrome_features" #

Total comments: 4

Patch Set 14 : Rename feature variable #

Patch Set 15 : Formatting #

Patch Set 16 : Add dep for test_browser_thread_bundle; Use FRIEND_TEST_ALL_PREFIXES #

Total comments: 6

Patch Set 17 : Respond to jochen's comments #

Patch Set 18 : Added TODO for LeakDetector class #

Patch Set 19 : Remove default constructor of LeakDetector, move to unit test #

Patch Set 20 : Add content/public/browser to GN deps #

Unified diffs Side-by-side diffs Delta from patch set Stats (+616 lines, -0 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/metrics/chromeos_metrics_provider.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/metrics/chromeos_metrics_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -0 lines 0 comments Download
A chrome/browser/metrics/leak_detector_controller.h View 1 2 3 4 5 6 7 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/metrics/leak_detector_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/browser/metrics/leak_detector_controller_unittest.cc View 1 2 3 4 1 chunk +169 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_features.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/chrome_features.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M components/metrics.gypi View 9 1 chunk +2 lines, -0 lines 0 comments Download
M components/metrics/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +5 lines, -0 lines 0 comments Download
M components/metrics/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +109 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +50 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +124 lines, -0 lines 0 comments Download

Messages

Total messages: 84 (18 generated)
Simon Que
This patch is the workaround that I described to use in wfh's absence. It makes ...
4 years, 10 months ago (2016-02-10 04:25:04 UTC) #2
Alexei Svitkine (slow)
https://codereview.chromium.org/1681263003/diff/20001/chrome/browser/metrics/leak_detector_controller.cc File chrome/browser/metrics/leak_detector_controller.cc (right): https://codereview.chromium.org/1681263003/diff/20001/chrome/browser/metrics/leak_detector_controller.cc#newcode39 chrome/browser/metrics/leak_detector_controller.cc:39: stored_reports_.resize(stored_reports_.size() + 1); I think this pattern results in ...
4 years, 10 months ago (2016-02-10 20:16:59 UTC) #3
Simon Que
https://codereview.chromium.org/1681263003/diff/20001/chrome/browser/metrics/leak_detector_controller.cc File chrome/browser/metrics/leak_detector_controller.cc (right): https://codereview.chromium.org/1681263003/diff/20001/chrome/browser/metrics/leak_detector_controller.cc#newcode39 chrome/browser/metrics/leak_detector_controller.cc:39: stored_reports_.resize(stored_reports_.size() + 1); On 2016/02/10 20:16:58, Alexei Svitkine wrote: ...
4 years, 10 months ago (2016-02-11 01:45:38 UTC) #4
Alexei Svitkine (slow)
lgtm % remaining comments https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h File chrome/browser/metrics/leak_detector_controller.h (right): https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h#newcode23 chrome/browser/metrics/leak_detector_controller.h:23: // Stores a new leak ...
4 years, 10 months ago (2016-02-12 16:17:42 UTC) #5
Simon Que
https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h File chrome/browser/metrics/leak_detector_controller.h (right): https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h#newcode23 chrome/browser/metrics/leak_detector_controller.h:23: // Stores a new leak report in |stored_reports_|. On ...
4 years, 10 months ago (2016-02-12 19:00:07 UTC) #6
Simon Que
Ping. Waiting for input before proceeding.
4 years, 10 months ago (2016-02-17 01:55:43 UTC) #7
Alexei Svitkine (slow)
https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h File chrome/browser/metrics/leak_detector_controller.h (right): https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h#newcode24 chrome/browser/metrics/leak_detector_controller.h:24: void OnLeakFound(const LeakDetector::LeakReport& report) override; On 2016/02/12 19:00:07, Simon ...
4 years, 10 months ago (2016-02-17 16:06:30 UTC) #8
Simon Que
https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h File chrome/browser/metrics/leak_detector_controller.h (right): https://codereview.chromium.org/1681263003/diff/40001/chrome/browser/metrics/leak_detector_controller.h#newcode23 chrome/browser/metrics/leak_detector_controller.h:23: // Stores a new leak report in |stored_reports_|. On ...
4 years, 10 months ago (2016-02-17 20:49:33 UTC) #9
Simon Que
4 years, 10 months ago (2016-02-17 20:52:26 UTC) #11
Alexei Svitkine (slow)
lgtm
4 years, 10 months ago (2016-02-17 20:53:33 UTC) #12
Simon Que
On 2016/02/17 20:53:33, Alexei Svitkine wrote: > lgtm Added thakis to review changes to build/common.gypi.
4 years, 10 months ago (2016-02-17 21:08:00 UTC) #13
brettw
Sorry to come in late and add a lot of headache: FOr new feature defines, ...
4 years, 10 months ago (2016-02-18 04:30:21 UTC) #15
Will Harris
https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc File chrome/browser/metrics/leak_detector_controller.cc (right): https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc#newcode38 chrome/browser/metrics/leak_detector_controller.cc:38: const LeakDetector::LeakReport& report) { which threads are OnLeakFound and ...
4 years, 10 months ago (2016-02-18 04:49:45 UTC) #16
Simon Que
https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc File chrome/browser/metrics/leak_detector_controller.cc (right): https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc#newcode38 chrome/browser/metrics/leak_detector_controller.cc:38: const LeakDetector::LeakReport& report) { On 2016/02/18 04:49:45, Will Harris ...
4 years, 10 months ago (2016-02-18 05:16:04 UTC) #17
Will Harris
On 2016/02/18 05:16:04, Simon Que wrote: > https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc > File chrome/browser/metrics/leak_detector_controller.cc (right): > > https://codereview.chromium.org/1681263003/diff/120001/chrome/browser/metrics/leak_detector_controller.cc#newcode38 ...
4 years, 10 months ago (2016-02-18 05:23:27 UTC) #18
Alexei Svitkine (slow)
Agree with Will. OnLeakFound() should only be called on the UI thread and it makes ...
4 years, 10 months ago (2016-02-18 15:55:58 UTC) #19
Simon Que
Where should the post-back-to-UI-thread take place? In OnLeakFound() or in the caller of OnLeakFound()? If ...
4 years, 10 months ago (2016-02-18 19:14:59 UTC) #20
Simon Que
On 2016/02/18 04:30:21, brettw wrote: > There should be extensive documentation in build/buildflag_header.gypi and > ...
4 years, 10 months ago (2016-02-18 20:33:02 UTC) #21
Alexei Svitkine (slow)
I wonder if we really need the extra complexity from the BUILD files vs. just ...
4 years, 10 months ago (2016-02-18 21:09:20 UTC) #22
Simon Que
On 2016/02/18 21:09:20, Alexei Svitkine wrote: > I wonder if we really need the extra ...
4 years, 10 months ago (2016-02-18 21:11:39 UTC) #23
brettw
On 2016/02/18 21:09:20, Alexei Svitkine wrote: > I wonder if we really need the extra ...
4 years, 10 months ago (2016-02-18 21:14:14 UTC) #24
brettw
It looks like you added the code to generate the header to the GN build ...
4 years, 10 months ago (2016-02-18 21:14:58 UTC) #25
Simon Que
On 2016/02/18 21:14:58, brettw wrote: > It looks like you added the code to generate ...
4 years, 10 months ago (2016-02-18 21:23:45 UTC) #26
brettw
On 2016/02/18 21:23:45, Simon Que wrote: > On 2016/02/18 21:14:58, brettw wrote: > > It ...
4 years, 10 months ago (2016-02-18 21:30:48 UTC) #27
Simon Que
On 2016/02/18 21:30:48, brettw wrote: > On 2016/02/18 21:23:45, Simon Que wrote: > > On ...
4 years, 10 months ago (2016-02-18 23:22:08 UTC) #28
Simon Que
On 2016/02/18 23:22:08, Simon Que wrote: > On 2016/02/18 21:30:48, brettw wrote: > > On ...
4 years, 10 months ago (2016-02-19 00:02:09 UTC) #29
Simon Que
https://codereview.chromium.org/1681263003/diff/140001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1681263003/diff/140001/build/common.gypi#newcode3089 build/common.gypi:3089: 'defines': ['ENABLE_LEAK_DETECTOR=1'], On 2016/02/18 21:14:57, brettw wrote: > With ...
4 years, 10 months ago (2016-02-19 02:13:02 UTC) #31
Simon Que
The GN build completes successfully, but the GYP build does not. There is a metrics_flags_buildflag_header.rsp ...
4 years, 10 months ago (2016-02-19 02:33:55 UTC) #32
Will Harris
On 2016/02/18 21:11:39, Simon Que wrote: > I'm not looking to unconditionally enable this on ...
4 years, 10 months ago (2016-02-19 02:49:58 UTC) #33
Simon Que
On 2016/02/19 02:49:58, Will Harris (ooo until 25 Feb) wrote: > On 2016/02/18 21:11:39, Simon ...
4 years, 10 months ago (2016-02-19 03:05:23 UTC) #34
Will Harris
On 2016/02/19 03:05:23, Simon Que wrote: > On 2016/02/19 02:49:58, Will Harris (ooo until 25 ...
4 years, 10 months ago (2016-02-19 03:09:32 UTC) #35
Simon Que
On 2016/02/19 03:09:32, Will Harris (ooo until 25 Feb) wrote: > On 2016/02/19 03:05:23, Simon ...
4 years, 10 months ago (2016-02-19 03:29:16 UTC) #36
Will Harris
On 2016/02/19 03:29:16, Simon Que wrote: > On 2016/02/19 03:09:32, Will Harris (ooo until 25 ...
4 years, 10 months ago (2016-02-19 04:12:14 UTC) #38
Simon Que
Will and I talked over hangouts about this matter. I intend to have some sort ...
4 years, 10 months ago (2016-02-19 05:53:36 UTC) #39
Simon Que
Will and I talked over hangouts about this matter. I intend to have some sort ...
4 years, 10 months ago (2016-02-19 05:53:39 UTC) #40
Alexei Svitkine (slow)
+1 for the runtime check. Instead of using a flag, use a base::Feature which allows ...
4 years, 10 months ago (2016-02-19 15:46:20 UTC) #41
brettw
On 2016/02/18 23:22:08, Simon Que wrote: > There is no error message. The file metrics_flags.h ...
4 years, 10 months ago (2016-02-19 17:40:58 UTC) #42
Simon Que
On 2016/02/19 15:46:20, Alexei Svitkine wrote: > +1 for the runtime check. Instead of using ...
4 years, 10 months ago (2016-02-19 19:09:47 UTC) #43
Alexei Svitkine (slow)
Adding it to about_flags.cc is optional and it's up to you if you want it ...
4 years, 10 months ago (2016-02-19 19:21:27 UTC) #44
Simon Que
I've added the runtime flag. I still need to resolve the thread safety issues. At ...
4 years, 10 months ago (2016-02-19 23:05:08 UTC) #46
Alexei Svitkine (slow)
That SGTM On 19 Feb 2016 6:05 p.m., <sque@chromium.org> wrote: > > I've added the ...
4 years, 10 months ago (2016-02-20 00:13:00 UTC) #47
Simon Que
On 2016/02/20 00:13:00, Alexei Svitkine wrote: > That SGTM > On 19 Feb 2016 6:05 ...
4 years, 10 months ago (2016-02-20 02:18:29 UTC) #48
Will Harris
On 2016/02/20 02:18:29, Simon Que wrote: > On 2016/02/20 00:13:00, Alexei Svitkine wrote: > > ...
4 years, 10 months ago (2016-02-20 02:29:25 UTC) #49
Simon Que
On 2016/02/20 02:29:25, Will Harris (ooo until 25 Feb) wrote: > On 2016/02/20 02:18:29, Simon ...
4 years, 10 months ago (2016-02-20 03:12:12 UTC) #50
Will Harris
looking good about to jump on plane, but few comments Q. where will the logic ...
4 years, 10 months ago (2016-02-20 08:54:05 UTC) #51
Will Harris
looking good about to jump on plane, but few comments Q. where will the logic ...
4 years, 10 months ago (2016-02-20 08:54:07 UTC) #52
Simon Que
On 2016/02/20 08:54:05, Will Harris (ooo until 25 Feb) wrote: > looking good > > ...
4 years, 10 months ago (2016-02-22 23:26:18 UTC) #53
Alexei Svitkine (slow)
https://codereview.chromium.org/1681263003/diff/260001/components/metrics/leak_detector/leak_detector.cc File components/metrics/leak_detector/leak_detector.cc (right): https://codereview.chromium.org/1681263003/diff/260001/components/metrics/leak_detector/leak_detector.cc#newcode11 components/metrics/leak_detector/leak_detector.cc:11: using content::BrowserThread; Nit: Just use the content:: prefix in ...
4 years, 10 months ago (2016-02-23 01:23:35 UTC) #54
Simon Que
https://codereview.chromium.org/1681263003/diff/260001/components/metrics/leak_detector/leak_detector.cc File components/metrics/leak_detector/leak_detector.cc (right): https://codereview.chromium.org/1681263003/diff/260001/components/metrics/leak_detector/leak_detector.cc#newcode11 components/metrics/leak_detector/leak_detector.cc:11: using content::BrowserThread; On 2016/02/23 01:23:35, Alexei Svitkine (slow) wrote: ...
4 years, 10 months ago (2016-02-23 02:38:29 UTC) #55
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1681263003/diff/280001/chrome/browser/metrics/chromeos_metrics_provider.cc File chrome/browser/metrics/chromeos_metrics_provider.cc (right): https://codereview.chromium.org/1681263003/diff/280001/chrome/browser/metrics/chromeos_metrics_provider.cc#newcode149 chrome/browser/metrics/chromeos_metrics_provider.cc:149: features::kEnableRuntimeMemoryLeakDetector)) { Nit: No need for "Enable" in ...
4 years, 10 months ago (2016-02-23 16:56:53 UTC) #56
Simon Que
https://codereview.chromium.org/1681263003/diff/280001/chrome/browser/metrics/chromeos_metrics_provider.cc File chrome/browser/metrics/chromeos_metrics_provider.cc (right): https://codereview.chromium.org/1681263003/diff/280001/chrome/browser/metrics/chromeos_metrics_provider.cc#newcode149 chrome/browser/metrics/chromeos_metrics_provider.cc:149: features::kEnableRuntimeMemoryLeakDetector)) { On 2016/02/23 16:56:53, Alexei Svitkine (slow) wrote: ...
4 years, 10 months ago (2016-02-23 18:43:23 UTC) #57
Simon Que
+jochen for: - components/components_tests.gyp - chrome/*.gypi - chrome/browser/BUILD.gn
4 years, 10 months ago (2016-02-23 19:07:29 UTC) #59
Will Harris
https://codereview.chromium.org/1681263003/diff/240001/components/metrics/leak_detector/leak_detector.h File components/metrics/leak_detector/leak_detector.h (right): https://codereview.chromium.org/1681263003/diff/240001/components/metrics/leak_detector/leak_detector.h#newcode96 components/metrics/leak_detector/leak_detector.h:96: void NotifyObservers(const std::vector<LeakReport>& reports); On 2016/02/22 23:26:18, Simon Que ...
4 years, 10 months ago (2016-02-23 20:48:26 UTC) #60
Simon Que
https://codereview.chromium.org/1681263003/diff/240001/components/metrics/leak_detector/leak_detector.h File components/metrics/leak_detector/leak_detector.h (right): https://codereview.chromium.org/1681263003/diff/240001/components/metrics/leak_detector/leak_detector.h#newcode96 components/metrics/leak_detector/leak_detector.h:96: void NotifyObservers(const std::vector<LeakReport>& reports); On 2016/02/23 20:48:26, Will Harris ...
4 years, 10 months ago (2016-02-23 23:19:23 UTC) #61
jochen (gone - plz use gerrit)
it's a bit unclear to me how a sampling profiler would detect leaks? https://codereview.chromium.org/1681263003/diff/340001/components/metrics/leak_detector/leak_detector.cc File ...
4 years, 10 months ago (2016-02-24 08:05:22 UTC) #62
Simon Que
https://codereview.chromium.org/1681263003/diff/340001/components/metrics/leak_detector/leak_detector.cc File components/metrics/leak_detector/leak_detector.cc (right): https://codereview.chromium.org/1681263003/diff/340001/components/metrics/leak_detector/leak_detector.cc#newcode18 components/metrics/leak_detector/leak_detector.cc:18: int max_stack_depth, On 2016/02/24 08:05:22, jochen wrote: > what ...
4 years, 10 months ago (2016-02-24 21:28:35 UTC) #63
jochen (gone - plz use gerrit)
what about my high-level question? how does this system detect leaks?
4 years, 10 months ago (2016-02-25 11:53:18 UTC) #64
Simon Que
On 2016/02/25 11:53:18, jochen wrote: > what about my high-level question? how does this system ...
4 years, 10 months ago (2016-02-25 19:02:47 UTC) #65
jochen (gone - plz use gerrit)
lgtm
4 years, 10 months ago (2016-02-26 12:15:24 UTC) #67
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1681263003/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1681263003/420001
4 years, 9 months ago (2016-02-26 17:13:10 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/149477)
4 years, 9 months ago (2016-02-26 17:27:06 UTC) #72
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1681263003/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1681263003/460001
4 years, 9 months ago (2016-02-26 20:18:53 UTC) #76
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/72765)
4 years, 9 months ago (2016-02-26 20:37:26 UTC) #78
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1681263003/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1681263003/460001
4 years, 9 months ago (2016-02-26 21:18:29 UTC) #80
commit-bot: I haz the power
Committed patchset #20 (id:460001)
4 years, 9 months ago (2016-02-26 22:47:28 UTC) #82
commit-bot: I haz the power
4 years, 9 months ago (2016-02-26 22:49:49 UTC) #84
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/82e4d1559b83487b7d75527a8d74bdb41b5f5472
Cr-Commit-Position: refs/heads/master@{#378011}

Powered by Google App Engine
This is Rietveld 408576698