This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here
You can use VSPerfMon tool to collect performance data for an application; typically this tool is launched by VSPerfCmd.exe. VSPerfMon displays additional information about process attach or detach which is not available by using the VSPerfCmd tool. To view this information, start VSPerfMon in a separate window. To invoke VSPerfMon use the following syntax:
VSPerfMon [/U] </TRACE [/COUNTER:cfg] | /SAMPLE | /COVERAGE> /CROSSSESSION /OUTPUT <file name> [/WINCOUNTER:cfg] [/USER [DOMAIN\]username]
The following table describes VSPerfMon tool options:
|U||Redirected console output is written as Unicode. This must be the first option specified.|
||Redirects output to the specified file name.|
|TRACE||Starts performance monitor for instrumented profiling.|
|SAMPLE||Starts the performance monitor for sampling profiling.|
|COVERAGE||Starts the performance monitor for code coverage collection.|
|CONCURRENCY||Starts the performance monitor for resource contention profiling.|
||Allows client access to the performance monitor from the specified account.|
|CROSSSESSION||Enables cross-session profiling.|
||When the instrumentation (TRACE) profiling method is used, specifies a CPU counter to be collected at each instrumentation point. You can collect multiple counter data by specifying multiple Counter options.
Use the following syntax to specify the counter (cfg) data:
- CounterName is the name of a counter returned by the VSPerfCmd /QueryCounters command.
- Reload is the counter event sampling interval. Do not use Reload with the instrumentation method.
- When specified, FriendlyName replaces CounterName in Profiling Tools report column names.
||Specifies a Windows performance counter to include with mark data.
\Processor(0)\% Processor Time
||Specifies the time interval (in milliseconds) between automatic marks when you use /WINCOUNTER. Rounded up to the nearest 500ms.
Use 0 to disable automatic marks. (default=500ms if unspecified)