Collecting Detailed Timing Data by Using Instrumentation

The Visual Studio Profiling Tools instrumentation method injects profiling code into a copy of a module. The code records each entry, exit, and function call of the functions in the module during a profiling run. The instrumentation method is useful for gathering detailed timing information about a section of your code and for understanding the impact of input and output operations on application performance.

Requirements

  • Visual Studio Ultimate, Visual Studio Premium, Visual Studio Professional

You can specify the instrumentation method by using one of the following procedures:

  • On the first page of the Profiling Wizard, select Instrumentation.

  • On the Performance Explorer toolbar, in the Method list, click Instrumentation.

  • On the General page of the properties dialog box for the performance session, select Instrumentation.

Common Tasks

You can specify additional options in the Performance SessionProperty Pages dialog box of the performance session. To open this dialog box:

  • In Performance Explorer, right-click the performance session name, and then click Properties.

The tasks in the following table describe options that you can specify in the Performance SessionProperty Pages dialog box when you profile by using the instrumentation method.

Task

Related Content

On the General page, add .NET memory allocation and lifetime data, and specify naming details for the generated profiling data (.vsp) file.

On the Launch page, if you have multiple .exe projects in your solution.specify the application to start and their start order.

On the Binaries page, specify a location for the instrumented copies of the modules. By default, the original binaries are moved to a backup folder.

On the Tier Interaction page, add ADO.NET call data to the profiling run.

On the Instrumentation page, exclude small functions from profiling to reduce the profiling overhead, profile JavaScript code in ASP.NET Web pages, and specify commands to run at a command prompt before and after the instrumentation process.

On the CPU Counters page, specify one or more processor performance counters to add to the profiling data.

On the Windows Events page, select one or more Event Tracing for Windows (ETW) events to collect with the sampling data.

On the Windows Counters page, specify one or more operating system performance counters to add to the profiling data as marks.

On the Advanced page, specify any additional options that you want to pass to the VSInstr instrumentation program, such as options to include or exclude specific functions.