DevConnections 2014: IntelliTrace, Diagnostics Hub, and .NET Production Debugging

September 20, 2014

no comments

I’m flying back home from DevConnections 2014, which was great! Vegas was hot and dry as usual, but I actually managed to carve out some time in my schedule to see KA, which was really nice. (Plus, the conference was at the Aria resort, which is located smack in the middle of the strip, and is overall much nicer than Mandalay Bay where we were last year. I really liked the hotel room automation control. For example, I had an alarm clock set up to open the curtains, turn on the TV to a quiet music channel, and even dial down the temperature on the A/C.)

I had two talks and one workshop at DevConnections this year, and I’d like to share the materials with you whether or not you were able to make it.

Mastering IntelliTrace in Development and Production

In this talk (which I am going to repeat at TechEd Barcelona!) I covered the basics of using IntelliTrace from Visual Studio to go back in time while doing live debugging and when running unit tests. Then, I discussed the IntelliTrace production-time collection options, including the IntelliTrace Standalone Collector, which you can use without installing Visual Studio on the system. Lastly, I talked about collecting IntelliTrace logs from Azure Cloud Services, which is probably the most rich and flexible way to do continuous diagnostics at the source level in that cloud environment. After covering all the collection options, I also explained how to customize IntelliTrace event collection with custom diagnostic event specifications. Here’s the custom collection plan file I used.

Performance and Debugging with the Diagnostics Hub in Visual Studio 2013

In this talk I explained how to make the most of the Visual Studio Diagnostics Hub, which debuted in Visual Studio 2013. It’s your one-stop shop for performance and debugging work, and combines multiple tools including the Visual Studio Profiler, the XAML UI Responsiveness Tool, the Energy Consumption Tool, and many others. What I particularly like about the Diagnostics Hub is that you first select a target and then get a list of available tools: this is great because some tools only support a subset of .NET applications, such as Windows Phone or Windows Store apps, and some tools don’t have any restrictions. My demos covered sampling and instrumentation profiling, XAML UI responsiveness and concurrency profiling, and memory leak analysis using the new Debug Managed Memory action when analyzing a .NET dump file.

.NET Debugging Workshop

If you’re following my blog, you know I’ve delivered debugging workshops for longer than I can remember. Up until a couple of years ago, I was putting all focus on WinDbg and SOS, trying to distill their most useful features and commands to a single day’s worth of demos and labs. In this workshop, I decided to try a new and different approach. I didn’t want to spend 5 hours talking about obscure SOS commands. Instead, I used the following plan.

First, I spent a couple of hours explaining how to create dump files using Task Manager, Procdump, Windows Error Reporting, and DebugDiag. I had a great group of web developers and client developers, and each found their own favorite way for creating dump files. I also talked about some fundamental dump analysis techniques with both Visual Studio and WinDbg.

The core part of the day was focused on automatic dump analysis. After showing a couple of batch files that grab a bunch of dump files and run WinDbg to analyze them “automatically”, people were asking for a better approach. And I had one prepared: I talked about ClrMD, the .NET diagnostics library that you can use to analyze dump files and attach non-invasively to running processes. In the demos, I showed how to get the current exception stack trace from a dump file, how to grab thread call stacks from a running process (this was actually one the hands-on labs — a 15-liner!), how to find live heap objects and print out memory usage statistics, how to locate specific objects and print out their fields, and how to do rudimentary deadlock diagnostics with the blocking objects API. I think everyone was really impressed with ClrMD: it’s incredible to have that kind of power at your fingertips and to be able to programmatically address so many diagnostics scenarios.

Towards the end of the day, I talked about ETW, the Windows Performance Toolkit, and PerfView. I switched the focus to performance investigations and explained how to use ETW for application profiling and for file I/O analysis, and how to use PerfView for managed memory leak diagnostics. I even had a few minutes to introduce the TraceEvent library, which is to ETW what ClrMD is to dump files. You can use TraceEvent to automatically process ETW traces from a log file or in real-time. One example I mentioned is live exception monitoring: you can use TraceEvent to immediately detect any exception that occurs in a managed process.

If you attended the workshop, you have a link to the lab files and instructions. Additionally, I promised to share with you the ClrMD demos we developed during class. Here they are.

Wrapping Up

I’d like to thank everyone for coming and I’m looking forward to DevConnections next year as well! (BTW, I’m coming back to Vegas in December for AppDevTrends.)


I am posting short links and updates on Twitter as well as on this blog. You can follow me: @goldshtn

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*