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

Issue 11366109: Adding raw tracing to trace framework. (Closed)

Created:
8 years, 1 month ago by dsinclair
Modified:
7 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, jar (doing other things)
Visibility:
Public.

Description

Adding raw tracing to trace framework. With some types of tracing you do not want to use the system time as the recorded event time. In those cases, we want to provide a timestamp that will be used to display the event. In a similar vein, the thread which is outputting the event may not be the thread where the event happened so we also allow an explicit thread_id to be provided. BUG=111509 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=182768

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add unit tests for the new trace macros #

Patch Set 3 : Switch to using _COPY methods. #

Patch Set 4 : Rename from RAW to EXPLICIT; drop thread_name in favor of thread_id #

Patch Set 5 : Rebased onto master. #

Patch Set 6 : Set the thread_name now that we're providing the id in the _explicit calls #

Patch Set 7 : Use ASYNC event type; drop thread_id as it isn't needed anymore #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 4

Patch Set 10 : #

Patch Set 11 : Use ThreadIdNameManager to retrieve correct thread names. #

Total comments: 4

Patch Set 12 : Rebasing with master #

Patch Set 13 : Fixup WebKit Glue trace event call. #

Patch Set 14 : Changing AddTraceEvent API to always accept a tid and timestamp. #

Total comments: 2

Patch Set 15 : Hide GetTimeOffset() #

Patch Set 16 : #

Patch Set 17 : Mergin header changes from master. #

Patch Set 18 : Rebased, trying to fix apply issues. #

Patch Set 19 : Fix typo. #

Total comments: 10

Patch Set 20 : #

Patch Set 21 : #

Total comments: 4

Patch Set 22 : #

