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

Issue 2196663002: tracing v2: Introduce TraceBufferWriter (Closed)

Created:
4 years, 4 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 4 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, kraynov
Base URL:
https://chromium.googlesource.com/chromium/src.git@proto_refactor
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

tracing v2: Introduce TraceBufferWriter TraceBufferWriter is the main building block that allows writing events into the trace ring buffer. TBW is responsible of exchanging chunks with the ring buffer and carving out events out of them. The expected design is 1 TraceBufferWriter per thread (% very special cases like worker pools which don't have a message loop). The major challenge is represented by the fact that events can spread over several chunks. TBW is responsible of owning chunks for the all lifetime of the event, and returning them as soon as the event is finalized. In the next CLs: - This code will be properly integrated with the stubs generated by the protozero protoc compiler plugin. - The actual event.proto will be introduced, and TBW::AddEvent will return a more structured object other than just a ProtoZeroMessage. BUG=608719 TEST=TraceBufferWriterTest.* Committed: https://crrev.com/9cc78e4aea540c6eba8655d8557b068bde423152 Cr-Commit-Position: refs/heads/master@{#410669}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 18

Patch Set 3 : alph review #

Patch Set 4 : Add TRACING_EXPORT also to nested class #

Total comments: 12

Patch Set 5 : oysteine review + rebase #

Patch Set 6 : Fix linking errors moving kChunkSize outside of exported class #

Unified diffs Side-by-side diffs Delta from patch set Stats (+713 lines, -13 lines) Patch
M components/components_tests.gyp View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M components/tracing.gyp View 2 chunks +17 lines, -0 lines 0 comments Download
M components/tracing/BUILD.gn View 1 2 3 4 3 chunks +14 lines, -0 lines 0 comments Download
M components/tracing/core/proto_utils.h View 1 chunk +6 lines, -0 lines 0 comments Download
M components/tracing/core/proto_zero_message.h View 2 chunks +2 lines, -2 lines 0 comments Download
M components/tracing/core/scattered_stream_writer.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M components/tracing/core/scattered_stream_writer.cc View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
A components/tracing/core/trace_buffer_writer.h View 1 2 1 chunk +101 lines, -0 lines 0 comments Download
A components/tracing/core/trace_buffer_writer.cc View 1 2 3 4 5 1 chunk +214 lines, -0 lines 0 comments Download
A components/tracing/core/trace_buffer_writer_unittest.cc View 1 2 3 4 5 1 chunk +310 lines, -0 lines 0 comments Download
M components/tracing/core/trace_ring_buffer.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M components/tracing/core/trace_ring_buffer.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M components/tracing/core/trace_ring_buffer_unittest.cc View 1 2 3 4 5 2 chunks +1 line, -3 lines 0 comments Download
A components/tracing/proto/events_chunk.proto View 1 chunk +35 lines, -0 lines 0 comments Download
M components/tracing/test/fake_scattered_buffer.h View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 38 (24 generated)
Primiano Tucci (use gerrit)
ok this might take a bit to digest, but is one of the biggest pieces.
4 years, 4 months ago (2016-07-29 10:56:27 UTC) #8
Primiano Tucci (use gerrit)
On 2016/07/29 10:56:27, Primiano Tucci wrote: > ok this might take a bit to digest, ...
4 years, 4 months ago (2016-08-04 15:42:54 UTC) #11
alph
https://codereview.chromium.org/2196663002/diff/20001/components/tracing/core/trace_buffer_writer.cc File components/tracing/core/trace_buffer_writer.cc (right): https://codereview.chromium.org/2196663002/diff/20001/components/tracing/core/trace_buffer_writer.cc#newcode82 components/tracing/core/trace_buffer_writer.cc:82: WriteEventPrambleForNewChunk( Preamble https://codereview.chromium.org/2196663002/diff/20001/components/tracing/core/trace_buffer_writer.cc#newcode119 components/tracing/core/trace_buffer_writer.cc:119: // Backfill the size field ...
4 years, 4 months ago (2016-08-04 19:06:52 UTC) #12
Primiano Tucci (use gerrit)
Thanks for the suggestion, simplified a bit the code. I am not 100% happy about ...
4 years, 4 months ago (2016-08-05 11:23:38 UTC) #15
oystein (OOO til 10th of July)
Awesome, and sorry for the delay :). lgtm w/ super minor comments only. https://codereview.chromium.org/2196663002/diff/60001/components/tracing/core/trace_buffer_writer.cc File ...
4 years, 4 months ago (2016-08-05 23:04:36 UTC) #22
Primiano Tucci (use gerrit)
https://codereview.chromium.org/2196663002/diff/60001/components/tracing/core/trace_buffer_writer.cc File components/tracing/core/trace_buffer_writer.cc (right): https://codereview.chromium.org/2196663002/diff/60001/components/tracing/core/trace_buffer_writer.cc#newcode77 components/tracing/core/trace_buffer_writer.cc:77: if (stream_writer_.bytes_available() < 16) On 2016/08/05 23:04:35, oystein wrote: ...
4 years, 4 months ago (2016-08-08 19:36:23 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2196663002/80001
4 years, 4 months ago (2016-08-08 19:37:23 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/108614) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, ...
4 years, 4 months ago (2016-08-08 19:46:21 UTC) #28
alph
Thanks. lgtm. Btw gyp support has been dropped. So you don't need to update gyp ...
4 years, 4 months ago (2016-08-08 21:47:53 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2196663002/100001
4 years, 4 months ago (2016-08-09 13:45:01 UTC) #32
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 4 months ago (2016-08-09 14:45:42 UTC) #33
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/9cc78e4aea540c6eba8655d8557b068bde423152 Cr-Commit-Position: refs/heads/master@{#410669}
4 years, 4 months ago (2016-08-09 14:48:29 UTC) #35
huangs
Looks like the following tests are failing in "Win7 Tests (dbg)(1)": TraceBufferWriterTest.ManyWriters TraceBufferWriterTest.ManySmallEvents TraceBufferWriterTest.OneWriterWithFragmentingEvents TraceBufferWriterTest.SingleEvent ...
4 years, 4 months ago (2016-08-09 18:09:21 UTC) #37
huangs
4 years, 4 months ago (2016-08-09 18:11:49 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.chromium.org/2228593004/ by huangs@chromium.org.

The reason for reverting is: Looks like the following tests are failing in "Win7
Tests (dbg)(1)":

TraceBufferWriterTest.ManyWriters
TraceBufferWriterTest.ManySmallEvents
TraceBufferWriterTest.OneWriterWithFragmentingEvents
TraceBufferWriterTest.SingleEven
.

Powered by Google App Engine
This is Rietveld 408576698