26

ETW Session xPerfView xPerf 2. ETW contains a collection of configurable in-memory buffers 1. Any component that has been instrumented

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Hands-On Performance with the Windows Performance Toolkit

Erik HoltSenior Program Manager LeadMicrosoft Corporation

Objectives

Learn how to analyze systems in production environmentsLearn about the Windows® Performance Toolkit (WPT)Learn how to collect a performance traceLearn how to perform basic analysis of a performance trace

Agenda

Why performance mattersOverview of the Windows Performance ToolkitThe basics of using the Windows Performance ToolkitCase studiesCall to actionResources

Why Great Performance Matters

ResponsivenessUnresponsive systems lead to customer dissatisfaction

Shared resourcesResources are limited and shared, so use them effectivelyThe whole picture matters: CPU, storage, memory, network, and power

“Good citizenship”Just one bad component can reduce system performanceLots of money and years are spent developing software; ensure that your component doesn’t degrade the experience

Competition for Resources

Applications, services, drivers, and the operating system compete for these resources

Processor timePhysical memory space and virtual address spaceDisk service time and disk spaceNetwork bandwidthBattery power

Performance analysis starts with inspecting resources

Machine constraints = resource usage limits = user experience

Windows Performance Toolkit (WPT)

Official kitBuilt and used by the Windows organizationDistributed in the Windows SDKEULA allows the MSI to be redistributed

Wide support range Supported on Windows Vista® and later on both client and serverSupported on x86, x64, and IA64 processor architectures

Contains a variety of performance analysis toolsWPA includes xPerf and xPerfViewAlso includes GPUView and WPFPerf tools

Strategic Investment

Industry-wide OEM performance effortUsed in the Windows Logo Kit and in the Velocity toolkit

Used every day by the Windows engineering group to improve the performance of Windows componentsWindows 7 performance work

Puts into practice the lessons learned from Windows Vista

What Is in the WPT?

xperf Captures and processes traces

xperfviewDisplays trace data

xbootmgr and xbootmgrsleepCaptures on/off transition traces

hwpower2etwConverts test and data management software (TDMS) events to Windows event tracing logs (ETL) for analyzing power efficiency

symcachegenConverts PDB files into symcache files

Windows Performance Analyzer (WPA)

Tools for capture, post-processing, and analysis Very mature

10+ years in development 4th generationWritten in-house for Microsoft developersDocumented on MSDN

Very low overhead compared with other performance analysis tools

Why Use WPA?

Enables holistic performance analysis by analyzing:

All processes and threads in user mode and kernel modeDeferred procedure calls (DPCs) and interrupt service requests (ISRs)SchedulingDisk and file I/OMemoryNetwork

Helps analyze what the customer experiencesCatch the problem as it happensCapture anywhere, decode anywhere

WPA Can Help Analyze Root Causes

Lack of responsivenessLong delays in applicationsHigh CPU usageHigh disk usageSlow on/off transitionsPoor battery life

ETW

How WPA Works

ETL File

ETW SessionETW Event

Providers

Merged ETL File

XML File

System and

Symbol Info

xPerfView

xPerf

2. ETW contains a collection of configurable in-memory buffers

1. Any component that has been instrumented with the Event Tracing API can provide events

3. xPerf controls logging sessions and enables/disables providers to make an ETL file

6. GUI trace analysis is done via graphs and summary tables built from the Merged ETL file in xPerfView

5. CLI trace analysis can be done via actions using xPerf. An XML file can also be produced

4. Metadata is gathered and injected when the trace capture is stopped

Why WPA Is Non-Intrusive

Event Tracing for Windows (ETW) makes WPA non-intrusiveETW has been a core component since Windows 2000ETW has very low overhead

~2.5% CPU usage for sustained rate of 10,000 events/sec on a 2GHz CPU

Comparison of WPA and Performance Monitor

WPA

Ships separatelyAnalyzes random eventsUsed for short periods of timeBased on ETW eventsDesigned for reactive analysis

Performance Monitor

Ships in WindowsTakes snapshots of the system stateUsed for long periods of timeBased on performance countersDesigned for long-term monitoring

These are complementary technologies

New Features in WPT 4.8

Search in summary tablesMemory analysis: pool, heap, CONTMEMGENEnergy efficiency analysis

Disk idle analysisImprovements to the CPU idle histogram analysis

Spinlock analysis256-processor supportCustomizable summary table layout UI profilesSelection-based filtering in summary tables

How to Get the WPT

Download from the Windows Performance Analysis Developer Centerhttp://msdn.microsoft.com/enus/performance/default.aspx

The Full Windows SDK

Download Only the Components You Need

Performance Analyzer Preview

demo

Summary of Disk Usage Case Study

Multiple components that work well in isolation can impact performance when executed in parallelDisk contention dramatically impacts performance for all involved components

Disk seeks can cut throughput by 90%

Schedule all work that can wait as idle tasks

See “Task Scheduler” documentation on MSDN@ http://msdn.microsoft.com/enus/library/aa383614(VS.85).aspx

Summary of DPC Case Study

One bad component can disrupt numerous good componentsHigh usage of any single resource can cause performance issuesSpending too much CPU time for DPCs impacts performanceUse Direct Memory Access (DMA) instead of Programmed I/O (PIO) when transferring data

See “DMA” on MSDN@ http://msdn.microsoft.com/en-us/library/aa447493.aspx

Best Practices

Make sure UI remains responsiveLet the user know what is happening and how long a requested action will takeRemember: A responsive UI helps customers stay satisfied with the product

Focus on resource utilization and efficiencyUse WPA to understand how the CPU, disk, memory, network, and battery are being usedCapture traces across entire user scenarios

Make sure your software practices good citizenship

Call to Action

Download the Windows Performance ToolkitInvest in ETW instrumentation in your applications, drivers, and servicesVisit Windows Performance Analysis Dev CenterVisit the WPT public forum and ask plenty of questionsFill out the evaluation form for this presentation

Resources

Windows Performance Analysis Dev Centerhttp://msdn.microsoft.com/en-us/performance

Documentation about Event Tracing for Windowshttp://msdn2.microsoft.com/en-us/library/aa363787.aspx

Public forum for the WPThttp://social.msdn.microsoft.com/Forums/enUS/wptk_v4/threads

Windows Internals For details, see “Event Tracing” on MSDNhttp://msdn.microsoft.com/enus/library/bb968803(VS.85).aspx

© 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.