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

Issue 11345019: Make Chrome Trace work with Android ATrace. (Closed)

Created:
8 years, 1 month ago by Xianzhu
Modified:
5 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam
Visibility:
Public.

Description

Make Chrome Trace work with Android ATrace. It uses "view" tag in the ATrace to enable tracing Chrome events. Steps to grab a trace: 1. Enable trace of "view" in the Developer options. 2. adb shell stop; adb shell start or if the system itself supports changing trace settings without restart: adb shell am force-stop com.android.chrome (for stable version) adb shell am force-stop com.google.android.apps.chrome (for beta/dev version) 3. Start Chrome 4. // grab a 5-seconds trace, the result is in trace.html third_party/android_tools/sdk/tools/systrace/systrace.py -t 5 -f -w Note: the intent triggered Chrome trace still works with this patch. BUG= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=165507

Patch Set 1 #

Total comments: 2

Patch Set 2 : Don't append arguments to name #

Total comments: 7

Patch Set 3 : Remove redundant checking #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+268 lines, -100 lines) Patch
M base/base.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M base/debug/trace_event.h View 5 chunks +17 lines, -4 lines 0 comments Download
M base/debug/trace_event.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A base/debug/trace_event_android.cc View 1 1 chunk +140 lines, -0 lines 3 comments Download
M base/debug/trace_event_impl.h View 3 chunks +19 lines, -0 lines 0 comments Download
M base/debug/trace_event_impl.cc View 1 2 6 chunks +53 lines, -84 lines 0 comments Download
M content/common/android/trace_event_binding.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/common/TraceEvent.java View 6 chunks +32 lines, -10 lines 0 comments Download

Messages

Total messages: 18 (1 generated)
Xianzhu
8 years, 1 month ago (2012-10-29 22:33:33 UTC) #1
epenner
Awesome, I just tried this and it's working well. Only issue is the large amount ...
8 years, 1 month ago (2012-10-29 23:58:54 UTC) #2
Xianzhu
https://chromiumcodereview.appspot.com/11345019/diff/1/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://chromiumcodereview.appspot.com/11345019/diff/1/base/debug/trace_event_android.cc#newcode54 base/debug/trace_event_android.cc:54: for (int i = 0; i < num_args; ++i) ...
8 years, 1 month ago (2012-10-30 02:21:31 UTC) #3
brettw
owners lgtm rubberstamp. Please wait for review by jbates who seems to be the one ...
8 years, 1 month ago (2012-10-30 04:53:55 UTC) #4
Xianzhu
https://chromiumcodereview.appspot.com/11345019/diff/4001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://chromiumcodereview.appspot.com/11345019/diff/4001/base/debug/trace_event.h#newcode602 base/debug/trace_event.h:602: #define TRACE_EVENT_API_IS_ATRACE_ENABLED() \ On 2012/10/30 04:53:56, brettw wrote: > ...
8 years, 1 month ago (2012-10-30 17:52:19 UTC) #5
jbates
It looks like when InitATrace is called, tracing will permanently be turned on until chrome ...
8 years, 1 month ago (2012-10-30 20:22:14 UTC) #6
Xianzhu
> It looks like when InitATrace is called, tracing will permanently be turned on > ...
8 years, 1 month ago (2012-10-30 21:45:01 UTC) #7
jbates
LGTM https://chromiumcodereview.appspot.com/11345019/diff/4001/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://chromiumcodereview.appspot.com/11345019/diff/4001/base/debug/trace_event_android.cc#newcode51 base/debug/trace_event_android.cc:51: std::string out = StringPrintf("B|%d|%s-%s", getpid(), category, name); On ...
8 years, 1 month ago (2012-10-31 22:26:01 UTC) #8
Tom Hudson
On 2012/10/30 21:45:01, Xianzhu wrote: > > It looks like when InitATrace is called, tracing ...
8 years, 1 month ago (2012-11-01 14:59:56 UTC) #9
Xianzhu
On 2012/11/01 14:59:56, Tom Hudson wrote: > > Do you mean that you assume the ...
8 years, 1 month ago (2012-11-01 16:25:29 UTC) #10
Xianzhu
Just verified that the Android system (at most) JOP01+ can respond to change of trace ...
8 years, 1 month ago (2012-11-01 17:54:38 UTC) #11
Xianzhu
We need to depend on another hidden API android.os.SystemProperties to achieve real-time trace settings. To ...
8 years, 1 month ago (2012-11-01 18:40:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/11345019/7004
8 years, 1 month ago (2012-11-01 18:45:11 UTC) #13
commit-bot: I haz the power
Change committed as 165507
8 years, 1 month ago (2012-11-01 21:38:17 UTC) #14
pasko
https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_event_android.cc#newcode64 base/debug/trace_event_android.cc:64: write(g_atrace_fd, out.c_str(), out.size()); I am wondering why there is ...
5 years, 1 month ago (2015-10-26 15:12:54 UTC) #16
Xianzhu
https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_event_android.cc File base/debug/trace_event_android.cc (right): https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_event_android.cc#newcode64 base/debug/trace_event_android.cc:64: write(g_atrace_fd, out.c_str(), out.size()); On 2015/10/26 15:12:54, pasko wrote: > ...
5 years, 1 month ago (2015-10-26 16:04:24 UTC) #17
pasko
5 years, 1 month ago (2015-10-26 17:16:31 UTC) #18
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_ev...
File base/debug/trace_event_android.cc (right):

https://chromiumcodereview.appspot.com/11345019/diff/7004/base/debug/trace_ev...
base/debug/trace_event_android.cc:64: write(g_atrace_fd, out.c_str(),
out.size());
On 2015/10/26 16:04:24, Xianzhu wrote:
> On 2015/10/26 15:12:54, pasko wrote:
> > I am wondering why there is no protection against short writes here in a
form
> > of:
> > HANDLE_EINTR(write(...))
> > 
> > is it intentional?
> 
> Not intentional.

whew, thanks, added for tracking:
https://code.google.com/p/chromium/issues/detail?id=547825

Powered by Google App Engine
This is Rietveld 408576698