VSPerfCmd

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The VSPerfCmd.exe tool is used to start and stop performance data collection. It uses the following syntax:

VSPerfCmd [/U] [/options]  

The following tables describe VSPerfCmd.exe tool options.

OptionDescription
URedirected console output is written as Unicode. Must be the first option specified.
Start : modeStarts the profiling service in the specified mode.
Output : filenameSpecifies the output file name. Use only with Start.
CrossSession|CSEnables profiling across Windows sessions. Use only with Start, Attach, or Launch.
User :[domain\]usernameEnables the specified account access to the profiler service. Use only with Start.
WaitStart[:n]Waits for the data collection logger to initialize. If n is specified, VSPerfCmd will wait at most n seconds. If n is not specified, VSPerfCmd will wait indefinitely. This eases use of VSPerfCmd as part of a batch process.
Counter : cfgWhen the sample profiling method is used, specifies a CPU counter and the number of events to use as the sampling interval. You can sample only one counter value.

When the instrumentation profiling method is used, specifies a CPU counter to be collected at each instrumentation point. Use only with Start:Trace, Attach,or Launch.
QueryCountersDisplays a list of valid CPU counters for the current machine.
WinCounter : pathSpecifies a Windows performance counter event to include with profile mark data. Use only with Start.
AutoMark : nSpecifies the time interval (in milliseconds) between Windows performance counter data collection events. Use with WinCounter.
Events : optionControls collection of specified Event Tracing for Windows (ETW) events. ETW data is collected to an .itl file that is not the profiling data (.vsp) file.
StatusDisplays the state of the profiler, information about processes that are currently being profiled, and accounts that have authority to control the profiler.
Shutdown[:n]Closes the profiling data file and turns the profiler off.
GlobalOnResumes data collection after a call to VSPerfCmdGlobalOff.
GlobalOffStops all data collection, but does not end the profiling session.
ProcessOn : pidResumes data collection for the specified process after profiling was paused by a call to VSPerfCmdProcessOff.
ProcessOff : pidStops data collection for the specified process.
ThreadOn and ThreadOff : tidResumes profiling for the specified process after profiling was paused by a call to VSPerfCmdThreadOff. Use ThreadOn only when profiling with the instrumentation method.
ThreadOn and ThreadOff : tidPauses profiling for the specified thread. Use ThreadOff only when profiling with the instrumentation method.
Mark : MarkNum[,MarkText]Inserts a mark into the profiling data file, with optional text.

The following options are only available when you are using the sampling profiling method.

OptionDescription
Launch : ExecutableStarts the specified application and begins profiling.
Args : ArgumentsSpecifies command line arguments to pass to the launched application.
ConsoleStarts the specified command in a new command prompt window.
Attach : PID[,PID]Begins profiling the specified processes. Processes can be identified by the process id or by the process name.
Detach[:PID[,PID]]Stops profiling the specified processes. Processes can be identified by the process id or by the process name. If no process is specified, profiling is halted for all processes.
GC[:{Allocation|Lifetime}]Collects .NET memory allocation and object lifetime data. Use only with the VSPerfCmdLaunch option.

Sampling Interval Options

The following options specify the type and duration of sampling intervals. The default is Timer. You can also specify a CPU counter as the interval by using the Counter option. These options can only be specified with Launch or with the first Attach of a profiling session.

OptionDescription
PF[:n]Samples on every n-th page fault (default=10).
Sys[:n]Samples on every n-th system call (default=10).
Timer[:n]Samples on every n-th processor cycle (default=10000000).

The following Admin options support profiling service components or kernel mode device drivers. The Admin options set profiling permissions and control the profiled service or device driver.

Admin options must be executed at a command prompt that is running with administrative credentials.

OptionDescription
Admin:Security <ALLOW|DENY> Right[ Right] <User|Group>Allows or denies the specified user or group access to profiling services.

 Right can be:

CrossSession - gives the user access to the service to do cross session profiling.

SampleProfiling - gives the user access to the driver to enable sampling profiling. Also used to access kernel transition information during trace profiling.

FullAccess - gives the user both CrossSession and SampleProfiling access.
Admin:Security, ListLists the current state of profiling services and lists user permissions.
Admin: <Service|Driver><START|STOP|INSTALL|UNINSTALL>Starts, stops, installs, or uninstalls the profiling service component (service) or kernel mode device driver (driver).
Admin: <Service|Driver>AutoStart<ON|OFF>Enables or disables automatically starting the profiling service (service) or kernel mode device driver (driver) after a restart.

The VSPerfCmd /Driver option is now obsolete. Use the VsPerfCmdAdmin options for this functionality.

VSInstr
VSPerfMon
VSPerfReport

Show: