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

Issue 7981004: add classes trace_analyzer::Query and TraceAnalyzer to make it easy to search through trace data (Closed)

Created:
9 years, 3 months ago by jbates
Modified:
9 years, 1 month ago
CC:
chromium-reviews, joth, Vangelis Kokkevis
Visibility:
Public.

Description

add classes trace_analyzer::Query and TraceAnalyzer to make it easy to search through trace data. This also adds a trace_analyzer::TraceEvent class that can be constructed from JSON data (via base::Value). TraceEvent mirrors base::debug::TraceEvent in a form that is lower performance and easier to use in test code. BUG=95714 TEST=base_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107813

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : test/compile #

Patch Set 4 : comments, style, arithmetic operators #

Patch Set 5 : generalized begin/end match finding #

Patch Set 6 : more comments #

Total comments: 2

Patch Set 7 : moved TestTraceEvent #

Total comments: 38

Patch Set 8 : . #

Total comments: 9

Patch Set 9 : cleanup #

Total comments: 12

Patch Set 10 : . #

Total comments: 20

Patch Set 11 : . #

Patch Set 12 : . #

Total comments: 14

Patch Set 13 : . #

Patch Set 14 : base export on TraceEvent #

Patch Set 15 : includes #

Patch Set 16 : TraceResultBuffer merge #

Patch Set 17 : reduced constructor overloading #

Total comments: 3

Patch Set 18 : comments updated #

Total comments: 32

Patch Set 19 : cleanup #

Patch Set 20 : dcheck #

Patch Set 21 : cleaned up tests #

