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

Issue 874543003: Add support for TraceEvent before the native library is loaded. (Closed)

Created:
5 years, 11 months ago by Benoit L
Modified:
4 years, 5 months ago
Reviewers:
pasko, nduca, pliard
CC:
chromium-reviews, darin-cc_chromium.org, dsinclair+watch_chromium.org, erikwright+watch_chromium.org, jam, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for TraceEvent before the native library is loaded. Currently trace events that occur before the native library is initialized are ignored. This CL fixes that by buffering the events that occur before the initialization of the native library on the Java side. Those events then get sent to the native TraceLog before the trace file gets written to disk. NOTE: this is only reviving pliard@'s CL (issue 230603003). BUG=317481

Patch Set 1 #

Patch Set 2 : Selectively enable startup tracing in ChromeShell. #

Total comments: 16

Patch Set 3 : Rebase. #

Patch Set 4 : Address comments. #

Patch Set 5 : Address comments. #

Total comments: 17

Patch Set 6 : . #

Patch Set 7 : Rebase. #

Total comments: 9

Patch Set 8 : Add Java tests. #

Patch Set 9 : Comments, cleanup and a JNI unittest. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+709 lines, -11 lines) Patch
M base/android/base_jni_registrar.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
A base/android/early_trace_event.h View 1 2 3 4 5 1 chunk +38 lines, -0 lines 0 comments Download
A base/android/early_trace_event.cc View 1 2 3 4 5 6 7 8 1 chunk +123 lines, -0 lines 0 comments Download
A base/android/java/src/org/chromium/base/EarlyTraceEvent.java View 1 2 3 4 5 6 7 8 1 chunk +210 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/TraceEvent.java View 1 2 3 4 5 6 7 7 chunks +29 lines, -7 lines 0 comments Download
A base/android/javatests/src/org/chromium/base/EarlyTraceEventTest.java View 1 2 3 4 5 6 7 1 chunk +110 lines, -0 lines 0 comments Download
M base/android/jni_array.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M base/android/jni_array.cc View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -0 lines 0 comments Download
M base/android/jni_array_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M base/trace_event/trace_event_impl.h View 1 2 3 4 5 6 2 chunks +29 lines, -0 lines 0 comments Download
M base/trace_event/trace_event_impl.cc View 1 2 3 4 5 6 7 4 chunks +45 lines, -3 lines 0 comments Download
M chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java View 1 2 3 4 5 6 7 3 chunks +10 lines, -1 line 0 comments Download
M content/browser/android/tracing_controller_android.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/android/tracing_controller_android.cc View 1 2 3 4 5 6 7 8 2 chunks +61 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.h View 1 2 3 4 5 6 4 chunks +9 lines, -0 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.cc View 1 2 3 4 5 6 7 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (4 generated)
Benoit L
Hello, Here is the CL reviving the early TraceEvent CL from pliard@.
5 years, 11 months ago (2015-01-27 13:54:53 UTC) #2
dsinclair
On 2015/01/27 at 13:54:53, lizeb wrote: > Hello, > > Here is the CL reviving ...
5 years, 11 months ago (2015-01-27 14:25:39 UTC) #3
dsinclair
https://codereview.chromium.org/874543003/diff/20001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/874543003/diff/20001/base/debug/trace_event_impl.cc#newcode1754 base/debug/trace_event_impl.cc:1754: // Note that the TraceEvent frontend expects the trace ...
5 years, 11 months ago (2015-01-27 14:43:31 UTC) #5
pasko
I don't have a strong opinion about AddCustomTraceEvent, but if we can avoid sorting the ...
5 years, 11 months ago (2015-01-27 15:36:02 UTC) #7
chromium-reviews
This is quite far for me now and wasn't meant at that time to be ...
5 years, 10 months ago (2015-02-03 16:01:51 UTC) #8
nduca
Trace event's dont have to be inserted in timestamp order into the file. On Tue, ...
5 years, 10 months ago (2015-02-03 16:31:35 UTC) #9
Benoit L
Thank you for the review. I have addressed the first round of comments. Indeed, not ...
5 years, 10 months ago (2015-02-09 16:34:01 UTC) #10
dsinclair
https://codereview.chromium.org/874543003/diff/80001/base/android/base_jni_registrar.cc File base/android/base_jni_registrar.cc (right): https://codereview.chromium.org/874543003/diff/80001/base/android/base_jni_registrar.cc#newcode43 base/android/base_jni_registrar.cc:43: { "EarlyTraceEvent", base::android::RegisterEarlyTraceEvent }, nit: looks like the spacing ...
5 years, 10 months ago (2015-02-09 21:11:20 UTC) #11
Benoit L
Thank you for the review! It pointed out a potential race. Aside from that, I ...
5 years, 10 months ago (2015-02-10 15:31:35 UTC) #12
Benoit L
Hello, The CL has been rebased, moving to the new flag TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP. PTAL.
5 years, 9 months ago (2015-03-04 12:47:44 UTC) #13
dsinclair
There is a lot of stuff going on in here, can we get some tests ...
5 years, 9 months ago (2015-03-16 14:41:23 UTC) #14
Benoit L
Hello, Thank you for the review. Sorry about the large diff. I have added Java ...
5 years, 9 months ago (2015-03-19 16:50:47 UTC) #15
dsinclair
https://codereview.chromium.org/874543003/diff/120001/base/trace_event/trace_event_impl.cc File base/trace_event/trace_event_impl.cc (right): https://codereview.chromium.org/874543003/diff/120001/base/trace_event/trace_event_impl.cc#newcode1961 base/trace_event/trace_event_impl.cc:1961: TimeTicks thread_now = ThreadNow(); On 2015/03/19 16:50:47, lizeb wrote: ...
5 years, 9 months ago (2015-03-19 18:35:32 UTC) #16
dsinclair
Is this CL still in the works?
5 years, 4 months ago (2015-08-05 18:09:24 UTC) #17
dsinclair
5 years, 4 months ago (2015-08-14 14:35:09 UTC) #19
Benoit L
5 years, 4 months ago (2015-08-18 11:34:34 UTC) #20
On 2015/08/14 14:35:09, dsinclair wrote:

Currently not, but we may want to revisit later.

Powered by Google App Engine
This is Rietveld 408576698