Patch Set 23 : style fixes. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+295 lines, -78 lines) Patch
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 19 1 chunk +16 lines, -0 lines 1 comment Download
M base/debug/trace_event_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +20 lines, -8 lines 0 comments Download
M base/debug/trace_event_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +33 lines, -12 lines 0 comments Download
M base/debug/trace_event_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 7 chunks +131 lines, -32 lines 0 comments Download
M base/debug/trace_event_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 9 chunks +95 lines, -26 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
dsinclair
I've added the unit tests for the new macros. As to the thread_name. I've left ...
8 years, 1 month ago (2012-11-06 16:25:46 UTC) #1
nduca
+jbates, I'd like his feedback before I review this. My general guidance is to be ...
8 years, 1 month ago (2012-11-07 02:45:08 UTC) #2
dsinclair
On 2012/11/07 02:45:08, nduca wrote: > +jbates, I'd like his feedback before I review this. ...
8 years, 1 month ago (2012-11-07 16:16:55 UTC) #3
nduca
> Is it possible for us to query the trace framework to determine when tracing ...
8 years, 1 month ago (2012-11-07 18:32:16 UTC) #4
dsinclair
On 2012/11/07 18:32:16, nduca wrote: > > Is it possible for us to query the ...
8 years, 1 month ago (2012-11-07 21:36:44 UTC) #5
nduca
> I can dig into atrace to see if there is a way to provide ...
8 years, 1 month ago (2012-11-07 23:14:02 UTC) #6
dsinclair
On 2012/11/07 23:14:02, nduca wrote: > > I can dig into atrace to see if ...
8 years, 1 month ago (2012-11-08 14:34:29 UTC) #7
nduca
We support both on android
8 years, 1 month ago (2012-11-08 18:34:51 UTC) #8
dsinclair
On 2012/11/07 23:14:02, nduca wrote: > Yeah, if you could, that'd be good. Effectively, all ...
8 years, 1 month ago (2012-11-21 14:52:14 UTC) #9
nduca
I think we should take some time to parse @jgennis' ideas and comments around tiling ...
8 years, 1 month ago (2012-11-21 18:20:11 UTC) #10
dsinclair
On 2012/11/21 18:20:11, nduca wrote: > I think we should take some time to parse ...
8 years, 1 month ago (2012-11-22 18:13:32 UTC) #11
dsinclair
PTAL. A few changes, dropped the thread_id as we're outputting from our own thread now ...
8 years ago (2012-11-30 20:48:54 UTC) #12
nduca
https://codereview.chromium.org/11366109/diff/24002/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/24002/base/debug/trace_event.h#newcode270 base/debug/trace_event.h:270: #define TRACE_EVENT_COPY_BEGIN_EXPLICIT0(category, name, id, at) \ at->ts? we're not ...
8 years ago (2012-12-04 05:09:38 UTC) #13
nduca
and, at -> ts
8 years ago (2012-12-04 05:10:02 UTC) #14
dsinclair
https://codereview.chromium.org/11366109/diff/24002/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/24002/base/debug/trace_event.h#newcode270 base/debug/trace_event.h:270: #define TRACE_EVENT_COPY_BEGIN_EXPLICIT0(category, name, id, at) \ On 2012/12/04 05:09:38, ...
8 years ago (2012-12-04 15:02:38 UTC) #15
nduca
Ok, I get it now. Posting tasks to a thread seems a bit performance-meh. Do ...
8 years ago (2012-12-04 17:00:42 UTC) #16
nduca
(Sorry to be churning you --- you're doing a great job, whereas I'm doing a ...
8 years ago (2012-12-04 17:01:28 UTC) #17
dsinclair
On 2012/12/04 17:00:42, nduca wrote: > Ok, I get it now. > > Posting tasks ...
8 years ago (2012-12-04 18:35:52 UTC) #18
dsinclair
Also, the GPU code that is using this API is only outputting when GPU tracing ...
8 years ago (2012-12-04 18:42:22 UTC) #19
nduca
> How do I, given a thread_id, get the thread_name in the tracing framework? Why ...
8 years ago (2012-12-04 20:40:33 UTC) #20
dsinclair
On 2012/12/04 20:40:33, nduca wrote: > > How do I, given a thread_id, get the ...
8 years ago (2012-12-04 20:47:55 UTC) #21
nduca
base::Thread thread("gpu hardware") names the thread automatically. Look at thread.cc --- thats supposed to somehow ...
8 years ago (2012-12-04 20:51:11 UTC) #22
dsinclair
On 2012/12/04 20:51:11, nduca wrote: > base::Thread thread("gpu hardware") names the thread automatically. Look at ...
8 years ago (2012-12-04 20:58:58 UTC) #23
nduca
Then modify platform thread for get_name_for_tid maybe.
8 years ago (2012-12-04 21:33:56 UTC) #24
dsinclair
On 2012/12/04 21:33:56, nduca wrote: > Then modify platform thread for get_name_for_tid maybe. Since we'll ...
8 years ago (2012-12-05 01:47:50 UTC) #25
nduca
Its the wrong architecture, thats all. You give threads names. trace_event picks those names up. ...
8 years ago (2012-12-05 02:56:46 UTC) #26
jar (doing other things)
Drive by question (since I was reviewing an underlying CL) https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event_impl.h#newcode288 ...
8 years ago (2012-12-06 17:28:59 UTC) #27
dsinclair
https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event_impl.h#newcode288 base/debug/trace_event_impl.h:288: unsigned long long id, On 2012/12/06 17:28:59, jar wrote: ...
8 years ago (2012-12-06 17:38:52 UTC) #28
nduca
_WITH_EXPLICIT_xxx_and_YY --- explicit is too narrow. We're providing timestamp and tid explicitly right/
8 years ago (2012-12-11 19:37:06 UTC) #29
nduca
https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/30001/base/debug/trace_event.h#newcode642 base/debug/trace_event.h:642: #define TRACE_EVENT_API_ADD_TRACE_EVENT_EXPLICIT \ How about always providing the tid? ...
8 years ago (2012-12-11 19:40:57 UTC) #30
dsinclair
I dropped the EXPLICIT as the name was getting pretty long and it seemed redundant. ...
8 years ago (2012-12-14 16:08:20 UTC) #31
nduca
Really close. https://codereview.chromium.org/11366109/diff/45001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/45001/base/debug/trace_event.h#newcode911 base/debug/trace_event.h:911: base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() - Can we ...
8 years ago (2012-12-20 20:19:27 UTC) #32
dsinclair
https://codereview.chromium.org/11366109/diff/45001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/45001/base/debug/trace_event.h#newcode911 base/debug/trace_event.h:911: base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() - On 2012/12/20 20:19:27, nduca ...
7 years, 10 months ago (2013-01-28 16:45:06 UTC) #33
nduca
lgtm well done.
7 years, 10 months ago (2013-02-01 23:55:20 UTC) #34
dsinclair
jar@, can you please take a look for base/ OWNERS? Thanks, dan
7 years, 10 months ago (2013-02-13 21:11:06 UTC) #35
jar (doing other things)
https://codereview.chromium.org/11366109/diff/79001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/79001/base/debug/trace_event.h#newcode40 base/debug/trace_event.h:40: // int64 timestamp, nit: This arg list as waaaay ...
7 years, 10 months ago (2013-02-14 02:17:54 UTC) #36
dsinclair
https://codereview.chromium.org/11366109/diff/79001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/11366109/diff/79001/base/debug/trace_event.h#newcode40 base/debug/trace_event.h:40: // int64 timestamp, On 2013/02/14 02:17:54, jar wrote: > ...
7 years, 10 months ago (2013-02-14 15:38:46 UTC) #37
jar (doing other things)
LGTM after nits below. https://codereview.chromium.org/11366109/diff/80006/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/11366109/diff/80006/base/debug/trace_event_impl.cc#newcode642 base/debug/trace_event_impl.cc:642: void TraceLog::AddTraceEventWithThreadIdAndTimestamp(char phase, style nit: ...
7 years, 10 months ago (2013-02-15 02:01:39 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dsinclair@chromium.org/11366109/76006
7 years, 10 months ago (2013-02-15 14:59:20 UTC) #39
dsinclair
https://codereview.chromium.org/11366109/diff/80006/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/11366109/diff/80006/base/debug/trace_event_impl.cc#newcode642 base/debug/trace_event_impl.cc:642: void TraceLog::AddTraceEventWithThreadIdAndTimestamp(char phase, On 2013/02/15 02:01:39, jar wrote: > ...
7 years, 10 months ago (2013-02-15 15:14:10 UTC) #40
commit-bot: I haz the power
Change committed as 182768
7 years, 10 months ago (2013-02-15 18:58:27 UTC) #41
elijahtaylor1
https://chromiumcodereview.appspot.com/11366109/diff/76006/base/debug/trace_event.h File base/debug/trace_event.h (right): https://chromiumcodereview.appspot.com/11366109/diff/76006/base/debug/trace_event.h#newcode6 base/debug/trace_event.h:6: // to remain platform and context neutral. To use ...
7 years, 10 months ago (2013-02-20 01:11:36 UTC) #42
nduca
I'm pretty puzzled about the whole current stage of trace event right now. I didn't ...
7 years, 10 months ago (2013-02-20 01:18:15 UTC) #43
elijahtaylor1
7 years, 10 months ago (2013-02-20 01:30:47 UTC) #44
Message was sent while issue was closed.
On 2013/02/20 01:18:15, nduca wrote:
> I'm pretty puzzled about the whole current stage of trace event right now. I
> didn't see the change go by earlier, and so I dont get what you're trying to
do.
> The original intent was that people that dont use base, like webkit, would
> **copy** trace_event.h, then implement the TRACE_EVENT_API* calls their own
way
> so that it routed into real tracing eventually. I dont understand why that
> wasn't done in the last place, and i'm pretty confused.

I see.  Well, it looks like I did something not in keeping with tradition.  I
was trying to factor things out to make it easier for consumers of the trace
event API to do their own implementation of the API functions while being able
to use the stock trace_event_internal.h file.

I guess that might not have been the right way to go about it.  I still think
the division is good, and it's being moved into its own
trace_event_api_definitions.h file in a different CL by someone else.

Powered by Google App Engine
This is Rietveld 408576698