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

Issue 1776013005: [DO NOT COMMIT] Refactor systrace to support new clock sync design (Closed)

Created:
4 years, 9 months ago by alexandermont
Modified:
4 years, 8 months ago
CC:
catapult-reviews_chromium.org
Base URL:
git@github.com:catapult-project/catapult@master
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

Refactor systrace to support new clock sync design. Do not commit this CL. This CL will be broken into several smaller CLs. I am keeping the CL visible so that I can use these changes as a reference when creating the smaller CLs.

Patch Set 1 #

Patch Set 2 : split up files and fix imports #

Patch Set 3 : use callbacks for clock sync #

Total comments: 30

Patch Set 4 : changes from code review #

Total comments: 28

Patch Set 5 : more changes from code review #

Patch Set 6 : use json #

Patch Set 7 : fix similarity #

Total comments: 15

Patch Set 8 : fix html/json output #

Patch Set 9 : change to stop with enter instead of control-C #

Patch Set 10 : set the pythonpath in init #

Patch Set 11 : add controllerTraceDataKey #

Total comments: 4

Patch Set 12 : more changes from code reviews #

Total comments: 12

Patch Set 13 : fix some bugs and changes from code review #

Total comments: 14

Patch Set 14 : add timeouts and fix tests #

Total comments: 29

Patch Set 15 : changes from code review #

Total comments: 17

Patch Set 16 : update documentation and python paths #

Total comments: 9

Patch Set 17 : more changes from code review #

Total comments: 1

