Gathering a Startup, Shutdown, Sleep, Hibernate, or Reboot Trace

Microsoft has created a toolset called the Windows Performance Toolkit, or WPT, to help developers and users visualize and troubleshoot performance issues. One of the tools in this toolset is specifically designed to assist with capturing traces of boot, shutdown, or reboot cycles, and can provide insight into drivers, services, winlogon, explorer, disk and CPU utilization, and even help with seeing things like disk fragmentation and driver load order.


Installing the tools

Before gathering any data, you will first need to download the installation packages necessary to install the Windows Performance Toolkit on your Windows 7 machine. The Windows Performance Toolkit is a part of the Windows 7 SDK, but you won’t need to install the entire SDK to get the WPT installation files if you follow this guide. First, you need to download the Windows 7 SDK, which is a 500K web installer (click the “Install Now” link). Once you start the installation, you only need to check the “Windows Performance Toolkit” checkbox under the “Redistributable Packages” section – uncheck EVERYTHING else:

SDK_PerfToolkit.png

After you click next, it will download (only) the installation .MSI packages needed to actually install the WPT. Once the download of the files is complete and you exit the SDK installer, you will need to actually install the version of the WPT that matches the architecture of your OS (the x86 MSI on a 32bit Windows 7 machine, the x64 MSI on a 64bit Windows 7 machine). The downloaded .MSI files will be located (by default) in C:\Program Files\Microsoft SDKs\Windows\v7.1\Redist\Windows Performance Toolkit:
SDK_PerfToolkit_Redist.png

Install the correct installation file that matches the architecture (32bit or 64bit) of your Windows 7 install, taking all the default options and performing a “Complete” installation.


Disable the Paging of the Kernel Executive on x64 Windows

If you have a 64bit installation of Windows, you will need to modify the registry to enable full tracing to work properly. To do this, you will need to open an ELEVATED CMD PROMPT, then type "regedit.exe" from within that command prompt (minus the quotes of course). Once regedit is open, browse to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management, double-click the "DisablePagingExecutive" value, and change it from "0" to "1". Click "OK" to save the value:
DisablePagingExecutive.png
At this point, you *must* reboot for this change to take effect before you start ANY tracing.

