RSS Feed Subscribe to the RSS feed Last updated:  27 Nov 2010
Added guides from MagicAndre

Thanks to MagicAndre1981 for the xperf guides here:  MagicAndre XPerf Guides

Diagnose Shutdown Problems with Xbootmgr:  
Use the Windows Performance Toolkit xbootmgr.exe tool to trace the source of system shutdown issues
by Michael Morales
From this link:  http://www.devproconnections.com/article/performance/diagnose-shutdown-problems-with-xbootmgr.aspx)

Install the Windows Performance Toolkit
First download and install the SDK for Windows 7 according to these directions
Go to http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
Click the Download button
Then select "Run" in the dialog box
Click "Next", then click "I agree"
Then continue clicking "Next" until you get to the dialog box that shows Installation Options
Select ONLY the Win32 Development Tools (clear the checkmarks from all other boxes)
Click on "Next" to begin the installation (it won't take long if you're only installing the Win32 Development Tools).
Alternatively, I have uploaded the installation files to my box.net and SkyDrive accounts here:
wpt_x86.msi    http://www.box.net/shared/rce6yra3gj
                       http://cid-5a5378e587a744c3.skydrive.live.com/self.aspx/.Public/wpt%5E_x86.msi
wpt_x64.msi    http://www.box.net/shared/crzboijmku
                       http://cid-5a5378e587a744c3.skydrive.live.com/self.aspx/.Public/wpt%5E_x64.msi
wpt_ia64.msi    Only for Itanium processors, copy of this is stored on my box.net account.  If needed, please PM me.

These are copies that I've saved on my box.net account - they may not be the most current.

Install the version that's appropriate for your OS
:
Ensure that Stack Walking is turned on
Windows XP - Not Available
32 bit Vista/Win7 - already installed
64 bit Vista/Win7 - use the TurnOnStackwalk64.cmd registry merge detailed below

        QueryStackwalk64.cmd:  http://www.box.net/shared/150qehihr8
                                                http://cid-5a5378e587a744c3.skydrive.live.com/self.aspx/.Public/QueryStackwalk64.cmd
[code]
@REG QUERY "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive
[/code]
                            From this page:  http://msdn.microsoft.com/en-us/library/ff190927%28VS.85%29.aspx

        TurnOnStackwalk64.cmd:  http://www.box.net/shared/o37cjtviq1
                                                  http://cid-5a5378e587a744c3.skydrive.live.com/self.aspx/.Public/TurnOnStackwalk64.cmd
[code]
@REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive -d 0x1 -t REG_DWORD -f

@IF NOT %ERRORLEVEL% == 0 echo error: Could not configure system for 64-bit stackwalking.  Please run this script from an elevated administrator console.
[/code]
                            From this page:  http://msdn.microsoft.com/en-us/library/ff190927%28VS.85%29.aspx

        TurnOffStackwalk64.cmd:  http://www.box.net/shared/5neserhzpx
                                                  http://cid-5a5378e587a744c3.skydrive.live.com/self.aspx/.Public/TurnOffStackwalk64.cmd
[code]
@REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" -v DisablePagingExecutive -d 0x0 -t REG_DWORD -f

@IF NOT %ERRORLEVEL% == 0 echo error: Could not remove 64-bit stackwalking configuration.  Please run this script from an elevated administrator console.
[/code]
                            From this page:  http://msdn.microsoft.com/en-us/library/ff190927%28VS.85%29.aspx

Then, set the symbols and symbol cache in your system variables:

Go to Start
Right click on Computer and select "Properties"
Select "Advanced System Setings" in left hand sidebar
Select "Environment Variables" button
Under the "System Variables" heading, select the "New" button
Variable name = "_NT_SYMBOL_PATH" (without the quotes)
Variable value = "srv*c:\symbols*http://msdl.microsoft.com/download/symbols" (without the quotes)
and then click on OK to accept the new value.  

Then do this for the cache:
Go to Start
Right click on Computer and select "Properties"
Select "Advanced System Setings" in left hand sidebar
Select "Environment Variables" button
Under the "System Variables" heading, select the "New" button
Variable name = "_NT_SYMCACHE_PATH" (without the quotes)
Variable value = "srv*c:\symbols" (without the quotes)
and then click on OK to accept the new value.  

Then click on OK repeatedly until you exit the dialog.

Kernel stackwalking can be specified w/any of the trace commands (ie:  -stackwalk)

GENERAL Trace Commands
for problems with specific things while Windows is running

Starts the DiagEasy trace:
[code]
xperf -DiagEasy Trace.etl
[/code]

Starts the Base trace:
[code]
xperf -Base Trace.etl
[/code]

Stops the current trace:
[code]
xperf -stop
[/code]

Pipes the Trace file through xperfview to view the details:
[code]
xperf Trace.etl
[/code]

STARTUP Trace Commands
for generating a trace of the startup processes
Open an elevated (Run as administrator) Command Prompt and run:

[code]
xbootmgr -trace boot -noPrepReboot -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP
[/code]

