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

Issue 750183008: DevTools: Parallelize trace messages serialization. (Closed)

Created:
6 years ago by loislo
Modified:
5 years, 10 months ago
CC:
chromium-reviews, wfh+watch_chromium.org, dsinclair+watch_chromium.org, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: Parallelize trace messages serialization. Move serialization into a worker thread. As a result IO thread will be able to send messages to the browser. The original implementation did serialization on IO thread and was not able to send the messages because ipc had is_blocked_on_write_ = true and had no chance to check the actual state of the channel. So the messages were collected in output_queue. Also the messages could be quite big and could block the IO thread for a long time. BUG= Committed: https://crrev.com/d58e06aafd6572e681f9d30f313bf5393db9f2bc Cr-Commit-Position: refs/heads/master@{#308773} Committed: https://crrev.com/e7d8d8b60e331469a7af4936e9fcc16630fb8fdf Cr-Commit-Position: refs/heads/master@{#315957}

Patch Set 1 #

Total comments: 6

Patch Set 2 : comments addressed #

Total comments: 2

Patch Set 3 : comments addressed #

Patch Set 4 : tests were fixed #

Total comments: 4

Patch Set 5 : many unittests did fail because their callbacks were called on the worker thread. #

Patch Set 6 : minor change #

Patch Set 7 : unnecessary changes were removed #

