55.5. Stand-Alone Profiler

This is a command-line tool useful when you need to profile an application without having to install Visual Studio on the machine — for example, in a production environment. To install this tool you need to execute vs_profiler.exe from the VSTS installation media located in the Standalone Profiler folder. It will install the tools in the directory %ProgramFiles%Microsoft Visual Studio 9.0Team ToolsPerformance Tools. I suggest adding this path to the system path.

The following commands profile an application using sampling with the default settings. The first line enables the trace. Then you specify it to use sample and the output for the report. In this case the report will be saved in the ApplicationToProfile directory on a file named Report.vsp. Then you launch the application, interact with it as usual, and when you are done you finally shut down the Profiler. You can then open and inspect the generated report in Visual Studio.

C:ApplicationToProfile>vsperfclrenv /traceon
Enabling VSPerf Trace Profiling of managed applications (excluding allocation
profiling).
. . .
C:ApplicationToProfile>vsperfcmd -start:sample -output:Report
Microsoft (R) VSPerf Command Version 9.0.21022 x86
. . .
C:ApplicationToProfile>vsperfcmd -launch:Application.exe
Microsoft (R) VSPerf Command Version 9.0.21022 x86
. . .
Successfully launched process ID:2896 Application.exe
C:ApplicationToProfile>vsperfcmd -shutdown
Microsoft (R) VSPerf Command Version 9.0.21022 x86
. . .
Shutting down the Profile Monitor

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.253.223