Patch Set 22 : pid tid name fixed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1693 lines, -20 lines) Patch
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -0 lines 0 comments Download
M base/debug/trace_event.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +10 lines, -2 lines 0 comments Download
M base/debug/trace_event.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +33 lines, -18 lines 0 comments Download
A base/test/trace_event_analyzer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +448 lines, -0 lines 0 comments Download
A base/test/trace_event_analyzer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +697 lines, -0 lines 0 comments Download
A base/test/trace_event_analyzer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +502 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (0 generated)
jbates
Split 1/3 from http://codereview.chromium.org/7866026/
9 years, 3 months ago (2011-09-20 17:40:15 UTC) #1
jbates
On 2011/09/20 17:40:15, jbates wrote: > Split 1/3 from http://codereview.chromium.org/7866026/ A few updates in the ...
9 years, 3 months ago (2011-09-21 19:22:25 UTC) #2
jbates
PTAL
9 years, 2 months ago (2011-09-29 22:47:45 UTC) #3
scheib
I've skimmed over, looks great! This will be a nice and expressive way to specify ...
9 years, 2 months ago (2011-09-29 23:33:56 UTC) #4
jbates
Thanks! I can't wait to write some tests with it... http://codereview.chromium.org/7981004/diff/1009/base/debug/trace_event.h File base/debug/trace_event.h (right): http://codereview.chromium.org/7981004/diff/1009/base/debug/trace_event.h#newcode462 ...
9 years, 2 months ago (2011-09-30 21:07:37 UTC) #5
jbates
On 2011/09/30 21:07:37, jbates wrote: > Thanks! I can't wait to write some tests with ...
9 years, 2 months ago (2011-10-05 17:13:23 UTC) #6
scheib
:| I'm in a rush for M16, and would need to hold off till at ...
9 years, 2 months ago (2011-10-05 17:18:47 UTC) #7
nduca
I like the query approach, but am bothered by the hard edges around relationships, repeated ...
9 years, 2 months ago (2011-10-11 20:33:37 UTC) #8
jbates
Thanks for the detailed and thorough feedback, Nat. I've updated the documentation and code. I ...
9 years, 2 months ago (2011-10-12 22:35:19 UTC) #9
nduca
Going through the discussion stuff here, then will go back and review code. API-wise, I ...
9 years, 2 months ago (2011-10-13 01:00:27 UTC) #10
nduca
http://codereview.chromium.org/7981004/diff/25001/base/debug/trace_event_analyzer.h File base/debug/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/25001/base/debug/trace_event_analyzer.h#newcode9 base/debug/trace_event_analyzer.h:9: // - Get trace events JSON string from base::debug::TraceLog. ...
9 years, 2 months ago (2011-10-13 01:23:58 UTC) #11
jbates
On 2011/10/13 01:00:27, nduca wrote: > Going through the discussion stuff here, then will go ...
9 years, 2 months ago (2011-10-13 03:05:50 UTC) #12
jbates
> http://codereview.chromium.org/7981004/diff/10001/base/debug/trace_event_test_utils.h#newcode77 > > base/debug/trace_event_test_utils.h:77: static bool ParseEventsFromJson(const > > std::string& json, > > On ...
9 years, 2 months ago (2011-10-13 03:36:15 UTC) #13
jbates
On 2011/10/13 01:23:58, nduca wrote: > http://codereview.chromium.org/7981004/diff/25001/base/debug/trace_event_analyzer.h > File base/debug/trace_event_analyzer.h (right): > > http://codereview.chromium.org/7981004/diff/25001/base/debug/trace_event_analyzer.h#newcode9 > ...
9 years, 2 months ago (2011-10-13 04:02:51 UTC) #14
jbates
Pawel: PTAL.
9 years, 2 months ago (2011-10-13 04:17:23 UTC) #15
Paweł Hajdan Jr.
http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc File chrome/test/base/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc#newcode8 chrome/test/base/trace_event_analyzer.cc:8: #include "chrome/test/base/trace_event_analyzer.h" Why is this in chrome and not ...
9 years, 2 months ago (2011-10-13 19:50:42 UTC) #16
jbates
http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc File chrome/test/base/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc#newcode8 chrome/test/base/trace_event_analyzer.cc:8: #include "chrome/test/base/trace_event_analyzer.h" On 2011/10/13 19:50:43, Paweł Hajdan Jr. wrote: ...
9 years, 2 months ago (2011-10-13 19:56:01 UTC) #17
nduca
jbates: I'll do a nitpick pass tonight, but my grumpiness is replaced by that nice ...
9 years, 2 months ago (2011-10-13 21:59:36 UTC) #18
Peter Kasting
jbates asked me about operator overloading and my take was that it is (unfortunately) banned ...
9 years, 2 months ago (2011-10-13 22:10:32 UTC) #19
jbates
http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc File chrome/test/base/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/32002/chrome/test/base/trace_event_analyzer.cc#newcode8 chrome/test/base/trace_event_analyzer.cc:8: #include "chrome/test/base/trace_event_analyzer.h" On 2011/10/13 19:56:01, jbates wrote: > On ...
9 years, 2 months ago (2011-10-14 03:41:20 UTC) #20
jbates
On 2011/10/13 22:10:32, Peter Kasting wrote: > If you guys want to try and make ...
9 years, 2 months ago (2011-10-14 17:30:21 UTC) #21
Zhenyao Mo
Any updates on this CL? I have a few tests pending this CL.
9 years, 2 months ago (2011-10-14 17:34:23 UTC) #22
nduca
http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.cc File base/test/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.cc#newcode30 base/test/trace_event_analyzer.cc:30: return; Error handling. http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.cc#newcode43 base/test/trace_event_analyzer.cc:43: dictionary->GetDictionary("args", &args)) { I'm ...
9 years, 2 months ago (2011-10-14 23:14:15 UTC) #23
nduca
Recapping our verbal discussion, I think the core issue here is that this API lets ...
9 years, 2 months ago (2011-10-15 00:04:10 UTC) #24
jbates
On 2011/10/15 00:04:10, nduca wrote: > Recapping our verbal discussion, I think the core issue ...
9 years, 2 months ago (2011-10-15 00:34:04 UTC) #25
nduca
LGTM with nits. OWNERS, get your review on.
9 years, 2 months ago (2011-10-17 18:07:20 UTC) #26
Paweł Hajdan Jr.
http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.h File base/test/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.h#newcode241 base/test/trace_event_analyzer.h:241: Query operator==(const Query& rhs) const; I think you get ...
9 years, 2 months ago (2011-10-18 10:07:15 UTC) #27
Paweł Hajdan Jr.
http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.h File base/test/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.h#newcode190 base/test/trace_event_analyzer.h:190: Query(double num); Having an override for both double and ...
9 years, 2 months ago (2011-10-18 10:10:49 UTC) #28
jbates
http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.cc File base/test/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/35002/base/test/trace_event_analyzer.cc#newcode30 base/test/trace_event_analyzer.cc:30: return; On 2011/10/14 23:14:16, nduca wrote: > Error handling. ...
9 years, 2 months ago (2011-10-18 18:14:21 UTC) #29
Paweł Hajdan Jr.
http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.cc File base/test/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.cc#newcode62 base/test/trace_event_analyzer.cc:62: arg_numbers[*keyi] = double_num; nit: else NOTREACHED. http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.cc#newcode157 base/test/trace_event_analyzer.cc:157: *this ...
9 years, 2 months ago (2011-10-19 08:59:23 UTC) #30
jbates
http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.cc File base/test/trace_event_analyzer.cc (right): http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.cc#newcode62 base/test/trace_event_analyzer.cc:62: arg_numbers[*keyi] = double_num; On 2011/10/19 08:59:23, Paweł Hajdan Jr. ...
9 years, 2 months ago (2011-10-19 19:35:54 UTC) #31
jbates
Pawel: PTAL
9 years, 2 months ago (2011-10-20 22:59:18 UTC) #32
Paweł Hajdan Jr.
Sorry to drag the review further on, but... have you sent a design doc for ...
9 years, 2 months ago (2011-10-21 08:31:46 UTC) #33
jbates
There was no design doc, I'm afraid. I had a direct need for these features ...
9 years, 2 months ago (2011-10-21 17:54:44 UTC) #34
Paweł Hajdan Jr.
http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.h File base/test/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.h#newcode196 base/test/trace_event_analyzer.h:196: Query(const char* str); On 2011/10/21 17:54:44, jbates wrote: > ...
9 years, 2 months ago (2011-10-24 07:19:28 UTC) #35
jbates
On 2011/10/24 07:19:28, Paweł Hajdan Jr. wrote: > http://codereview.chromium.org/7981004/diff/52001/base/test/trace_event_analyzer.h > File base/test/trace_event_analyzer.h (right): > > ...
9 years, 2 months ago (2011-10-24 23:48:16 UTC) #36
Paweł Hajdan Jr.
On 2011/10/24 23:48:16, jbates wrote: > Please give an example of how this might be ...
9 years, 2 months ago (2011-10-25 08:58:38 UTC) #37
nduca
On 2011/10/25 08:58:38, Paweł Hajdan Jr. wrote: > brett's review has a disclaimer that he ...
9 years, 2 months ago (2011-10-25 09:37:35 UTC) #38
jbates
On 2011/10/25 08:58:38, Paweł Hajdan Jr. wrote: > On 2011/10/24 23:48:16, jbates wrote: > > ...
9 years, 2 months ago (2011-10-25 17:12:41 UTC) #39
Paweł Hajdan Jr.
On 2011/10/25 09:37:35, nduca wrote: > John has done ample due dillgence on the operator ...
9 years, 2 months ago (2011-10-25 19:03:31 UTC) #40
nduca
On 2011/10/25 19:03:31, Paweł Hajdan Jr. wrote: > There might be some other, minor comments ...
9 years, 2 months ago (2011-10-25 19:46:18 UTC) #41
jbates
Rather than drag this on, I went ahead and made the final change that Pawel ...
9 years, 2 months ago (2011-10-25 23:47:06 UTC) #42
Paweł Hajdan Jr.
LGTM with comments, thank you for the fixes. http://codereview.chromium.org/7981004/diff/73001/base/test/trace_event_analyzer.h File base/test/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/73001/base/test/trace_event_analyzer.h#newcode44 base/test/trace_event_analyzer.h:44: // ...
9 years, 2 months ago (2011-10-26 08:38:39 UTC) #43
joth
Sorry I've been very busy with other work so unable to follow this in detail. ...
9 years, 2 months ago (2011-10-26 09:04:26 UTC) #44
jbates
On 2011/10/26 09:04:26, joth wrote: > Sorry I've been very busy with other work so ...
9 years, 1 month ago (2011-10-26 16:31:31 UTC) #45
jbates
willchan: base/ owners stamp please (trace_event.h/cc, base.gyp) http://codereview.chromium.org/7981004/diff/73001/base/test/trace_event_analyzer.h File base/test/trace_event_analyzer.h (right): http://codereview.chromium.org/7981004/diff/73001/base/test/trace_event_analyzer.h#newcode44 base/test/trace_event_analyzer.h:44: // Query(EVENT_DURATION) ...
9 years, 1 month ago (2011-10-26 16:55:49 UTC) #46
willchan no longer on Chromium
Jim, I'm passing onto you since you're doing some more work in this area. Pass ...
9 years, 1 month ago (2011-10-26 17:01:33 UTC) #47
jar (doing other things)
I haven't read much of this code before... so I'm being educated. Perhaps I need ...
9 years, 1 month ago (2011-10-26 19:35:20 UTC) #48
jbates
http://codereview.chromium.org/7981004/diff/72003/base/debug/trace_event.cc File base/debug/trace_event.cc (right): http://codereview.chromium.org/7981004/diff/72003/base/debug/trace_event.cc#newcode207 base/debug/trace_event.cc:207: const char* TraceEvent::GetPhaseStr(TraceEventPhase phase) { On 2011/10/26 19:35:20, jar ...
9 years, 1 month ago (2011-10-26 21:51:54 UTC) #49
jbates
Blackjack! What do I win for 21 patches? (How about a final LGTM? :-) http://codereview.chromium.org/7981004/diff/72003/base/test/trace_event_analyzer_unittest.cc ...
9 years, 1 month ago (2011-10-27 20:36:34 UTC) #50
jar (doing other things)
Thanks for making the changes! Two comments below to consider. If you're ok with them, ...
9 years, 1 month ago (2011-10-28 20:47:53 UTC) #51
jbates
9 years, 1 month ago (2011-10-28 21:54:28 UTC) #52
http://codereview.chromium.org/7981004/diff/72003/base/test/trace_event_analy...
File base/test/trace_event_analyzer.cc (right):

