Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ProcessOn and ProcessOff

ProcessOn and ProcessOff

The VSPerfCmd.exe ProcessOff and ProcessOn subcommands pause and resume profiling for the specified process in a command-line profiling session. ProcessOff stops profiling the process and ProcessOn starts profiling the process.

In most cases, you specify ProcessOn or ProcessOff as the only option in a VSPerfCmd.exe command line, but they can also be combined with the GlobalOn, GlobalOff, ThreadOn, and ThreadOff subcommands.

The ProcessOn and ProcessOff subcommands interact with the GlobalOn and GlobalOff subcommands that control data collection for all processes in a command-line profiling session, and the ThreadOn and ThreadOff subcommands that control data collection for a specified thread.

The ProcessOff and ProcessOn subcommands also affect the Process Start/Stop count that is manipulated by profiler API functions.

  • ProcessOff immediately sets the Process Start/Stop Count to 0 and therefore pauses profiling.

  • ProcessOn immediately sets the Process Start/Stop Count to 1 and therefore resumes profiling.

For more information, see Profiling Tools APIs.

VSPerfCmd.exe /{ProcessOff|ProcessOn}:PID [Options]

PID

The integer identifier of the process to start or stop. Process IDs are listed on the Process tab of Windows Task Manager.

ProcessOn and ProcessOff can be specified on command lines that also contain the following subcommands.

Start: Method

Initializes the command-line profiling session and sets the specified profiling method.

Launch: AppName

Starts the specified application and begins profiling with the sampling method.

Attach: PID

Begins profiling the specified process.

GlobalOff|GlobalOn

Stops or starts profiling for all processes in a command-line profiling session.

{ThreadOff|ThreadOn}:TID

Stops or starts profiling for the specified thread (instrumentation method only).

In this example, the ProcessOff subcommand is used to collect profiling data for application startup.

; Initialize the profiler.
VSPerfCmd.exe /Start:Trace /Output:Instrument.vsp 
; Start the instrumented application.
; Stop profiling the process after startup.
VSPerfCmd.exe /ProcessOff:12345
; Shut down the target application.
; Close the profiler.
VSPerfCmd /Shutdown
Show:
© 2015 Microsoft