380 likes | 608 Views
PC50. Using Instrumentation And Troubleshooting To Develop High-Quality Software. Ricky Buch Program Manager Microsoft Corporation. Kevin Michael Woley Program Manager Microsoft Corporation. Agenda. Solving software problems in Windows
E N D
PC50 Using Instrumentation And Troubleshooting To Develop High-Quality Software Ricky Buch Program Manager Microsoft Corporation Kevin Michael Woley Program Manager Microsoft Corporation
Agenda • Solving software problems in Windows • Instrumentation and Troubleshooting platform • Windows Instrumentation • Event and Counter platform • Windows 7 improvements • Design principles • Windows Troubleshooting • Key Features • Architecture • Deployment
Software Problems • When software is inconsistent with expectations • Why are software problems bad? • Lower customer satisfaction • Reduced profit • Software problems can be caused by • Design Issues • Configuration conflicts
Solving Software Problems • Address in standard, structured way • Minimize development cost • Programmatic analysis • Enable problem detection and resolution • Windows provides two platforms that address above criteria • Instrumentation Platform • Troubleshooting Platform
Windows Instrumentation: Performance Counters And Events Kevin Michael Woley Program Manager Microsoft Corporation
Instrumentation Overview • The purpose of instrumentation • Diagnose and debug problems • Manage and maintain software • Instrumentation is used by • Developers • Ex: Measuring performance of an application • System administrators and IT Professionals • Ex: Determining system workload characteristics Instrumentation exposes internal OS and application state in a discoverable, easily consumable, standardized way
Windows Instrumentation • Key Features • High-performance, low overhead, highly scalable • Native and Managed APIs • Dynamic enablement of data collection • Data delivered in real-time or persisted in files Applications can make use of both Performance Counters and Events
demo Instrumentation Consumption Kevin Michael Woley
Windows Event Overview Common API Set and Development Model
Performance Counter Improvements In Windows 7 • New Version 2.0 Kernel Mode APIs • Declaratively defined in XML • Leverages Version 2.0 infrastructure from Vista • Fundamental Quality Investments • Enhanced performance, scalability, and robustness • Several new system counters exposing Windows internals • Improved design-time validation • Scriptable Consumption using PowerShell • Consume live counters (get-counter) • Read and write counter log files (import-counter/export-counter)
ETW/Event Log Improvements In Windows 7 • Fundamental Quality Investments • Enhanced performance, scalability, and robustness • Several new Windows events and event providers • Event Development • Improved design-time validation • Automatically generate code from XML • Event Consumption • Scriptable consumption using PowerShell (get-event) • Discover and read ETW or Eventlog events locally or remotely • Portable event log file decoding • Improved data formatting • Windows Performance Toolkit Improvements
Instrumentation Design Considerations • Design for the appropriate audience • Provide meaningful event messages and counter descriptions • Provide actionable events and counters for System Administrators and IT Professionals • Use recommended interfaces • Performance Counters Version 2.0 • Managed – System.Diagnostics.PerformanceData • User Mode – PerfSet*(), PerfIncrement*(), etc. • Kernel Mode – PcwRegister(), PcwCreateInstance(), etc. • Manifest-based ETW and Event Log APIs • Managed – System.Diagnostics.Eventing • User Mode – EventWrite(), etc. • Kernel Mode – EtwWrite(), etc. Design your application’s events and counters with a goal in mind
Generate Code 3 .rc Build 5 New Provider Create Instrumentation Manifest (ECMangen) XML Manifest CTRPP / MC preprocessors .c Build Instrumentation Definition 2 .h New provider code Instrument provider APIs Instrument 4 Windows Instrumentation Design Workflow Win7: Event Logging Code Generation & Improved Manifest Validation 5 Steps Design 1 Design
demo Instrumentation Implementation Kevin Michael Woley
Windows Troubleshooting Ricky Buch Program Manager Microsoft Corporation
Windows 7 Troubleshooting Approach • Automating Troubleshooting • Spend less time fixing problems • Deflect calls or reduce minutes-per-incident • Different types of software problems • Design issues • Configuration conflicts • Troubleshooting configuration • Verify if desired user state can be supported • Set configuration to support desired state Troubleshooting is the process of detecting and resolving a problem
Windows 7 Troubleshooting Implementation • Windows 7 troubleshoots configuration problems using Troubleshooting Packs • A Troubleshooting Pack is a program that • Launched by the user or an application • Detects and resolves configuration issues • Verifies that configuration has been set properly Troubleshooting Packs detect and resolve configuration problems
demo Troubleshooting Pack – UI Ricky Buch
End-User Troubleshooting Features • Easy to Discover • Inbox or online help documentation • Windows Troubleshooting Interface • Simple to Execute • Each pack uses a standard wizard user interface • Single-click problem resolution • Secure • Signed by a certificate to ensure pack integrity
System-Administrator Troubleshooting Features • Easy to Deploy • Deploy as .cab files onto a file share or website • Flexible Execution • Run interactively or in unattended mode • Run on local or remote machines • Secure • Signed by a certificate to ensure pack integrity • Group Policy can control which packs can execute
demo Troubleshooting Pack – PowerShell Ricky Buch
Developer Troubleshooting Features • Easy to Develop • Packs use Windows PowerShell • Detection, resolution and verification code • Capturing user input and relaying progress • Can be deployed with application • Simple to Debug • Errors and exceptions from PowerShell scripts captured in a debug report • Secure • Signed by a certificate to ensure pack integrity
Architecture Overview • Troubleshooting Pack consists of metadata and script files • Troubleshooting Platform executes the Troubleshooting Pack • Leverages the PowerShell runtime to execute scripts • Interacts with the GUI or command-line • Generates reports for analysis GUI CMD Troubleshooting Platform Trouble-shooting Packs Reports PowerShell
Diagram Of A Troubleshooting Pack • Name and description • List of configuration issues • Security signature • Checks current configuration with expected configuration • Sets the current configuration to what is expected • Verifies that current configuration is now what is expected • Contains localized display strings in MUI format Identification Metadata Detection Scripts Trouble-shooting Pack Resolution Scripts Verification Scripts Localized Resources
Diagram Of Component Interaction Identification Metadata • Detect a problem • Get input from user • Provide progress • Write to the report GUI CMD Detection Scripts Troubleshooting Platform PowerShell Runtime Resolution Scripts Verification Scripts Reports Localized Resources
Authoring Troubleshooting Packs • Identify configuration issues • Develop troubleshooting PowerShell scripts • Troubleshooting toolkit • Graphical authoring environment • Links to Graphical PowerShell editor • Signs each pack with a certificate • Packages the Troubleshooting Pack for deployment
demo Troubleshooting Pack Authoring Ricky Buch
Deploying Troubleshooting Packs • Windows will • Ship critical packs inbox • Target additional packs using Windows Online Troubleshooting Service • You should • Ship troubleshooting packs with your client software • Post troubleshooting packs online • Link to packs from your help documentation Troubleshooting Packs offer multiple deployment options.
Solving Software Problems • Windows Instrumentation and Troubleshooting Platforms provide • Centralized, standard, structured platforms to improve manageability • Consistent ways to debug and diagnose software problems • Detection and resolution of configuration problems
Call To Action • Review and revise your existing debugging techniques • Add or upgrade existing debug messages with the appropriate Windows Event or Performance Counter technologies • Review “An Overview of Windows Troubleshooting” whitepaper • Develop and deploy an appropriate troubleshooting pack with your application
Related Content • Additional software quality sessions on video • Driving for software quality through customer feedback • Developing compatible applications for Windows • Hands On Analysis with Windows Performance Toolkit • Best practices for signing and verifying code on Windows 7 • Meet us at the Windows Fundamentals booth!
Evals & Recordings Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com
Q&A Please use the microphones provided
© 2008 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.