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 2308583003: tracing v2: Introduce TraceBufferReader to read-back the trace buffer (Closed)

Created:
4 years, 3 months ago by Primiano Tucci (use gerrit)
Modified:
3 years, 7 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, alph
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

tracing v2: Introduce TraceBufferReader to read-back the trace buffer This CL introduces the core building blocks to read-back the proto-encoded trace buffer. This will serve two purposes: 1. Build the table of interned strings. We use interned strings (see event.proto) to avoid doing full string copies for each event when those strings are long lived. The interned string table will be attached at trace finalization time via metadata events by upcoming CLs. 2. Build the base::Value(s) that can be converted to JSON which matches the current trace event format. This is to support JSON output in the interim stage of Tracing V2 (protobuf inside, JSON outside). BUG=643674

Patch Set 1 #

Patch Set 2 : some fixes + moar tests #

Total comments: 29

Patch Set 3 : oysteine + kraynov review #

Patch Set 4 : DISALLOW_COPY_AND_ASSIGN + cctype for isalnum #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+611 lines, -0 lines) Patch
M components/tracing/BUILD.gn View 1 2 chunks +5 lines, -0 lines 0 comments Download
M components/tracing/core/proto_utils.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A components/tracing/core/string_interning.h View 1 2 1 chunk +55 lines, -0 lines 2 comments Download
A components/tracing/core/string_interning.cc View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
A components/tracing/core/trace_buffer_reader.h View 1 2 3 1 chunk +81 lines, -0 lines 0 comments Download
A components/tracing/core/trace_buffer_reader.cc View 1 2 3 1 chunk +223 lines, -0 lines 1 comment Download
A components/tracing/core/trace_buffer_reader_unittest.cc View 1 1 chunk +227 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 28 (17 generated)
Primiano Tucci (use gerrit)
Ok that's all for this week :P
4 years, 3 months ago (2016-09-02 15:19:23 UTC) #4
Primiano Tucci (use gerrit)
PING
4 years, 3 months ago (2016-09-08 15:34:26 UTC) #11
Primiano Tucci (use gerrit)
On 2016/09/08 15:34:26, Primiano Tucci wrote: > PING (the red bots are due to some ...
4 years, 3 months ago (2016-09-08 15:36:37 UTC) #12
kraynov
https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc File components/tracing/core/string_interning.cc (right): https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc#newcode15 components/tracing/core/string_interning.cc:15: // on OSX. Yep, maybe dynamic linker has some ...
4 years, 3 months ago (2016-09-08 16:10:01 UTC) #13
oystein (OOO til 10th of July)
https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc File components/tracing/core/string_interning.cc (right): https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc#newcode16 components/tracing/core/string_interning.cc:16: const char kInternedStringBase[] = "Chrome Tracing v2"; supernit: just ...
4 years, 3 months ago (2016-09-09 00:27:35 UTC) #14
Primiano Tucci (use gerrit)
Thanks y all. replies below https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc File components/tracing/core/string_interning.cc (right): https://codereview.chromium.org/2308583003/diff/20001/components/tracing/core/string_interning.cc#newcode15 components/tracing/core/string_interning.cc:15: // on OSX. On ...
4 years, 3 months ago (2016-09-13 14:40:25 UTC) #16
kraynov
Thanks, lgtm
4 years, 3 months ago (2016-09-13 15:28:39 UTC) #20
oystein (OOO til 10th of July)
lgtm, nice!
4 years, 3 months ago (2016-09-13 20:16:18 UTC) #21
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/2308583003/60001
4 years, 3 months ago (2016-09-15 11:48:19 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/298285)
4 years, 3 months ago (2016-09-15 11:59:59 UTC) #26
DmitrySkiba
4 years ago (2016-11-29 18:09:57 UTC) #28
https://codereview.chromium.org/2308583003/diff/60001/components/tracing/core...
File components/tracing/core/string_interning.h (right):

https://codereview.chromium.org/2308583003/diff/60001/components/tracing/core...
components/tracing/core/string_interning.h:30: //    non-component builds. In a
monolithic build the string offset is constatnt
constatnt -> constant

https://codereview.chromium.org/2308583003/diff/60001/components/tracing/core...
components/tracing/core/string_interning.h:38: inline int64_t InternString(const
char* str) {
Maybe rename "intern" to "index" or "stable offset", or something? In my head
"interning" means this:
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#intern%28%29

I.e. there is a pool of strings, and "interning" means that we take arbitrary
string and return either its counterpart from the pool, or add the string to the
pool (and return it).

https://codereview.chromium.org/2308583003/diff/60001/components/tracing/core...
File components/tracing/core/trace_buffer_reader.cc (right):

https://codereview.chromium.org/2308583003/diff/60001/components/tracing/core...
components/tracing/core/trace_buffer_reader.cc:172: interned_strings_[str_id] =
interned_string;
Hmm, str_id is int64_t here, but interned_strings_ is keyed by int32_t.

Powered by Google App Engine
This is Rietveld 408576698