Understanding IntelliTrace Part V: Advanced IntelliTrace Settings
This is a multi-part series, you can find the other parts here:
Understanding IntelliTrace Part I: What the @#$% is IntelliTrace?
Understanding IntelliTrace Part II: Where Do I Use IntelliTrace?
Understanding IntelliTrace Part III: IntelliTrace Events
Understanding IntelliTrace Part IV: IntelliTrace Calls
Before we get started I want to be absolutely clear: there is nothing “advanced” about the setting we are going to talk about. The word “advanced” in this case could (and probably should) be replaced with “miscellaneous” or, better yet, “stuff you should always have turned on”. I am, of course, talking about the setting found at Tools | Options | IntelliTrace | Advanced:
We will go though each of these in order and make sure you are clear on reasons for usage. Remember we are using the Brian Keller Virtual Machine with the Tailspin Toys sample code for these posts although this specific post can be used with any codebase.
IntelliTrace Logs
Running IntelliTrace sessions is great but the experience ends when you stop debugging. Try it and see what I mean. Get some IntelliTrace info up doing one of the exercises in the previous post:
Now stop debugging. Notice the IntelliTrace window completely goes away and there is no way to bring it back UNLESS you start a new debugging session or record an IntelliTrace log file. How do we get a log file? Just go to | Options | IntelliTrace | Advanced and select Store IntelliTrace Recordings In This Directory:
You might also want to create a new local directory with a shorter path to hold your logs:
Now you have a place for your IntelliTrace sessions to be stored:
We will dig into the specifics of what the log files contain in a later post however feel free to open one of these up and poke around on your own if you want.
Best Practice: Always turn on IntelliTrace logs.
Log File Size
The next decision to make is our log file size. I suggest a minimum of 500MB to 1GB regardless of activity. If in doubt then go with No Size Limit but watch the file closely. Choose your size carefully. Here are the criteria you need to consider when choosing log file size:
Cyclical Log Files
The log files are cyclic which means that when it fills up it will begin overwriting the oldest entries in favor of newer ones.
Collection Type
Are you collecting Events Only or Events and Calls? Events Only consumes much less space so you can go with smaller log sizes if needed. Events and Calls will require significantly more space so plan accordingly.
Time Window
The size of your log file determines, in essence, your time window. Capturing 500MB will capture half the time window that 1GB will. Since the log files are cyclic they will only capture a sliding time window until the trace stops.
Navigation Gutter
We will explore navigation more in another post but, for now, leave this setting selected:
This will give you special navigation features that are useful when troubleshooting IntelliTrace Calls:
Turning it off simply removes the navigation buttons and the gutter:
Symbol and Source Lookups
Symbol Path Lookup
Selecting the Enable Team Foundation Server Symbol Path Lookup option will enable the system so that when you are using IntelliTrace or an IntelliTrace log file it can use the build information to automatically try and pull down the matching symbol information for the build you are debugging. This option assumes you have a TFS Build server set up.
Source Server Support
Selecting the Prompt To Enable Source Server Support option actually will give you a dialog that will automatically turn on another option found at Tools | Options | Debugging | General | Enable Source Server Support:
To clarify what this means I’ll point you to the documentation on this option and what it says:
https://msdn.microsoft.com/en-us/library/85yzd16c.aspx
===
Tells the Visual Studio debugger to get source files from source servers that implement the SrcSrv (srcsrv.dll) protocol. Team Foundation Server and and the Debugging Tools for Windows are two source servers that implement the protocol.
===
To expand on this we can go to another source for more information:
https://msdn.microsoft.com/en-us/library/ms242029(v=vs.100).aspx
===
When there is no source code on the local machine or the PDB file does not match the source code, you can use Source Server to help debug an application. Source Server takes requests for files and returns the actual files. Source Server runs by means of a DLL file named srcsrv.dll. Source Server reads the application's PDB file, which contains pointers to the source code repository, as well as commands used to retrieve source code from the repository.
===
Review
This area of IntelliTrace is fairly easy to wrap you head around in terms of decision-making: turn everything on. The only real question is what size your log file needs to be. As I teach you more advanced techniques just make sure you don’t fill up your drive with an unattended IntelliTrace session that is being logged.