http://codereview.chromium.org/7981004/diff/72003/base/test/trace_event_analy...
base/test/trace_event_analyzer.cc:188: CHECK(type_ == QUERY_BOOLEAN_OPERATOR)
On 2011/10/28 20:47:53, jar wrote:
> DCHECK is debug only (I think)
> CHECK is Release and Official (as well as DEBUG).
> 
> Do you need something different here?

Since --enable-dcheck works for Release builds, DCHECK should be OK.

> 
> On 2011/10/26 21:51:54, jbates wrote:
> > On 2011/10/26 19:35:20, jar wrote:
> > > Checks in production code like this are bad. Brett is working to trim down
> the
> > > 500K of comments currently affiliated with CHECKs.  Please use DCHECKs,
and
> > > handle the cases (rather than crashing).
> > 
> > Done. This is base/test, so shouldn't end up in prod code. My main goal is
to
> > assert here for both debug and release test builds. Since DCHECK also works
> for
> > Release, it works also.
>

http://codereview.chromium.org/7981004/diff/72003/base/test/trace_event_analy...
File base/test/trace_event_analyzer.h (right):

http://codereview.chromium.org/7981004/diff/72003/base/test/trace_event_analy...
base/test/trace_event_analyzer.h:101: struct PidTid {
On 2011/10/28 20:47:53, jar wrote:
> nit: You didn't change this.... did you feel this name was better for folks
that
> are savvy in this file?  ...or was it an oversight?

Oversight, oops! Done.

> 
> On 2011/10/26 19:35:20, jar wrote:
> > nit: Avoid Abreviations.  Suggest: 
> > ProcessIdThreadId
> > or
> > ProcessThreadIdPair
> > or
> > ProcessAndThreadId
>

Powered by Google App Engine
This is Rietveld 408576698