Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Gathering a Startup, Shutdown, Sleep, Hibernate, or Reboot Trace



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

Getting Traces to Troubleshoot Performance Issues
Published by cluberti
26 Jul 2011
Published by

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:



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:


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:

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:



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:


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


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:


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):


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


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.
26 Jul 2011   #1
mjf

Windows 7x64 Home Premium SP1
 
 

Good stuff I was hoping you'd make a tutorial

My System SpecsSystem Spec
26 Jul 2011   #2
karlsnooks

MS Windows 7 Ultimate SP1 64-bit
 
 

Glad to see a tutorial on this.

I've been reluctant to recommend xperf because of lack of tutorial and also because for the non-serious user I have feared that there would be more problems and situations created than solved.

I do feel like the tool is good for the knowledgeable user.

Thanks again for the tutorial.
My System SpecsSystem Spec
28 Jul 2011   #3
Dave76

Microsoft Community Contributor Award Recipient

Windows 7 Ult x64 - SP1/ Windows 8 Pro x64
 
 

Nice tutorial, thanks for taking the time to write this.
My System SpecsSystem Spec
28 Jul 2011   #4
StalkeR

Windows 7 Ultimate SP1 x64
 
 

Good job !
My System SpecsSystem Spec
09 Aug 2011   #5
gregrocker
Microsoft MVP

 

Fantastic! I didn't know you'd put it into a SF format, having seen just the one on your blog.

You are the top expert I've found on this and we are very lucky to have you here.
My System SpecsSystem Spec
15 Aug 2011   #6
Britton30
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

If I need to find out why my PC is taking 187 seconds instead of the former ~66, do I need all three traces? Which forum do you want them in?
Installed the Windows Performance Toolkit per the tutorial and when booting up the first time I was presented with this BSOD right after the Windows boot animation finished.
Gathering a Startup, Shutdown, Sleep, Hibernate, or Reboot Trace-bsod-sdks.jpg
I got another at the second boot up about USB_BUGCHECK I believe was the error message. The third time no error message in the BSOD.


My System SpecsSystem Spec
15 Aug 2011   #7
ariel5345

7 professional
 
 

Hi. I am doing a clean install with Gregrockers guidance and help. I was going through the event logs and found boot delay, standby degradation, delays caused by usb stick, sleep and hibernation errors. It all seems to point to bios yet Greg refered me to you first. I have a Mutt Mobo from Hp which does not support Windows 7 drivers for my system. So it does make me nervous to flash bios with a Universal driver for Amd that I found.

I installed tool and ran all three traces. Boot trace delays 300 seconds (did it twice) 216Mb. Reboot trace ask for elevated permission before each 120 sec delay (did it three times... one time it quit trace due to an error) 241Mb.
Shutdown trace 28Mb.

However I did not leave in USB stick when doing trace.....which was causing part of the delay errors.

I will greatly appreciate any help. Yet, do help Britton first..... he is definitely priority. Just let me know if I need to redo traces w/stick plugged in.
Thanks.
My System SpecsSystem Spec
15 Aug 2011   #8
cluberti

Windows Server 2008 R2
 
 

Quote   Quote: Originally Posted by Britton30 View Post
If I need to find out why my PC is taking 187 seconds instead of the former ~66, do I need all three traces? Which forum do you want them in?
You would want just a boot trace. As to the BSOD, sometimes the +DRIVERS portion of the command line can cause it. If you get frequent BSODs when attempting to trace, remove "+DRIVERS" from the command line for a trace and that should avoid a BSOD when taking a trace.

Quote   Quote: Originally Posted by ariel5345 View Post
I installed tool and ran all three traces. Boot trace delays 300 seconds (did it twice) 216Mb. Reboot trace ask for elevated permission before each 120 sec delay (did it three times... one time it quit trace due to an error) 241Mb.
Shutdown trace 28Mb.

However I did not leave in USB stick when doing trace.....which was causing part of the delay errors.

I will greatly appreciate any help. Yet, do help Britton first..... he is definitely priority. Just let me know if I need to redo traces w/stick plugged in.
Thanks.
You only need a boot trace, unless you want to get info on the others. I would recommend, if a USB key causes additional delays, that you take a boot trace with a USB key in.


If you need help with traces, create a thread in the performance section and point me to it.
My System SpecsSystem Spec
15 Aug 2011   #9
Britton30
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

Ok thanks Cluberti, will do and let you know.
BTW, I did mean to say reboot in relation to those times.
Now I can't start the trace
Gathering a Startup, Shutdown, Sleep, Hibernate, or Reboot Trace-cmd-trace.jpg


My System SpecsSystem Spec
Comment

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




Tutorial Tools



Similar help and support threads for2: Gathering a Startup, Shutdown, Sleep, Hibernate, or Reboot Trace
Windows 7 Tutorial Category
Solved Computer freeze/BSOD/reboot after sleep/hibernate error 41 BSOD Help and Support
Laptop will not sleep, hibernate or shutdown BSOD Help and Support
Turn Sleep/Hibernate mode into Shutdown? Performance & Maintenance
Solved Seven BSOD Shutdown, Hibernate or sleep BSOD Help and Support
Leave On, Sleep, Hibernate or Shutdown Chillout Room
Newbie - Recordings and shutdown/sleep/hibernate Media Center

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 07:27 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33