Chapter 11: Flow Tracing


Overview

In the last chapter, I barely made a dent in the topic of what the Profiling API can do. In this chapter, I want to delve a little bit deeper and build a tool I've always wanted. Back in Chapter 6, I mentioned the amazingly cool wt (Watch and Trace) command built into the console-base managed debugger, CORDBG.EXE. With wt, you can see the flow of method calls, which means that you can also see the flow of your entire code. The wt command offers a fantastic way to learn about bottlenecks—because so many things happen behind the scenes, you can't rely on scrutinizing the code to find them.

Unfortunately, the wt command works only in a console application, which is not the most intuitive debugger in the world. Additionally, CORDBG uses the debugging stepping mechanism to do the tracing, so it's slow. I want the tracing output to be fast and easy to use. That's where my favorite utility, FlowTrace, comes into play. It gives you the power of wt with none of the bitter aftertaste!

I'll start this chapter with a discussion of how the Profiling API allows you to hook method calls easily and efficiently. After explaining how to use FlowTrace, I'll turn to some of the implementation highlights so that you'll understand how it works. Finally, because FlowTrace is one of those tools that begs to be extended in many different ways, I'll give you some good ideas for taking it to the next level.




Debugging Applications for Microsoft. NET and Microsoft Windows
Debugging Applications for MicrosoftВ® .NET and Microsoft WindowsВ® (Pro-Developer)
ISBN: 0735615365
EAN: 2147483647
Year: 2003
Pages: 177
Authors: John Robbins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net