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:

Options Description
U Redirected console output is written as Unicode. This must be the first option specified.
OUTPUT: < file name > 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.
USER: [ domain \] username Allows client access to the performance monitor from the specified account.
CROSSSESSION Enables cross-session profiling.
COUNTER :cfg 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 [,Reload[,FriendlyName]]

- 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.
WINCOUNTER :path Specifies a Windows performance counter to include with mark data. path is a Windows Performance counter string in PDH counter path format. For example:

\Processor(0)\% Processor Time

\System\Context Switches/sec
AUTOMARK :n 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)

See Also

Performance Report Views