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

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed)

Created:
6 years, 4 months ago by nednguyen
Modified:
6 years, 4 months ago
CC:
aandrey+blink_chromium.org, chromium-reviews, darin-cc_chromium.org, devtools-reviews_chromium.org, dsinclair+watch_chromium.org, erikwright+watch_chromium.org, jam, paulirish+reviews_chromium.org, pfeldman, vsevik, yurys
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Refactor tracing to pass around base::debug::TraceOptions to reduce spaghetti Previously, the options for tracing were passed around with different ad hoc systems. Strings in some places, base::debug::TraceOptions enum in others, and a content::TraceOptions in yet another. There were two separate ad-hoc string formats. Similar messes were present with category filters: sometimes we passed strings, sometimes the CategoryFilter. This patch though enormous looking simply consolidates all this ad-hockery into base::debug::TraceOptions. It may look like the call sites have gotten more verbose, but the end result of this is a consistent understanding of TraceOptions. There is one exception to this consolidation: devtools has to maintain its own mapping of string->TraceOptions encoding. This is because DevTools makes guarantees about backward compatibility: if base changes its mind about the string form of a TraceOption, devtools needs to keep supporting the old form. BUG=396081 TBR=cevans@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287348

Patch Set 1 : #

Total comments: 20

Patch Set 2 : Pull enable_systrace to TraceOptions #

Total comments: 12

Patch Set 3 : Address Nat and Dan's comments. Use CategoryFilter for tracing_controller.h's APIs #

Total comments: 4

Patch Set 4 : Address Xianzhu's comment. Add documentation to TraceOptions(string) #

Patch Set 5 : Address Nat's comments. #

Total comments: 79

Patch Set 6 : Address Dan's comments #

Total comments: 7

Patch Set 7 : Address Willchan's comments #

