Introduction and Case Studies.ppt
《Introduction and Case Studies.ppt》由会员分享,可在线阅读,更多相关《Introduction and Case Studies.ppt(56页珍藏版)》请在麦多课文档分享上搜索。
1、Introduction and Case Studies,Tate Calhoun Platforms Global Escalation Services Core Team,(Xperf),Agenda,What is Xperf?How does it work?What can it do? Case Studies!Where can I get it?,What is Xperf?,No application or driver is an island! Triaging system wide performance issues via multiple trace st
2、reams introduces complexity. Data must be aggregated, visualized, and understood to determine root cause. Xperf is the long term investment Microsoft is making to meet this diagnostic need.Support Engineer Trends/Challenges:1.) Memory.dmps are not getting smaller! (yet) 2.) Classic yet challenging a
3、pplication and system hangs, slow I/O, and other system wide issues 3.) User observation to code behavior. Stackwalking! 4.) The visualization of complex ETW data,What is Xperf?,An ETW controller and consumer Created by the Windows Fundamentals team Designed for analyzing system and application perf
4、ormance on Windows Vista, Windows Server 2008, and later.,What is Xperf?,Capture and analysis model follows this general flow:ETW tracing is enabled using xperf (or xbootmgr). Scenario of interest is performed. ETW tracing is stopped using xperf (or automatically by xbootmgr) and the data is saved t
5、o an ETL trace file. Trace files can then further be processed with xperf and/or viewed with xperfview. Traces can be processed on the machine on which they were taken, or copied to another machine for analysis (including cross-architecture). Everything needed for analysis is stored in the trace fil
6、e.,How does this work?,Performance Analyzer is built on top of the Event Tracing for Windows (ETW) infrastructure. ETW enables Windows and applications to efficiently generate events, which can be enabled and disabled at any time without requiring system or process restarts. ETW collects requested k
7、ernel events and saves to an etl file.Provides extensive details about the system. Context switches, interrupts, deferred procedure calls, process and thread creation and destruction, disk I/Os, hard faults, processor P-State transitions, and registry operations, etc.One of the great features of ETW
8、, supported in WPT, is the support of symbol decoding, sample profiling, and capture of call stacks on kernel events.,ETW Overview,ETW, or Event Tracing for Windows, is a high performance kernel level tracing system that made its first appearance in Windows 2000 and has found widespread use since. M
9、ost operations throughout the operating system that are interesting to a performance analyst are already instrumented. ETW is comprised of four key components: Providers: Components that generate events. They are instrumented with the ETW EventWrite() API. Sessions: Kernel objects that collect event
10、s into buffers and send those events to a file or directly a consuming application. Controllers: Programs that create and control sessions, and that control providers. Controlling providers consists of enabling and disabling events, or groups of events. Consumer: Programs that consume event data fro
11、m ETW sessions. The data can be consumed from a file, or in real time streaming mode. If you are interested in instrumenting your own applications, please see the ETW documentation in MSDN,ETW Components,ETW Advantages for Performance Tracing,Events can be enabled or disabled dynamically, no system
12、or process restartsBy default all events are disabled and the call to EventWrite() incurs a very minimal overhead just a flag check. This allows retail (shipping) code to be fully instrumented and enables tracing to be enabled in shipping components at any time. Even when enabled, event tracing has
13、a very low run-time overhead, even when large numbers of events are generated per second. Once begun, an ETW logging session has a defined maximum memory footprint. The disk footprint can be similarly limited. CPU load is directly proportional to the event rate and scales very well. Events from mult
14、iple providers, sessions and the kernel logger can be merged seamlessly when collected simultaneously on the same machine. This allows different kinds of events and settings to be used on different logging sessions and then merged together after the fact. The Windows kernel and multiple components a
15、re already extensively instrumented. ETW is the instrumentation method of choice on Windows.,Key Benefits to Support Engineers,1.) Lightweight/Non-Invasive, only about 2-3% CPU, 5% Memory, configurable. 2.) STACK TRACING! 3.) Independent Data Gathering vs. Analysis (Easily understatedthis is almost
16、like being able to share a live debug session) 4.) We are trying to move away from “how do I reproduce this problem internally?“ to “What was the problem and how to fix it“ 5.) A differenttemporal debugger?,More about stacks,In Vista+, stack walking can be enabled for certain kernel events. When com
17、bined with symbols on the processing side this extends analysis using system events to correlate back into the code context that triggered the corresponding event, from up in kernel mode to deep inside applications. This is a very powerful tool!,What can it do?,More and more each release and in the
18、upcoming Win7 beta releases of the tool you will see improved data capturing ability. For now, here are some scenarios that we have explored.1.) CPU Consumption and Scheduling Issues 2.) Storage Delay, Disk I/O Issues 3.) Power Management Events,Lets get started,Download and install of the tools (pr
19、eferably custom to c:xperf) and an elevated CMD. http:/ get started,Lets take a view of the advanced stackwalk options and other Kernel groups (xperf -providers K),Lets get started,Here are the stackwalk flags (xperf -help stackwalk),Lets get started,Any Easy Syntax to start out!?!Using the followin
20、g is a good head start and we see that massive customization is possible with stackwalk, etc.Xperf -on DiagEasyFor profiling issues to get stacks one can use:Xperf -on Latency -stackwalk Profile,Case Study 1 IE Hang,Xperf -on latency -stackwalk profile Repro IE Hang Xperf -d ielatency.etl(-d MergedE
21、TL Merge the ETL files of stopped logging sessions into MergedETL; if no session is stopped explicitly, the “NT Kernel Logger“ stopped implicitly.),Case Study 1 IE Hang,Case Study 1 IE Hang,Case Study 1 IE Hang,So we have spent a significant portion of time in MSHTML.DLL!CHtPvPv:LookupI happened to
22、have a dump of the process as well.,Case Study 1 IE Hang,Summary: Searching around this mshtml code, this is being reviewed via a Windows 7 bug. Unfortunately, we didnt have a repro at the time. I provided this etl trace to the team (with dumps and error reporting data) and the investigation continu
23、es!A great example of the portability advantages of this tool!,Case Study 2 Everything slow,Xperf -on latency -stackwalk profile Repro slowness Xperf -d WUlatency.etl Note overlay of Disk Utilization in the middle.,Case Study 2 Everything slow,So we have some activity here in cbscore.dll!CCbsPublicP
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- INTRODUCTIONANDCASESTUDIESPPT
