Event Tracing – Painful but worth it
Why bother with something painful? What is event tracing and why is it worth my time to work with it?
Trace events describe the current state of an application or operation for the purpose of debugging or performance tuning.
Some Good Reasons to use Event Tracing (according to world class developer Matt Pietrek)
Here are some really good reasons:
|
Developer Audience
ETW is designed for C and C++ developers who write user-mode applications.
Run-Time Requirements
ETW is included in Microsoft Windows 2000 and later.
Intro to Event Tracing For Windowshttps://blogs.msdn.com/matt_pietrek/archive/2004/09/16/230700.aspxImprove Debugging And Performance Tuning With ETW (April 2007)https://msdn.microsoft.com/en-us/magazine/cc163437.aspxJIT ETW tracing in .NET Framework 4https://blogs.msdn.com/clrcodegeneration/archive/2009/05/11/jit-etw-tracing-in-net-framework-4.aspx |
CLR 4.0 & ETW
Prior to CLR 4.0 developers have no way of knowing why the runtime decided to disallow inlining or tail calls. Event tracing may provide the vehicle to inspect more closely what the CLR is doing. There are a couple of new events exposed by the JIT to enable performance junkies to hurt themselves To start logging ETW events do this: logman start clrevents –p {e13c0d23-ccbc-4e12-931b-d9cc2eee27e4} 0x1000 5 –ets If you want more information on logman, go here https://technet.microsoft.com/en-us/library/bb490956.aspx. After you’ve started ETW, run your scenario, and then stop ETW as follows: logman stop clrevents –ets This will create clrevents.etl. To decode it further run this: tracerpt clrevents.etl This will create 2 files: dumpfile.xml and summary.txt. Here is a sample MethodJitInliningSucceeded event:
|