From this link: http://www.msfn.org/board/Trace-Vista-boot-shutdown-hibernate-stan-t117154.html

SHUTDOWN Trace Commands
for generating a trace of the shutdown processes
Open an elevated (Run as administrator) Command Prompt and run:

[code]
xbootmgr -trace shutdown -noPrepReboot -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP
[/code]

From this link: http://www.msfn.org/board/Trace-Vista-boot-shutdown-hibernate-stan-t117154.html
---------------

Open an elevated (Run as administrator) Command Prompt and run:


[code]
C:\xperf\>xbootmgr.exe -trace shutdown -traceflags latency+dispatcher -numruns 1 -stackwalk Profile+CSwitch
[/code]

Then do this to generate the report:

[code]
C:\xperf>xperf -i shutdown_latency+dispatcher_1.etl -o shutdown_demo1.xml -a shutdown
[/code]

Then open the XML file in a browser to start analyzing the trace
From this link: http://www.devproconnections.com/article/performance/diagnose-shutdown-problems-with-xbootmgr.aspx

STANDBY Transitions Commands
for generating a trace of the sleep transitions
Open an elevated (Run as administrator) Command Prompt and run:

[code]
xbootmgr -trace standby -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP
[/code]

From this link: http://www.msfn.org/board/Trace-Vista-boot-shutdown-hibernate-stan-t117154.html

HIBERNATION Transitions Commands
for generating a trace of the hibernation transitions
Open an elevated (Run as administrator) Command Prompt and run:

[code]
xbootmgr -trace hibernate -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP
[/code]

From this link: http://www.msfn.org/board/Trace-Vista-boot-shutdown-hibernate-stan-t117154.html

Recognized Stackwalk flags:
 The following is a list of recognized stack walking flags:

ProcessCreate
ProcessDelete
ImageLoad
ImageUnload
ThreadCreate
ThreadDelete
CSwitch
ReadyThread
ThreadSetPriority
ThreadSetBasePriority
Mark
SyscallEnter
SyscallExit
Profile
ProfileSetInterval
DiskReadInit
DiskWriteInit
DiskFlushInit
FileCreate
FileCleanup
FileClose
FileRead
FileWrite
FileSetInformation
FileDelete
FileRename
FileDirEnum
FileFlush
FileQueryInformation
FileFSCTL
FileDirNotify
FileOpEnd
SplitIO
RegQueryKey
RegEnumerateKey
RegEnumerateValueKey
RegDeleteKey
RegCreateKey
RegOpenKey
RegSetValue
RegDeleteValue
RegQueryValue
RegQueryMultipleValue
RegSetInformation
RegFlush
RegKcbCreate
RegKcbDelete
RegVirtualize
RegCloseKey
HardFault
PagefaultTransition
PagefaultTransition
PagefaultDemandZero
PagefaultCopyOnWrite
PagefaultGuard
PagefaultHard
PagefaultAV
VirtualAlloc
VirtualFree
PagefileBackedImageMapping
HeapRangeCreate
HeapRangeReserve
HeapRangeRelease
HeapRangeDestroy
HeapCreate
HeapAlloc
HeapRealloc
HeapFree
HeapDestroy
AlpcSendMessage
AlpcReceiveMessage
AlpcWaitForReply
AlpcWaitForNewMessage
AlpcUnwait
ThreadPoolCallbackEnqueue
ThreadPoolCallbackDequeue
ThreadPoolCallbackStart
ThreadPoolCallbackStop
ThreadPoolCallbackCancel
ThreadPoolCreate
ThreadPoolClose
ThreadPoolSetMinThreads
ThreadPoolSetMaxThreads
PowerSetPowerAction
PowerSetPowerActionReturn
PowerSetDevicesState
PowerSetDevicesStateReturn
PowerDeviceNotify
PowerDeviceNotifyComplete
PowerSessionCallout
PowerSessionCalloutReturn
PowerPreSleep
PowerPostSleep
PowerPerfStateChange
PowerIdleStateChange
PowerThermalConstraint
ExecutiveResource
PoolAlloc
PoolAllocSession
PoolFree
PoolFreeSession

XPerf Guides by MagicAndre1981
Thanks to MagicAndre1981 at http://www.msfn.org/

Windows Performance Analysis Tools
http://www.msfn.org/board/topic/146919-install-the-windows-performance-tools-kit/

Trace Windows Vista/7 boot/shutdown/hibernate/standby/resume issues
http://www.msfn.org/...howtopic=140247

How to speed up boot process under Windows Vista or Windows 7
http://www.msfn.org/...howtopic=140262

Analyzing DPC / Interrupt Issues:
http://www.msfn.org/...howtopic=140263

Analyzing High CPU Usage Issues:
http://www.msfn.org/...howtopic=140264

NTdebugging Blog > Using Xperf to investigate slow I/O issues:
http://blogs.msdn.com/b/ntdebugging/archive/2009/08/17/xperf-to-investigate-slow-i-o-issues.aspx