Patch Set 8 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -14 lines) Patch
M base/trace_event/trace_event_impl.h View 1 2 3 4 5 6 7 3 chunks +7 lines, -3 lines 0 comments Download
M base/trace_event/trace_event_impl.cc View 1 2 3 4 5 6 7 7 chunks +22 lines, -9 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 45 (14 generated)
loislo
ptal
6 years ago (2014-12-05 15:46:58 UTC) #2
dsinclair
+wangxianzhu, +skyostil who did a lot of work on trace buffer locking.
6 years ago (2014-12-05 15:54:31 UTC) #4
Sami
Is the motivation here to make a tab more responsive while it is flushing trace ...
6 years ago (2014-12-05 16:33:01 UTC) #6
loislo
I recorded timeline for a few seconds of scrolling with pictures and layers. As result ...
6 years ago (2014-12-05 21:38:45 UTC) #7
Sami
Thanks for the benchmark numbers. I'm guessing that was on some kind of desktop PC? ...
6 years ago (2014-12-08 14:35:36 UTC) #8
loislo
On 2014/12/08 14:35:36, Sami wrote: > Thanks for the benchmark numbers. I'm guessing that was ...
6 years ago (2014-12-10 14:41:44 UTC) #9
Sami
https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc#newcode1792 base/debug/trace_event_impl.cc:1792: Bind(&TraceLog::ConvertTraceEventsToTraceFormat, Could you turn ConvertTraceEventsToTraceFormat into a static function ...
6 years ago (2014-12-10 14:56:02 UTC) #11
loislo
https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc#newcode1792 base/debug/trace_event_impl.cc:1792: Bind(&TraceLog::ConvertTraceEventsToTraceFormat, On 2014/12/10 14:56:01, Sami wrote: > Could you ...
6 years ago (2014-12-10 15:31:38 UTC) #12
loislo
On 2014/12/10 15:31:38, loislo wrote: > https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc > File base/debug/trace_event_impl.cc (right): > > https://codereview.chromium.org/750183008/diff/40001/base/debug/trace_event_impl.cc#newcode1792 > ...
6 years ago (2014-12-12 06:44:44 UTC) #13
Xianzhu
lgtm (not an owner).
6 years ago (2014-12-12 16:51:15 UTC) #14
dsinclair
lgtm
6 years ago (2014-12-12 16:56:31 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/60001
6 years ago (2014-12-12 16:57:43 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator/builds/41593)
6 years ago (2014-12-12 17:21:00 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/80001
6 years ago (2014-12-15 15:24:55 UTC) #21
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/30476)
6 years ago (2014-12-15 15:31:27 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/80001
6 years ago (2014-12-16 06:26:16 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/30728)
6 years ago (2014-12-16 06:31:56 UTC) #27
yurys
https://codereview.chromium.org/750183008/diff/80001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/750183008/diff/80001/base/debug/trace_event_impl.cc#newcode77 base/debug/trace_event_impl.cc:77: const size_t kTraceEventBufferSize = 10 * 1024 * 1024; ...
6 years ago (2014-12-17 08:50:30 UTC) #28
loislo
https://codereview.chromium.org/750183008/diff/80001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/750183008/diff/80001/base/debug/trace_event_impl.cc#newcode77 base/debug/trace_event_impl.cc:77: const size_t kTraceEventBufferSize = 10 * 1024 * 1024; ...
6 years ago (2014-12-17 08:56:46 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/120001
6 years ago (2014-12-17 08:57:24 UTC) #31
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/31035)
6 years ago (2014-12-17 09:03:06 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/140001
6 years ago (2014-12-17 09:06:31 UTC) #35
commit-bot: I haz the power
Committed patchset #7 (id:140001)
6 years ago (2014-12-17 10:21:39 UTC) #36
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/d58e06aafd6572e681f9d30f313bf5393db9f2bc Cr-Commit-Position: refs/heads/master@{#308773}
6 years ago (2014-12-17 10:22:56 UTC) #37
fmeawad
A revert of this CL (patchset #7 id:140001) has been created in https://codereview.chromium.org/804083004/ by fmeawad@chromium.org. ...
6 years ago (2014-12-19 21:01:02 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/750183008/160001
5 years, 10 months ago (2015-02-12 08:39:00 UTC) #40
loislo
On 2014/12/19 21:01:02, fmeawad wrote: > A revert of this CL (patchset #7 id:140001) has ...
5 years, 10 months ago (2015-02-12 08:44:18 UTC) #41
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 10 months ago (2015-02-12 10:54:14 UTC) #42
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/e7d8d8b60e331469a7af4936e9fcc16630fb8fdf Cr-Commit-Position: refs/heads/master@{#315957}
5 years, 10 months ago (2015-02-12 10:55:15 UTC) #43
loislo
A revert of this CL (patchset #8 id:160001) has been created in https://codereview.chromium.org/923693002/ by loislo@chromium.org. ...
5 years, 10 months ago (2015-02-12 20:10:46 UTC) #44
loislo
5 years, 10 months ago (2015-02-13 12:15:05 UTC) #45
Message was sent while issue was closed.
On 2015/02/12 20:10:46, loislo wrote:
> A revert of this CL (patchset #8 id:160001) has been created in
> https://codereview.chromium.org/923693002/ by mailto:loislo@chromium.org.
> 
> The reason for reverting is: looks like it breaks image_decoding_measurements
>
http://build.chromium.org/p/chromium.perf/builders/Win%20XP%20Perf%20%283%29/....

Benchmark code can't deal with the flow of tracing data.

C:\b\depot_tools\python276_bin\python.exe
C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\run_benchmark -v
--output-format=chartjson --upload-results inbox_benchmark.Inbox
--browser=release --output-dir=c:\users\chrome~1\appdata\local\temp\tmpiox06u

  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\user_story\user_story_runner.py",
line 100, in _RunUserStoryAndProcessErrorIfNeeded
    state.RunUserStory(results)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\page\shared_page_state.py",
line 242, in RunUserStory
    self._test.RunPage(self._current_page, self._current_tab, results)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\page\page_test.py",
line 239, in RunPage
    self.ValidateAndMeasurePage(page, tab, results)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\web_perf\timeline_based_measurement.py",
line 274, in ValidateAndMeasurePage
    self._measurement.Measure(tracing_controller, results)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\web_perf\timeline_based_measurement.py",
line 240, in Measure
    trace_result = tracing_controller.Stop()
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\platform\tracing_controller.py",
line 32, in Stop
    return self._tracing_controller_backend.Stop()
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\platform\tracing_controller_backend.py",
line 68, in Stop
    agent.Stop(trace_data_builder)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\platform\tracing_agent\chrome_tracing_agent.py",
line 97, in Stop
    devtools_client.StopChromeTracing(trace_data_builder)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\backends\chrome_inspector\devtools_client_backend.py",
line 149, in StopChromeTracing
    return self._tracing_backend.StopTracing(trace_data_builder, timeout)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\backends\chrome_inspector\tracing_backend.py",
line 88, in StopTracing
    self._inspector_websocket.DispatchNotificationsUntilDone(timeout)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\backends\chrome_inspector\inspector_websocket.py",
line 137, in DispatchNotificationsUntilDone
    if self._Receive(timeout):
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\perf\..\telemetry\telemetry\core\backends\chrome_inspector\inspector_websocket.py",
line 162, in _Receive
    data = self._socket.recv()
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\telemetry\third_party\websocket-client\websocket.py",
line 596, in recv
    opcode, data = self.recv_data()
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\telemetry\third_party\websocket-client\websocket.py",
line 606, in recv_data
    frame = self.recv_frame()
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\telemetry\third_party\websocket-client\websocket.py",
line 661, in recv_frame
    payload = self._recv_strict(self._frame_length)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\telemetry\third_party\websocket-client\websocket.py",
line 746, in _recv_strict
    bytes = self._recv(shortage)
  File
"C:\b\build\slave\Win_7_Perf__5_\build\src\tools\telemetry\third_party\websocket-client\websocket.py",
line 730, in _recv
    bytes = self.sock.recv(bufsize)
MemoryError

Powered by Google App Engine
This is Rietveld 408576698