USB debugging innovations in Windows 8 Part 1: Overview

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.
Co- location Mass Market Managed Hosting ISV Hosting.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Announcing Demo Announcing.
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
demo Receive Inventory Export Parse and Normalize.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
announcing Dev Manager Do I understand what we’ve built? Developer Can I bet on using this shared component? Testers What’s changed since I last.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Developing Drivers in Visual Studio
Возможности Excel 2010, о которых следует знать
Understanding Wi-Fi Direct in Windows 8
11/8/2018 8:19 PM HW-98P Windows 8 kernel debugging: New protocols and certification requirements Tanya Radeva Program Manager Microsoft Corporation Joe.
Title of Presentation 11/22/2018 3:34 PM
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
Customizing WPA Trace Views
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Introduction to the new WPA user interface
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Delivering great hardware solutions for Windows
4/27/17, Bell #8 What amount of net pay has been earned this period?
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
5/8/2019 3:20 AM bQuery-Tool 3.0 A new and elegant way to create queries and ad-hoc reports on your Baan/Infor ERP LN data. This Baan session is a query.
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
WCL425 App Compat for Nerds Chris Jackson.
Advanced app and driver debugging
5/6/19, Bell #6 12/11/2019 8:26 PM Explain the relationship between this picture and the events that took place in Chapter 7 in Animal Farm. © 2007 Microsoft.
Presentation transcript:

USB debugging innovations in Windows 8 Part 1: Overview 11/9/2018 10:02 PM HW-258P USB debugging innovations in Windows 8 Part 1: Overview Yang You Program Manager Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda What USB Debugging tools are available to diagnose device and driver issues Learn about the USB 3.0 driver architecture Recap You’ll leave with an understanding of The tools available for debugging USB issues The USB 3.0 core drivers that can be examined with the tools

USB Debugging tools designed with device and driver developers in mind

Common USB Issues Diagnosing these issues require: Enumeration issues resulting in an “Unknown Device” Bugcheck during client driver interaction Power transition issues Performance issues Stuck transfers Diagnosing these issues require: Insights into the state of the USB controller and device Analyzing a record of the recent USB interactions Ability to filter information to focus on a device or transfer

Location Matters The right tools must be available to diagnose the issue On-Site: Hands on debugging Able to leverage kernel debugging tools, bus analyzers Off-Site: Crashdump Capture and analyze debug logs

Diagnosing USB issues with Windows 8 is faster with USB 3.0

With USB Debugger Extension + Event Tracing for USB 3.0 You can inspect internal USB core stack data structures to find out the state of the USB controller and the USB device You can view a recent USB WPP debug messages to determine what sort USB interactions led to an issue It’s easy to record and analyze USB transfers, including the full data payloads Add debugging events into your own device driver that can be correlated with events in the USB core stack

Understanding the USB 3.0 Drivers

USB 3.0 Software Architecture USB 3.0 Driver Stack xHCI Host Controller and Root Hub USBXHCI (xHCI Driver) UCX (Host Controller Extension Driver) Client Drivers USBCCGP WINUSB USBHUB3 (USB 3.0 Hub Driver) New components USBXHCI.SYS – KMDF function driver for the XHCI controller UCX01000.SYS KMDF driver to provide USB abstraction and validation of client requests USBHUB3.SYS KMDF bus driver built using formal interactive state machines to manage the state of the hubs, ports and devices including enumeration and power management Hardware Existing USB Stack Components USB 3.0 Stack Components Class or Vendor Drivers Legend

A new family of USB 3.0 debugging tools that let you diagnose USB device and driver issues more quickly

Reduce Development and Support Costs Diagnose USB driver issues faster by examining USB controller and device state with the USB 3.0 Kernel Debug Extension Troubleshoot USB device issues more easily by analyzing recent USB interactions using USB WPP and Event Tracing Leverage USB domain knowledge to reduce ramp up time with these tools

Further reading and documentation Learn more and watch demos in these follow up videos: USB Debugging Innovations: Part 2 - Kernel Debug Tools USB Debugging Innovations: Part 3 - Event Tracing USB Core Team Blog: blogs.msdn.com/usbcoreblog/

11/9/2018 10:02 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

USB Debugging Innovations in Windows 8 Part 2: Kernel Debug Tools 11/9/2018 10:02 PM HW-258P USB Debugging Innovations in Windows 8 Part 2: Kernel Debug Tools Eliyas Yakub Principal Development Lead Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda Understanding the key USB 3.0 data structures and drivers Examining the state of the USB 3.0 driver stack with the USB kernel debug extension Recap You’ll leave with examples of how to Use the USB kernel debug extension to view key USB data structures View a history of recent USB debug messages

A New Standard for USB XHCI is the standard eXtensible Host Controller Interface for USB 3.0 Backward compatible with USB 2.0 and 1.1 Devices Let’s review the standardized data structures that can be examined with the debugging tools

256 Device Context Base Address Array 255 Doorbell Array (256 Doorbell Registers) 1 xHCI Data Structures Slot Context EndPoint Context Enqueue Dequeue 31 Device Context 1 255 256 Device Context Base Address Array 1 2 TD Data TRB – Transfer Request Block TD – Transfer Descriptor TRB Transfer Ring T RANS F E R Command Ring TRB Event Ring

Debugging USB 3.0

What is the USB Kernel Debug Extension? New debugger extension USB3KD.DLL to debug the 3.0 core stack View the internal state of all three USB 3.0 components in a user friendly manner Available with the Windows Debugging Tools in the WDK

