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.
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