Patch Set 18 : fix categories issue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1213 lines, -2240 lines) Patch
M devil/devil/android/device_utils.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +7 lines, -3 lines 0 comments Download
M systrace/bin/systrace View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M systrace/systrace/__init__.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +23 lines, -0 lines 0 comments Download
D systrace/systrace/agents/__init__.py View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M systrace/systrace/agents/atrace_agent.py View 1 2 3 4 1 chunk +0 lines, -696 lines 0 comments Download
M systrace/systrace/agents/atrace_agent_unittest.py View 1 2 3 4 1 chunk +0 lines, -168 lines 0 comments Download
M systrace/systrace/agents/ftrace_agent.py View 1 2 3 4 1 chunk +0 lines, -245 lines 0 comments Download
M systrace/systrace/agents/ftrace_agent_unittest.py View 1 2 3 4 1 chunk +0 lines, -136 lines 0 comments Download
A + systrace/systrace/run_systrace.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +80 lines, -122 lines 0 comments Download
M systrace/systrace/systrace.py View 1 1 chunk +0 lines, -224 lines 0 comments Download
D systrace/systrace/systrace_agent.py View 1 chunk +0 lines, -62 lines 0 comments Download
A systrace/systrace/systrace_tracing_controller.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +195 lines, -0 lines 0 comments Download
A systrace/systrace/systrace_unittest.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +127 lines, -0 lines 0 comments Download
A systrace/systrace/tracing_agents/__init__.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +81 lines, -0 lines 0 comments Download
A + systrace/systrace/tracing_agents/atrace_agent.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 10 chunks +267 lines, -419 lines 0 comments Download
A + systrace/systrace/tracing_agents/atrace_agent_unittest.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +21 lines, -44 lines 0 comments Download
A + systrace/systrace/tracing_agents/ftrace_agent.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +129 lines, -81 lines 0 comments Download
A + systrace/systrace/tracing_agents/ftrace_agent_unittest.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +26 lines, -28 lines 0 comments Download
A systrace/systrace/tracing_controller.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +231 lines, -0 lines 0 comments Download
M systrace/systrace/update_systrace_trace_viewer.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +23 lines, -7 lines 0 comments Download
M tracing/tracing/extras/systrace_config.html View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 48 (9 generated)
alexandermont
4 years, 9 months ago (2016-03-09 19:08:19 UTC) #2
alexandermont
This change is based on the code review comments in the other CL (now closed). ...
4 years, 9 months ago (2016-03-10 20:10:11 UTC) #3
alexandermont
4 years, 9 months ago (2016-03-10 20:10:45 UTC) #4
alexandermont
4 years, 9 months ago (2016-03-10 20:10:57 UTC) #6
Zhen Wang
Thanks for doing this, Alex! charliea, please take a look at the comment at systrace/systrace/systrace_tracing_controller.py:60 ...
4 years, 9 months ago (2016-03-11 17:27:18 UTC) #8
alexandermont
https://codereview.chromium.org/1776013005/diff/40001/systrace/systrace/agents/atrace_agent.py File systrace/systrace/agents/atrace_agent.py (right): https://codereview.chromium.org/1776013005/diff/40001/systrace/systrace/agents/atrace_agent.py#newcode107 systrace/systrace/agents/atrace_agent.py:107: trace_data = self._collect_trace_data() On 2016/03/11 at 17:27:17, Zhen Wang ...
4 years, 9 months ago (2016-03-11 23:01:10 UTC) #9
alexandermont
4 years, 9 months ago (2016-03-12 00:16:53 UTC) #10
Chris Craik
https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/agents/atrace_agent.py File systrace/systrace/agents/atrace_agent.py (right): https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/agents/atrace_agent.py#newcode218 systrace/systrace/agents/atrace_agent.py:218: self._stop_trace() does stopping make sense if there's no trace? ...
4 years, 9 months ago (2016-03-12 02:02:34 UTC) #11
Zhen Wang
The overall structure looks good. Alex, can you make all agents' SupportsExplicitClockSync() return false for ...
4 years, 9 months ago (2016-03-14 17:11:27 UTC) #12
nednguyen
https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/tracing_agent.py File systrace/systrace/tracing_agent.py (right): https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/tracing_agent.py#newcode50 systrace/systrace/tracing_agent.py:50: def RecordClockSyncMarker(self, sync_id, callback): s/callback/did_record_sync_marker_callback https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/tracing_controller.py File systrace/systrace/tracing_controller.py (right): ...
4 years, 9 months ago (2016-03-14 17:48:11 UTC) #13
Zhen Wang
https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/tracing_controller.py File systrace/systrace/tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/60001/systrace/systrace/tracing_controller.py#newcode106 systrace/systrace/tracing_controller.py:106: self._all_results = [agent.GetResults() for agent in self._agents + [self]] ...
4 years, 9 months ago (2016-03-14 17:58:23 UTC) #14
alexandermont
Changes made from the code review. Note that the change to device_utils (to add the ...
4 years, 9 months ago (2016-03-14 22:19:28 UTC) #16
Zhen Wang
Hmm, it seems the code diff is confused by the directory change. For example, atrace_agent.py ...
4 years, 9 months ago (2016-03-14 22:30:31 UTC) #17
alexandermont
On 2016/03/14 at 22:30:31, zhenw wrote: > Hmm, it seems the code diff is confused ...
4 years, 9 months ago (2016-03-14 22:31:53 UTC) #18
Zhen Wang
On 2016/03/14 22:31:53, alexandermont wrote: > On 2016/03/14 at 22:30:31, zhenw wrote: > > Hmm, ...
4 years, 9 months ago (2016-03-14 22:47:05 UTC) #19
alexandermont
Updated to use the json output format. Note that the trace viewer will not view ...
4 years, 9 months ago (2016-03-15 21:06:42 UTC) #20
alexandermont
4 years, 9 months ago (2016-03-15 21:14:58 UTC) #21
Zhen Wang
I think there are several importing issues. We should be able to run both of ...
4 years, 9 months ago (2016-03-16 16:54:30 UTC) #22
alexandermont
4 years, 9 months ago (2016-03-16 21:47:05 UTC) #23
alexandermont
Changed it to stop the trace using enter instead of control-C if no length of ...
4 years, 9 months ago (2016-03-17 17:59:49 UTC) #24
Zhen Wang
Some more comments about import issues in addition to https://codereview.chromium.org/1776013005/#msg22 You also need to update ...
4 years, 9 months ago (2016-03-18 22:33:18 UTC) #25
alexandermont
https://codereview.chromium.org/1776013005/diff/120001/systrace/systrace/systrace_tracing_controller.py File systrace/systrace/systrace_tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/120001/systrace/systrace/systrace_tracing_controller.py#newcode103 systrace/systrace/systrace_tracing_controller.py:103: if data: On 2016/03/16 at 16:54:29, Zhen Wang wrote: ...
4 years, 9 months ago (2016-03-23 00:15:06 UTC) #26
Zhen Wang
https://codereview.chromium.org/1776013005/diff/220001/systrace/systrace/__init__.py File systrace/systrace/__init__.py (right): https://codereview.chromium.org/1776013005/diff/220001/systrace/systrace/__init__.py#newcode20 systrace/systrace/__init__.py:20: os.path.dirname(os.path.abspath(__file__)), '..', '..') nit: s/'..'/os.path.pardir https://codereview.chromium.org/1776013005/diff/220001/systrace/systrace/__init__.py#newcode23 systrace/systrace/__init__.py:23: _AddDirToPythonPath(_CATAPULT_DIR, 'devil') ...
4 years, 9 months ago (2016-03-24 22:13:05 UTC) #27
alexandermont
https://codereview.chromium.org/1776013005/diff/220001/systrace/systrace/__init__.py File systrace/systrace/__init__.py (right): https://codereview.chromium.org/1776013005/diff/220001/systrace/systrace/__init__.py#newcode20 systrace/systrace/__init__.py:20: os.path.dirname(os.path.abspath(__file__)), '..', '..') On 2016/03/24 at 22:13:05, Zhen Wang ...
4 years, 9 months ago (2016-03-24 23:54:09 UTC) #28
alexandermont
4 years, 9 months ago (2016-03-24 23:54:17 UTC) #29
Zhen Wang
Alex, when I try systrace, I get error message "Couldn't create an importer for the ...
4 years, 9 months ago (2016-03-25 22:12:26 UTC) #30
alexandermont
Now with changes based on issues from previous code review. Note that this will still ...
4 years, 8 months ago (2016-03-28 22:58:06 UTC) #32
Zhen Wang
I just tried your CL with both HTML and JSON formats for --target=android. It actually ...
4 years, 8 months ago (2016-03-29 18:53:40 UTC) #33
alexandermont
Some more changes from the code review. I was not able to reproduce the problem ...
4 years, 8 months ago (2016-03-30 01:04:25 UTC) #34
Zhen Wang
If you use Catapult ToT, atrace json and html formats both work. For ftrace, I ...
4 years, 8 months ago (2016-03-30 16:14:08 UTC) #35
Zhen Wang
https://codereview.chromium.org/1776013005/diff/280001/systrace/systrace/tracing_controller.py File systrace/systrace/tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/280001/systrace/systrace/tracing_controller.py#newcode27 systrace/systrace/tracing_controller.py:27: output_controller_tracing_agent = False s/output_controller_tracing_agent/OUTPUT_CONTROLLER_TRACING_AGENT_ I just chatted with Charlie, ...
4 years, 8 months ago (2016-03-30 18:11:16 UTC) #36
alexandermont
https://codereview.chromium.org/1776013005/diff/280001/systrace/systrace/systrace_tracing_controller.py File systrace/systrace/systrace_tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/280001/systrace/systrace/systrace_tracing_controller.py#newcode46 systrace/systrace/systrace_tracing_controller.py:46: update_systrace_trace_viewer = __import__('update_systrace_trace_viewer') On 2016/03/30 at 16:14:08, Zhen Wang ...
4 years, 8 months ago (2016-03-30 19:33:25 UTC) #37
Zhen Wang
https://codereview.chromium.org/1776013005/diff/300001/systrace/systrace/systrace_tracing_controller.py File systrace/systrace/systrace_tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/300001/systrace/systrace/systrace_tracing_controller.py#newcode85 systrace/systrace/systrace_tracing_controller.py:85: results['controllerTraceDataKey'] = 'traceEvents' Check if we need to output ...
4 years, 8 months ago (2016-03-30 21:36:45 UTC) #38
alexandermont
https://codereview.chromium.org/1776013005/diff/300001/systrace/systrace/systrace_tracing_controller.py File systrace/systrace/systrace_tracing_controller.py (right): https://codereview.chromium.org/1776013005/diff/300001/systrace/systrace/systrace_tracing_controller.py#newcode85 systrace/systrace/systrace_tracing_controller.py:85: results['controllerTraceDataKey'] = 'traceEvents' On 2016/03/30 at 21:36:44, Zhen Wang ...
4 years, 8 months ago (2016-03-31 00:18:24 UTC) #39
Zhen Wang
I took a quick look. Overall, looks good. But I think the JSON format for ...
4 years, 8 months ago (2016-03-31 16:34:35 UTC) #40
nednguyen
On 2016/03/31 16:34:35, Zhen Wang (OOO until late May) wrote: > I took a quick ...
4 years, 8 months ago (2016-03-31 23:03:26 UTC) #41
alexandermont
4 years, 8 months ago (2016-03-31 23:48:08 UTC) #42
charliea (OOO until 10-5)
Moving myself to cc (I don't really have enough experience with systrace to do a ...
4 years, 8 months ago (2016-04-01 17:23:47 UTC) #45
alexandermont
4 years, 8 months ago (2016-04-01 18:34:48 UTC) #47
We have a possible new plan to split this CL up into multiple smaller CLs:

1. Rename systrace/systrace/agents to systrace/systrace/tracing_agents

2. Change device_utils to add the new split_lines parameter

3. Rename systrace to run_systrace

4. Add TracingAgent class and modify atrace and ftrace to subclass from it.

5. Add in TracingController and SystraceTracingController (Possibly look at
whether we need to have two separate classes for these)

Powered by Google App Engine
This is Rietveld 408576698