Debuggers Commands !usb_tree <optional 1> or !hub_tree !hub_info <DeviceExtension> !hub_info_from_fdo <DeviceObject> !device_info <DEVICE_CONTEXT> !device_info_from_pdo <DeviceObject> !port_info <PORT_CONTEXT> HUB !xhci_dumpall <1> !xhci_capability <DeviceExtension> !xhci_commandring <DeviceExtension> !xhci_deviceslots <DeviceExtension> !xhci_eventring <DeviceExtension> !xhci_registers <DeviceExtension> !xhci_resourceusage <DeviceExtension> !xhci_trb <trb_address> <count> !xhci_transferring <transferring_address> Controller !usbdstatus <URB_STATUS> !urb <UrbAddress> Misc !ucx_controller_list !ucx_controller <UCXCONTROLLER_PRIVCONTEXT> !ucx_device <UCXUSBDEVICE_PRIVCONTEXT> !ucx_endpoint <UCXENDPOINT_PRIVCONTEXT> Controller Extension

Learn how to use !xhci_dumpall !usb_tree !ucx_controller_list 11/9/2018 10:02 PM demo Key Debugger Commands Learn how to use !xhci_dumpall !usb_tree !ucx_controller_list © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

How do I view recent activities of USB3 drivers? RCDRKD.DLL is an always-on WPP debug message recorder A circular buffer to save errors and important device state changing operations Extended debugger extensions (RCDRKD.DLL) to view the logs For a particular device or endpoint TMF information needed to format WPP messages are available in PDB file RCDRKD.DLL is used to retrieve TMF information from the PDB file directly, parse and display the trace

View WPP Traces from the Debugger 11/9/2018 10:02 PM demo View WPP Traces from the Debugger Extract the TMF View and interpret WPP Recorder logs © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Reduce Development and Support Costs Diagnose USB driver issues faster by examining USB controller and device state with the USB 3.0 Kernel Debug Extension Troubleshoot USB device and host issues more easily by analyzing recent USB interactions using USB WPP Recorder logs Leverage USB domain knowledge to reduce ramp up time with these tools

Further reading and documentation Learn more and watch demos in these follow up videos: USB Debugging Innovations: Part 1 - Overview USB Debugging Innovations: Part 3 - Event Tracing USB Core Team Blog: blogs.msdn.com/usbcoreblog/

11/9/2018 10:02 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

USB Debugging Innovations in Windows 8: Part 3: Event Tracing 11/9/2018 10:02 PM HW-258P USB Debugging Innovations in Windows 8: Part 3: Event Tracing Philip Ries Software Development Engineer Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda What is USB Event Tracing (ETW)? What’s changed since Windows 7? Learn about the tools you can use to analyze USB event traces You’ll leave with examples of how to Record and analyze a USB event trace View correlated traces from multiple drivers in Netmon

USB event tracing gives you a recording of USB driver and bus activity with unprecedented detail

USB Event Tracing Leveraging the Event Tracing for Windows (ETW) Framework See what the USB controller and hub drivers are doing Errors encountered Transfers on the bus Control Transfers Device Enumeration Raw Data Power State Transitions Individual devices

Event Tracing: Windows 8 vs. Windows 7 USB 2.0 ETW Partial bus data USB 2.0 ETW USB 3.0 ETW Full USB bus data Activity ID

Recording an USB ETW Trace Start Tracing logman start usbtrace -ets -o usbtrace.etl -nb 128 640 -bs 128 logman update usbtrace -ets -p Microsoft-Windows-USB-USBXHCI Default logman update usbtrace -ets -p Microsoft-Windows-USB-UCX Default,HeadersBusTrace logman update usbtrace -ets -p Microsoft-Windows-USB-USBHUB3 Default,HeadersBusTrace /* Optional Keywords: PartialDataBusTrace, FullDataBusTrace */ <Reproduce Issue> Stop Tracing logman stop usbtrace –ets /* This creates a usbtrace.etl file in the current folder */ © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Viewing an ETW Trace with Network Monitor Network Monitor (Netmon) is a free tool that can be used to analyze USB ETW traces Custom parsers for USB 2.0 and USB 3.0 are available on Codeplex Using custom parsers, you can view events related to specific USB devices, add USB-specific columns, and apply filters

Diagnosing a USB Device Issue with ETW Demo Diagnosing a USB Device Issue with ETW

Relating Events in different layers Add ETW events to your applications and drivers for debugging Logs with multiple active applications that share the same device can be difficult to analyze How do you view the USB events generated by a particular application? Application A Application B USB Transfer A USB Transfer B UMDF Driver ? ? ? ? ? ? USB Core Stack

Correlating ETW Events with Activity IDs ETW events have an ActivityID field (16 byte Guid). WinUSB automatically assigns the Activity ID of an application’s thread to each USB transfer Activity ID is propagated into all related USB events Application A Application B USB Transfer A USB Transfer B UMDF Driver B B B A A A USB Core Stack

Viewing correlated event traces with Activity IDs Demo Viewing correlated event traces with Activity IDs

Reduce Development and Support Costs Collect ETW traces from your customers to diagnose USB issues remotely Use Netmon and USB parsers to analyze ETW traces quickly Add ETW events with activity IDs to your drivers and applications to improve debugging

Further reading and documentation Learn more and watch demos in these follow up videos: USB Debugging Innovations: Part 1 - Overview USB Debugging Innovations: Part 2 – Kernel Debug Tools USB Core Team Blog: blogs.msdn.com/usbcoreblog/ Bing: usb etw netmon Bing: Event Tracing (Windows) Bing: netmon parser

thank you Feedback and questions http://forums.dev.windows.com Session feedback http://bldw.in/SessionFeedback

11/9/2018 10:02 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.