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.
Redirected console output is written as Unicode. Must be the first option specified.
Starts the profiling service in the specified mode.
Specifies the output file name. Use only with Start.
Enables profiling across Windows sessions. Use only with Start, Attach, or Launch.
Enables the specified account access to the profiler service. Use only with Start.
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.
When 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.
Displays a list of valid CPU counters for the current machine.
Specifies a Windows performance counter event to include with profile mark data. Use only with Start.
Specifies the time interval (in milliseconds) between Windows performance counter data collection events. Use with WinCounter.
Controls 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.
Displays the state of the profiler, information about processes that are currently being profiled, and accounts that have authority to control the profiler.
Closes the profiling data file and turns the profiler off.
Resumes data collection after a call to VSPerfCmd GlobalOff.
Stops all data collection, but does not end the profiling session.
Resumes data collection for the specified process after profiling was paused by a call to VSPerfCmd ProcessOff.
Stops data collection for the specified process.
Resumes profiling for the specified process after profiling was paused by a call to VSPerfCmd ThreadOff. Use ThreadOn only when profiling with the instrumentation method.
Pauses profiling for the specified thread. Use ThreadOff only when profiling with the instrumentation method.
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.
Starts the specified application and begins profiling.
Specifies command line arguments to pass to the launched application.
Starts the specified command in a new command prompt window.
Begins profiling the specified processes. Processes can be identified by the process id or by the process name.
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.
Collects .NET memory allocation and object lifetime data. Use only with the VSPerfCmd Launch 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.
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.
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.
Lists the current state of profiling services and lists user permissions.
Starts, stops, installs, or uninstalls the profiling service component (service) or kernel mode device driver (driver).
Enables or disables automatically starting the profiling service (service) or kernel mode device driver (driver) after a restart.