spinlock

Updated: October 20, 2013

Applies To: Windows 8, Windows 8.1

This action produces a text file listing information related to spinlock activity.

-a spinlock [-summary] [-counts [n]]

-summary
Summarizes spinlock event information in a tab-delimited format.

-count [n]
Maximum number of files to show.

Xperf spinlock analysis is available for 64-bit architectures. Spinlock instrumentation is supported beginning with Windows® 7, Windows Server® 2008 R2, and newer versions of the operating system. Xperf supports normal spin locks and queued spin locks. For more information about spin locks, see Spin Locks. To reduce overhead, ETW spinlock instrumentation is sample-based. The sampling frequency can be tuned with -setspinlocksample. For more information about starting spinlock sampling, see start.

To perform meaningful analysis, familiarity with WPA symbols is recommended. For information on symbols, see Symbol Support.

If your test scenario is already running, it is not necessary to stop the scenario to collect spinlock events. You can start spinlock event collection while the code of interest is being actively exercised. Nor is it necessary to suspend your scenario when spinlock event data has been collected.

noteNote
Large numbers of spinlock events may overload the trace buffers and cause events to be lost. A message will appear when merging and loading the trace if this happens. For more information about avoiding event loss, see Avoid Lost Events.

For more information about the spinlock action, see Customizing Spinlock Parameters.

The following command example shows how to start a trace with spinlock data.

xperf -on PROC_THREAD+LOADER+SPINLOCK

Spinlock event data can also be collected using only the "SPINLOCK" option, as shown in the following command example.

xperf -on SPINLOCK

However, if the "PROC_THREAD+LOADER" options are omitted, symbol information is not available for decoding. For more information about symbols, see Symbol Support.

After event data has been collected into an ETL file, process the ETL file as shown in the following command example.

xperf -i example.etl -symbols -o example.txt -a spinlock

This produces a spinlock report. For information about this report, see Evaluating Spinlock Data.

Other Resources

Xperf Actions

Show: