Using Xperf Profiles
This section shows how to capture traces by using profiles. If you are analyzing memory, consider writing your trace to a file, because ETW writes through and does not disturb the cache. If you are analyzing disk I/O, consider saving your trace into a circular buffer in memory. There are also other considerations such as whether you need to capture a long trace, which would not fit into a buffer in memory, or if you only care about the last 5-10 seconds of the trace content.
Procedure
Select a profile such as perf!FileIOProfiles.InBuffer and use command similar to the following example to display information about it.
xperf -profiles perf!FileIOProfiles.InBuffer
This command lists all profiles, followed by the sessions and providers in that profile:
Profile: FileIOProfiles.InBuffer
Sessions: FileIOProfiles.InBuffer.Sessions
Session: FileIOProfiles.InBuffer.Sessions[0].Kernel[0]
Session: FileIOProfiles.InBuffer.Sessions[0].User[0]
Providers: FileIOProfiles.InBuffer.Providers
Provider: FileIOProfiles.InBuffer.Providers[0].Kernel[0]
Provider: FileIOProfiles.InBuffer.Providers[0].User[0]
Assuming that you chose to use a file-based trace, start an InSequentialFile trace profile by using the following command.
xperf -start perf!GeneralProfiles.InSequentialFile
If a problem occurs, an error is reported. For example, starting the same profile twice would result in an error that the session is already running.
Show which InSequentialFile loggers have already started for a specific profile by using the following command.
xperf -profileloggers perf!GeneralProfiles.InSequentialFile
The response to this command is similar to the following example.
Session Status for "perf!GeneralProfiles.InSequentialFile":
"NT Kernel Logger" : Running
PerfCoreUserSession_InSequentialFile : Running
Stop the InSequentialFile trace profile, save the traces, and then merge them into a trace file, such as Merged.etl, by using the following command.
xperf -stop perf!GeneralProfiles.InSequentialFile merged.etl
If a problem occurs, an error is reported.
Start the InSequentialFile trace profile, overriding, at start time, MaxBuffers values for all ETW sessions, for which loggers are to be started to 256. To perform this action, use the following command.
xperf -start perf!GeneralProfiles.InSequentialFile -MaxBuffers 256
If a problem occurs, an error is reported.
Update MaxBuffers values for the active InSequentialFile ETW loggers specified in the trace profile by using the following command.
xperf -update perf!GeneralProfiles.InSequentialFile -MaxBuffers 256
No response is displayed after issuing this command.