Patch Set 8 : Address joechan's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+703 lines, -376 lines) Patch
M base/debug/trace_event_android.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M base/debug/trace_event_impl.h View 1 2 3 4 5 6 7 10 chunks +73 lines, -21 lines 0 comments Download
M base/debug/trace_event_impl.cc View 1 2 3 4 5 6 7 13 chunks +114 lines, -14 lines 0 comments Download
M base/debug/trace_event_impl_constants.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M base/debug/trace_event_unittest.cc View 1 2 3 4 5 6 7 49 chunks +275 lines, -141 lines 0 comments Download
M base/test/trace_event_analyzer_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/lifetime/application_lifetime.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/base/tracing.cc View 1 2 3 chunks +5 lines, -2 lines 0 comments Download
M components/feedback/tracing_manager.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M components/tracing/child_trace_message_filter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M components/tracing/child_trace_message_filter.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M components/tracing/tracing_messages.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M content/app/android/library_loader_hooks.cc View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M content/app/content_main_runner.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/android/tracing_controller_android.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/tracing_controller_android.cc View 1 2 1 chunk +5 lines, -4 lines 0 comments Download
M content/browser/devtools/devtools_tracing_handler.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/devtools/devtools_tracing_handler.cc View 1 2 3 4 5 6 5 chunks +15 lines, -11 lines 0 comments Download
M content/browser/media/webrtc_getusermedia_browsertest.cc View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/tracing/trace_message_filter.h View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/tracing/trace_message_filter.cc View 1 2 3 4 2 chunks +8 lines, -8 lines 0 comments Download
M content/browser/tracing/tracing_controller_browsertest.cc View 1 2 3 4 5 6 7 8 chunks +41 lines, -28 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.h View 1 2 3 4 3 chunks +19 lines, -16 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.cc View 1 2 3 4 13 chunks +30 lines, -41 lines 0 comments Download
M content/browser/tracing/tracing_ui.cc View 1 2 3 4 5 6 chunks +48 lines, -37 lines 0 comments Download
M content/common/gpu/client/gl_helper_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java View 1 2 3 4 5 6 chunks +15 lines, -14 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/TracingControllerAndroidTest.java View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/public/browser/tracing_controller.h View 1 2 3 4 5 chunks +9 lines, -13 lines 0 comments Download
M content/renderer/devtools/devtools_agent.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 40 (0 generated)
nednguyen
6 years, 4 months ago (2014-07-28 17:38:57 UTC) #1
dsinclair
This feels like it's adding a bunch of duplication and confusing code for minimal gain. ...
6 years, 4 months ago (2014-07-28 18:52:37 UTC) #2
nednguyen
I like the chaining suggestion. I will fix that and other API issues after we ...
6 years, 4 months ago (2014-07-28 20:27:22 UTC) #3
nduca
sorry dan, lemme review this a bit until i like it and then we can ...
6 years, 4 months ago (2014-07-28 20:39:32 UTC) #4
nduca
some thoughts looks really solid https://codereview.chromium.org/425593002/diff/340002/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/425593002/diff/340002/base/debug/trace_event_impl.h#newcode370 base/debug/trace_event_impl.h:370: enum RecordMode { you ...
6 years, 4 months ago (2014-07-29 00:15:01 UTC) #5
nednguyen
https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_android.cc#newcode102 base/debug/trace_event_android.cc:102: base::debug::TraceOptions::RECORD_CONTINUOUSLY, false)); On 2014/07/28 18:52:36, dsinclair wrote: > I'm ...
6 years, 4 months ago (2014-07-29 19:33:21 UTC) #6
Xianzhu
https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_impl.h#newcode391 base/debug/trace_event_impl.h:391: : record_mode(record_mode), enable_sampling(enable_sampling) {} Indentation of the above lines ...
6 years, 4 months ago (2014-07-29 21:59:05 UTC) #7
nednguyen
6 years, 4 months ago (2014-07-29 21:59:09 UTC) #8
Xianzhu
https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/425593002/diff/260001/base/debug/trace_event_impl.h#newcode391 base/debug/trace_event_impl.h:391: : record_mode(record_mode), enable_sampling(enable_sampling) {} On 2014/07/29 21:59:05, Xianzhu wrote: ...
6 years, 4 months ago (2014-07-29 22:00:27 UTC) #9
nednguyen
https://codereview.chromium.org/425593002/diff/510001/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java File content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java (right): https://codereview.chromium.org/425593002/diff/510001/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java#newcode180 content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java:180: * @param traceOptions Record until the user ends the ...
6 years, 4 months ago (2014-07-29 22:33:59 UTC) #10
Xianzhu
Android-related changes lgtm.
6 years, 4 months ago (2014-07-29 22:35:29 UTC) #11
nduca
lgtm https://codereview.chromium.org/425593002/diff/510001/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/425593002/diff/510001/base/debug/trace_event_impl.h#newcode392 base/debug/trace_event_impl.h:392: TraceOptions& EnableSampling(bool option) { please make these go ...
6 years, 4 months ago (2014-07-29 22:40:13 UTC) #12
piman
OWNER LGTM for content/ once reviewers are happy, but nit: can you wrap the issue ...
6 years, 4 months ago (2014-07-30 01:08:17 UTC) #13
dsinclair
This is looking a lot better, thanks a lot for the changes. https://codereview.chromium.org/425593002/diff/570001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc ...
6 years, 4 months ago (2014-07-30 14:25:27 UTC) #14
nednguyen
https://codereview.chromium.org/425593002/diff/570001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/425593002/diff/570001/base/debug/trace_event_impl.cc#newcode1198 base/debug/trace_event_impl.cc:1198: trace_options_(kInternalRecordUntilFull), On 2014/07/30 14:25:24, dsinclair wrote: > RECORD_UNTIL_FULL is ...
6 years, 4 months ago (2014-07-30 16:51:16 UTC) #15
nednguyen
6 years, 4 months ago (2014-07-30 16:52:10 UTC) #16
dsinclair
lgtm once you've confirmed the changed behaviour is acceptable.
6 years, 4 months ago (2014-07-30 17:23:39 UTC) #17
nednguyen
+haraken: can you help reviewing changes in tracing_controller_impl? Thanks.
6 years, 4 months ago (2014-07-30 17:41:37 UTC) #18
haraken
On 2014/07/30 17:41:37, nednguyen wrote: > +haraken: can you help reviewing changes in tracing_controller_impl? Thanks. ...
6 years, 4 months ago (2014-07-30 18:10:51 UTC) #19
nednguyen
The CQ bit was checked by nednguyen@google.com
6 years, 4 months ago (2014-07-30 18:15:49 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nednguyen@google.com/425593002/590001
6 years, 4 months ago (2014-07-30 18:16:51 UTC) #21
nednguyen
6 years, 4 months ago (2014-07-30 18:29:40 UTC) #22
nednguyen
6 years, 4 months ago (2014-07-30 18:29:41 UTC) #23
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium.linux ...
6 years, 4 months ago (2014-07-30 21:02:22 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-07-30 21:08:44 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/1054)
6 years, 4 months ago (2014-07-30 21:08:45 UTC) #26
nednguyen
@willchan: I am looking for lg to base/ and components/ @jochen: I am looking for ...
6 years, 4 months ago (2014-07-31 19:16:15 UTC) #27
willchan no longer on Chromium
I'm not in components/OWNERS. On Thu, Jul 31, 2014 at 12:16 PM, <nednguyen@google.com> wrote: > ...
6 years, 4 months ago (2014-07-31 19:20:22 UTC) #28
willchan no longer on Chromium
base/LGTM https://codereview.chromium.org/425593002/diff/590001/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://codereview.chromium.org/425593002/diff/590001/base/debug/trace_event_android.cc#newcode101 base/debug/trace_event_android.cc:101: base::debug::TraceOptions( Nit: I'd ditch the base::debug::. You're already ...
6 years, 4 months ago (2014-07-31 19:26:44 UTC) #29
jochen (gone - plz use gerrit)
lgtm with nits. you'll need a security review for the ipc changes
6 years, 4 months ago (2014-08-01 09:56:17 UTC) #30
nednguyen
https://codereview.chromium.org/425593002/diff/590001/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://codereview.chromium.org/425593002/diff/590001/base/debug/trace_event_android.cc#newcode101 base/debug/trace_event_android.cc:101: base::debug::TraceOptions( On 2014/07/31 19:26:43, willchan wrote: > Nit: I'd ...
6 years, 4 months ago (2014-08-04 02:07:14 UTC) #31
nednguyen
The CQ bit was checked by nednguyen@google.com
6 years, 4 months ago (2014-08-04 02:19:33 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nednguyen@google.com/425593002/630001
6 years, 4 months ago (2014-08-04 02:20:45 UTC) #33
nednguyen
The CQ bit was unchecked by nednguyen@google.com
6 years, 4 months ago (2014-08-04 05:00:30 UTC) #34
nednguyen
+cevans for change to tracing_messages.h PTAL
6 years, 4 months ago (2014-08-04 05:01:20 UTC) #35
jochen (gone - plz use gerrit)
sorry, I failed to publish my drafts... https://codereview.chromium.org/425593002/diff/590001/components/feedback/tracing_manager.cc File components/feedback/tracing_manager.cc (right): https://codereview.chromium.org/425593002/diff/590001/components/feedback/tracing_manager.cc#newcode94 components/feedback/tracing_manager.cc:94: base::debug::CategoryFilter(""), should ...
6 years, 4 months ago (2014-08-04 06:54:19 UTC) #36
nednguyen
On 2014/08/04 06:54:19, jochen wrote: > sorry, I failed to publish my drafts... > > ...
6 years, 4 months ago (2014-08-04 13:58:36 UTC) #37
nednguyen
The CQ bit was checked by nednguyen@google.com
6 years, 4 months ago (2014-08-04 14:20:12 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nednguyen@google.com/425593002/650001
6 years, 4 months ago (2014-08-04 14:20:53 UTC) #39
commit-bot: I haz the power
6 years, 4 months ago (2014-08-04 16:31:02 UTC) #40
Message was sent while issue was closed.
Change committed as 287348

Powered by Google App Engine
This is Rietveld 408576698