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
The Launch option starts the profiler using the sampling method and it also starts the specified application.
To use the Launch option, you must specify the Sample method in the Start option.
VSPerfCmd.exe /Launch:AppName [Options]
The name of the application to launch. Full and partial paths from the current directory are supported.
The following VSPerfCmd options can be combined with the Launch option on a single command line.
Initializes the command-line profiler session and sets the specified profiling method.
GlobalOn and GlobalOff
Resumes (GlobalOn) or pauses (GlobalOff) profiling, but does not end the profiling session.
PID and ProcessOff:
Resumes (ProcessOn) or pauses (ProcessOff) profiling for the specified process.
Specifies the version of the .NET Framework Common Language Runtime (CLR) to profile when more than one version is loaded in a profiling session. By default, the first loaded version is profiled.
The following options can only be used with the Launch option.
Launches the specified command-line application in a new window.
Specifies the list of arguments to pass to the application.
Disables the collection of line-level profiling data.
One of the following sampling interval options can be specified on the Launch command line. The default sampling interval is 10,000,000 processor clock cycles.
Specifies the number and type of sampling interval.
Timer - Samples every
Cyclesnon-halted processor clock cycles. If
Cyclesis not specified, 10,000,000 cycles are used.
PF - Samples every
Eventspage faults. If
Eventsis not specified, 10 page faults.
Sys - Samples every
Eventscalls to the operating system. If
Eventsis not specified, 10 system calls are used.
Counter - Samples every
Reloadnumber of the CPU performance counter specified by
FriendlyNamecan specify a string to use as the column header in profiler reports.
GC - Collects .NET memory data. By default (allocation), data is collected at every memory allocation event. When the lifetime parameter is specified, data is also collected at each garbage collection event.
This example demonstrates the use of Launch to start an application.
VSPerfCmd.exe /Start:Sample /Output:TestApp.exe.vsp VSPerfCmd.exe /Launch:TestApp.exe