Once you've done the above steps, but before you continue, you will need to open an ELEVATED CMD PROMPT to execute any of the trace options described in this guide. Once you've decided which type of trace to take (or which you've been asked to take by a member of this forum), choose the correct trace section below and follow that section only:


Creating a BOOT trace:

First, you will need have that elevated CMD prompt open. Second, to generate a boot trace, you will need to type the following command into the CMD prompt, and press the ENTER key to execute it – note that this command is ALL ONE LINE:
Code:
xbootmgr –trace boot -traceFlags LATENCY+DISPATCHER+DISK_IO_INIT+NETWORKTRACE+MEMINFO+POWER+PERF_COUNTER+PRIORITY+REGISTRY+FILE_IO+FILE_IO_INIT -postBootDelay 300 -stackWalk Profile+ProcessCreate+CSwitch+ReadyThread+Mark+ThreadCreate+DiskReadInit+DiskWriteInit+DiskFlushInit+RegSetValue+RegCreateKey+RegSetInformation -resultPath C:\Boot_Trace
This command will cause your machine to shut down and reboot automatically. Once the system restarts, please log back in (as necessary) as soon as possible to minimize the size of the resulting trace file. Once logged in, the system will present a dialog box letting you know that it is waiting 120 seconds (it will count down) before finishing the trace. DO NOT use your computer to do anything during this time – let the countdown finish and trace files generate:
boot.png
capture_finish.png

Once the trace is complete, you will find a large .ETL file and a log file in C:\Boot_Trace. This .ETL file can then be compressed (using 7zip, winrar, winzip, etc.) and uploaded for analysis - however, due to its size, you will need to upload it to a third-party site such as MediaFire, MegaUpload or RapidShare.


Creating a Shutdown trace:

First, you will need have that elevated CMD prompt open. Second, to generate a boot trace, you will need to type the following command into the CMD prompt, and press the ENTER key to execute it – note that this command is ALL ONE LINE:
Code:
xbootmgr –trace shutdown -traceFlags BASE+LATENCY+DISK_IO_INIT+DISPATCHER+DRIVERS+FILE_IO+FILE_IO_INIT+NETWORKTRACE+PERF_COUNTER+POWER+PRIORITY+REGISTRY -resultPath C:\Shutdown_Trace
This command will cause your machine to shut down and reboot automatically. Once the system restarts, please log back in (as necessary) as soon as possible. Once logged in, the system will present a dialog box letting you know that it is waiting 120 seconds (it will count down) before rebooting your machine A SECOND TIME. DO NOT click the countdown dialog, or in any other way utilize your computer to do anything during this time – let the countdown finish and the system restart:
shutdown.png

Again, once the system restarts a second time, please log back in (as necessary) as soon as possible. This time, the trace will finalize:
capture_finish.png

Once the trace is complete, you will find a large .ETL file and a log file in C:\Shutdown_Trace. This .ETL file can then be compressed (using 7zip, winrar, winzip, etc.) and uploaded for analysis - however, due to its size, you will need to upload it to a third-party site such as MediaFire, MegaUpload or RapidShare.


Creating a REBOOT trace:

First, you will need have that elevated CMD prompt open. Second, to generate a boot trace, you will need to type the following command into the CMD prompt, and press the ENTER key to execute it – note that this command is ALL ONE LINE:
Code:
xbootmgr –trace rebootCycle -traceFlags BASE+LATENCY+DISK_IO_INIT+DISPATCHER+DRIVERS+FILE_IO+FILE_IO_INIT+NETWORKTRACE+PERF_COUNTER+POWER+PRIORITY+REGISTRY -resultPath C:\Reboot_Trace
This command will cause your machine to shut down and reboot automatically. Once the system restarts, please log back in (as necessary) as soon as possible. Once logged in, the system will present a dialog box letting you know that it is waiting 120 seconds (it will count down) before rebooting your machine A SECOND TIME. DO NOT click the countdown dialog, or in any other way utilize your computer to do anything during this time – let the countdown finish and the system restart:
reboot.png

Again, once the system restarts a second time, please log back in (as necessary) as soon as possible. This will start another 120 second countdown, and reboot your machine A THIRD TIME. As before, DO NOT utilize your computer during this time – let the countdown finish (again) and the system restart (again):
reboot_2.png


Once the system restarts a third time, please log back in (as necessary) as soon as possible. This time, the trace will finalize:
capture_finish.png

Once the trace is complete, you will find a large .ETL file and a log file in C:\Reboot_Trace. This .ETL file can then be compressed (using 7zip, winrar, winzip, etc.) and uploaded for analysis - however, due to its size, you will need to upload it to a third-party site such as MediaFire, MegaUpload or RapidShare.
 

Attachments

  • capture_finish (1).png
    capture_finish (1).png
    3.8 KB · Views: 1
  • capture_finish (2).png
    capture_finish (2).png
    3.8 KB · Views: 1
  • reboot_2.png
    reboot_2.png
    1.5 KB · Views: 1
Last edited by a moderator:
For some reason, when I check the correct boxes and then hit next it runs the download but when I check to find the downloaded files they are nowhere to be found. The "C:Program Files/MicrosoftSDKs" folder hasn't even been created.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware x51
OS
Windows 7 Home Premium 64bit
CPU
Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz
Motherboard
Alienware 08PG26
Memory
8.00 GB
Graphics Card(s)
(1) Intel(R) HD Graphics (2) NVIDIA GeForce GT 545
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1360x768
Hard Drives
ST31000524AS ATA Device
How about a tutorial or pointers on how to interpret the ETL trace ?

How about a tutorial or pointers on how to interpret the ETL trace ?

Took a shutdown trace and trying to identify the "culpret" that is keeping the system from turing the power off (ala Win 95... OS says it shutdown, but you still have to flip/hold the button for 5-7 seconds to shut the system off).

I brought up the viewer and very interesting plots, put nothing "sticks" out (like a process that started but did not complete)
 

My Computer My Computer

Computer type
PC/Desktop
OS
Win 7 Professional x64
That's a lot more than a post on the internet, but in your case look into details in the "generic events" table, the winlogon provider to be specific, to see what is happening. From there you may need to look into the details of the services graph and perhaps the disk activity graphs to see what is happening further if those don't help.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
Thanks for settling that, Carl. He'll need to work with SanDeep from Dell to get the BIOS reworked.
 
Nice guide, but how can this be used to trace Sleep and wake?

I was excited to see this thread but I don't see how i can use this to trace what is happening when going to sleep and waking up which is where I'm having a problem after upgrading to Win 7 on one of my laptops.

No BSOD so no dump files to analyze and all event logs look ok. Would like to be able to trace why windows is freezing a few seconds after coming back from sleep.

Thanks
 

My Computer My Computer

OS
64
Did you do the superior Clean Reinstall - Factory OEM Windows 7 and not an in-place Upgrade or keeping the factory bloatware.

Most sleep problems are due to Display driver. Make sure you have enabled Automatically deliver drivers via Windows Update (Step 3) and run all of your IMportant and Optional Windows UPdates with reboots until there are no more offered. If no Display driver comes then check the PC's Support Downloads webpage for the latest driver to install.

Next work through these steps for Sleep Mode Problems - Vista Forums

Carl should stop in soon so he can explain how the trace can reveal the problem if these steps don't.

I'd also go over the install to establish a Clean BOot, check the logs especially Performance log for clues, and the other Troubleshooting Steps for Windows 7
 
Thanks, but I'm already far ahead of you, clean install, fully tweaked OS, etc.

I found the argument for standby/resume but the trace is useless since the system freezes after a few seconds after wake. It does not happen all the time either so it is an intermittent problem which is difficult to track without some other tool which will need to run off a USB flash drive independent of Win OS since the freezing prevents any logs to be written.

This is an older laptop I refreshed with an SSD, I'm not the only one with this problem, it is riddled all over the net with similar threads with no resolution. My new laptop does not have this issue so I can attribute this to compatibility issues with this older laptop. Oh well
 

My Computer My Computer

OS
64
HW is fine, memtest etc all pass, the laptop works just fine. It is just the sleep function which is problematic as indicated by the many others google result on Win 7 boxes. My issue in particular is an older laptop I upgraded to an SSD, so swaptronics is really not an option or ideal for troubleshooting, I guess if you are are a beginner one can start there. I'll put it this way, I have been researching this problem for a while and if there is a forum or link out there related to this I have read it and tested every theory to resolve it, but I really don't think it can be resolved due to compatibility issues and lack of updates on this particular laptop. I have other systems and newer laptops so I'm not too concerned, but rather curious to try and find the actual solution.

My own solution to resolving this is using Hybrid Sleep with reduced hibernation system file % to speed up the hybrid sleep initiation (writing to SSD) and dealing with the extra 1-2 seconds for power up. At least this way you don't have to reboot if it freezes intermittently awaking from sleep. So for anyone else out there with a similar problem this is the for sure solution if you end up in my situation.

cheers
 

My Computer My Computer

OS
64

My Computer My Computer

OS
64
No offense taken. I thought somebody was suggesting another fix and wanted to know what it was.
 
Fantastic, everything you posted is exactly what I would suggest to someone else with the same problem, a simple driver or BIOS update like you suggested has worked for a lot of people but in my case and others who have gone through those steps, even the latest updates are too old or don't exist so the workaround I came up with seems to be the only way to get around this issue.

If I find another solution or way around this I will post it but at this time I'm not sure the effort for low level debugging COTS HW even if I had the pin out to probe the board with a JTAG would really help being windows is so reliant on DLL's and drivers from other MFG's components. Anyway enough thinking out loud.

Cheers
 

My Computer My Computer

OS
64
A month or so ago my HP-Probook-4530s laptop with Windows 7 x64 stopped powering off after shutdown.
It did before, but stopped, and it will not do a Restart either. Manually powering it off is necessary now.
I updated the BIOS to the latest version, plus the video and audio drivers too.
The Intel chipset drivers are supposedly the latest version already, according to the HP Update utility, and the Intel driver checker utility on their web site.
It WILL power off normally in Safe Mode, but NOT with a Clean Boot.

Here is my shutdown_trace file that I captured using the Windows Performance Toolkit tutorial in this forum.

Dana-shutdown_BASE+LATENCY+DISK_IO_INIT+DISPA.7z download - 2shared

Any suggestions?
 

My Computer My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
HP-Probook 4530s
OS
Windows 7 Home Premium x64
CPU
i5
Memory
8 GB
Graphics Card(s)
Intel HD-3000
Hard Drives
Primary and Expansion bay
Antivirus
MSE
Browser
Firefox
To the OP: I have a left a shutdown trace at the Performance and Maintenance Tutorials sub forum. Would you mind having a look at it? Thank you very much.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Acer Predator G3600
OS
Windows 7 Professional x64
CPU
Intel i5-2300 CPU @ 2.80GHz
Motherboard
Acer
Memory
Kingston 8 Gb
Graphics Card(s)
AMD Radeon HD 6500 Series
Hard Drives
Hitachi 1TB
Antivirus
Norton Antivirus 360
Back
Top