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

Issue 23934003: Have all trace points emit to ETW. (Closed)

Created:
7 years, 3 months ago by fdoray
Modified:
4 years, 1 month ago
CC:
chromium-reviews, dsinclair+watch_chromium.org, erikwright+watch_chromium.org, etienneb
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Have all trace points emit to ETW. Have all activated trace points emit to ETW when a trace session is listening for events from Chrome. As explained at crbug.com/81584, when no trace session is active, the cost of this instrumentation is to check a simple condition. For now, trace point categories must be activated via chrome://tracing. In a forthcoming CL, it will be possible to enable categories with a command line flag. Categories enabled with this command line flag will emit to ETW but not to the Chrome tracing system. TEST= 1. Execute these commands: logman create trace log -mode globalsequence -o log.etl logman update trace log -p {3DADA31D-19EF-4dc1-B345-037927193422} 0xffffffff 4 logman start log 2. Launch Chrome. 3. Go to chrome://tracing. 4. Click "Record". 5. Enable a few categories and click "Record". 6. Quit Chrome. 7. Execute this command: logman stop log Expected result: A file named "log.etl" has been created. It contains recorded events. BUG=81584 R=chrisha

Patch Set 1 #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : Add "extras" string. #

Patch Set 4 : Convert event types to begin/end/instant #

Patch Set 5 : Rename EXT -> OLD #

Patch Set 6 : Output categories #

Patch Set 7 : Reupload #

Patch Set 8 : Reupload #

Patch Set 9 : Rebase #

Total comments: 7

Patch Set 10 : Address Chris' comments, improved trace format #

Patch Set 11 : Rebase #

Patch Set 12 : Nits #

Total comments: 13

Patch Set 13 : Address Chris' comments #

Patch Set 14 : Address Chris' comments #

Total comments: 21

Patch Set 15 : Address Siggi's comments #

Total comments: 1

Patch Set 16 : Nits #

Total comments: 5

Patch Set 17 : Address Etienne's comments #

Patch Set 18 : Add missing condition. #

Patch Set 19 : Rebase. #

Patch Set 20 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+316 lines, -28 lines) Patch
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 1 chunk +6 lines, -0 lines 0 comments Download
M base/debug/trace_event_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +66 lines, -24 lines 0 comments Download
M base/debug/trace_event_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +232 lines, -4 lines 0 comments Download
M base/win/event_trace_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
fdoray
7 years, 3 months ago (2013-09-04 03:36:09 UTC) #1
chrisha
Some comments. https://codereview.chromium.org/23934003/diff/3001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/23934003/diff/3001/base/debug/trace_event_impl.cc#newcode1205 base/debug/trace_event_impl.cc:1205: TraceEventETWProvider::Trace(name, phase, id, NULL); Remove extra space. ...
7 years, 3 months ago (2013-09-04 13:32:09 UTC) #2
fdoray
Chris, could you review the CL again? Thanks. https://codereview.chromium.org/23934003/diff/3001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): https://codereview.chromium.org/23934003/diff/3001/base/debug/trace_event_impl.cc#newcode1205 base/debug/trace_event_impl.cc:1205: TraceEventETWProvider::Trace(name, ...
7 years, 3 months ago (2013-09-05 20:10:31 UTC) #3
chrisha
Some more comments. https://codereview.chromium.org/23934003/diff/27001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/23934003/diff/27001/base/debug/trace_event.h#newcode913 base/debug/trace_event.h:913: #define TRACE_EVENT_PHASE_INSTANT_OLD ('I') // Used by ...
7 years, 3 months ago (2013-09-05 20:21:30 UTC) #4
fdoray
Chris, could you look at the CL again? Thanks. https://codereview.chromium.org/23934003/diff/27001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/23934003/diff/27001/base/debug/trace_event.h#newcode913 base/debug/trace_event.h:913: ...
7 years, 3 months ago (2013-09-08 18:35:49 UTC) #5
chrisha
This looks better than all of the string encoding logic used previously. A few more ...
7 years, 3 months ago (2013-09-09 16:41:12 UTC) #6
fdoray
Chris, could you review the CL again? Thanks. https://codereview.chromium.org/23934003/diff/40001/base/debug/trace_event_win.cc File base/debug/trace_event_win.cc (right): https://codereview.chromium.org/23934003/diff/40001/base/debug/trace_event_win.cc#newcode29 base/debug/trace_event_win.cc:29: const ...
7 years, 3 months ago (2013-09-09 19:38:59 UTC) #7
dsinclair
https://codereview.chromium.org/23934003/diff/51001/base/debug/trace_event.h File base/debug/trace_event.h (right): https://codereview.chromium.org/23934003/diff/51001/base/debug/trace_event.h#newcode913 base/debug/trace_event.h:913: #define TRACE_EVENT_PHASE_INSTANT_OLD ('I') // Used by third party libraries. ...
7 years, 3 months ago (2013-09-09 19:57:46 UTC) #8
chrisha
+siggi, who knows about all things ETW Care to take a look? Maybe you can ...
7 years, 3 months ago (2013-09-10 17:53:47 UTC) #9
Sigurður Ásgeirsson
Nice. I think ETW should have runtime control of what's traced without requiring command line ...
7 years, 3 months ago (2013-09-10 21:15:53 UTC) #10
fdoray
Siggi: could you take another look at this CL? I agree with you that it ...
7 years, 3 months ago (2013-09-16 00:51:02 UTC) #11
fdoray
Siggi: could you take another look at this CL? I agree with you that it ...
7 years, 3 months ago (2013-09-16 00:59:08 UTC) #12
Sigurður Ásgeirsson
On Sun, Sep 15, 2013 at 8:51 PM, <fdoray@chromium.org> wrote: > Siggi: could you take ...
7 years, 3 months ago (2013-09-20 17:40:01 UTC) #13
etienneb
drive-by. https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_win.cc File base/debug/trace_event_win.cc (right): https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_win.cc#newcode208 base/debug/trace_event_win.cc:208: void* backtrace[32]; This declaration could be move in ...
7 years, 3 months ago (2013-09-23 06:46:11 UTC) #14
fdoray
7 years, 2 months ago (2013-10-12 22:14:50 UTC) #15
https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_wi...
File base/debug/trace_event_win.cc (right):

https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_wi...
base/debug/trace_event_win.cc:208: void* backtrace[32];
No, the array must still exist when the event is logged (line 222).

On 2013/09/23 06:46:12, etienneb wrote:
> This declaration could be move in the scope below.

https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_win.h
File base/debug/trace_event_win.h (right):

https://codereview.chromium.org/23934003/diff/70001/base/debug/trace_event_wi...
base/debug/trace_event_win.h:146: BASE_EXPORT extern const GUID
kTraceEventClass[];
On 2013/09/23 06:46:12, etienneb wrote:
> I think you could use one GUID for the provider, and use multiple 'EventType'
in
> the Mof file (see 'Event type MOF class qualifiers' in your link).
> 
> On 2013/09/16 00:59:08, fdoray wrote:
> > Having multiple GUIDs makes it easy to parse the trace file using a schema
> >
>
(https://docs.google.com/file/d/0B3wWyRavE9yeVEcyV1B2SUpJT1k/edit?usp=sharing).
> > I've not been able to achieve the same result by including the "num_args" in
> the
> > trace. I would need to find a way to create an array of (label+value) -> not
> an
> > array of labels followed by an array of values. Defining a new class and
using
> > it as a type for the array didn't work. See documentation
> > http://msdn.microsoft.com/en-us/library/aa364100%2528v=vs.85%2529.aspx
> 

Done.

Powered by Google App Engine
This is Rietveld 408576698