The TraceEvent Library Programmers
Guide
Vance Morrison
Contents
Introduction: Strongly Typed (Semantic) Logging ........................................................................................3
Basic Logging Architecture ...........................................................................................................................3
Multi-player ..............................................................................................................................................4
Asynchronous ...........................................................................................................................................5
Quick Start Example .....................................................................................................................................5
Component 1: the Event Provider (EventSource).....................................................................................5
Component 2: The Event Session (TraceEventSession) ............................................................................7
Component 3: The Event Processor (ETWTraceEventSource)..................................................................8
Event Parsing ‘Magic’ (TraceEventParsers) ..................................................................................................9
Static vs. Dynamic TraceEventParsers ....................................................................................................12
Event Provider Discovery............................................................................................................................12
Publication vs. Registration ....................................................................................................................13
Review of the Fundamental TraceEvent Architecture................................................................................14
What You Can Do With the TraceEvent Library..........................................................................................14
ETW Limitations..........................................................................................................................................16
Next Step: Code Samples............................................................................................................................17
Diagnostic Techniques: Using PerfView......................................................................................................17
Full dumps of ETW events in PerfVIew...................................................................................................17
PerfView’s /KeepAllEvents feature.........................................................................................................18
Debugging EventSource Authoring.........................................................................................................18
IObservable support in TraceEvent ............................................................................................................18
Building Compile-time TraceEventParsers using TraceParserGen..............................................................18
Using Call Stacks with the TraceEvent library.............................................................................................19
How to capture ETW Stacks....................................................................................................................19
Limitations of ETW Stack Capture ..........................................................................................................19
Architecture............................................................................................................................................19
评论0