Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Microsoft Xperf monitors Windows performance

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how Microsoft Xperf monitors Windows performance. The article is very detailed and has certain reference value. Interested friends must read it!

Xperf is an advanced troubleshooting tool that can debug performance issues at a level Perfmon cannot. It is part of the Windows Performance Toolkit (WPT), which is part of the Microsoft Software Development Kit (SDK). Xperf is a complement to Event Tracing for Windows (ETW). ETW is a built-in component of the server operating system that provides detailed system performance and system data.

Xperf tools address issues such as system response issues, slow start-ups, high CPU and disk utilization, application latency, and slow response. It supports cross-platform usage on x86, x64, and IA-64 platforms at less than 2.5% CPU usage while collecting more than 20000 system events per second.

In other words, this is a tool you would definitely add to your toolbox. But before we dive into the many features Xperf has to offer, let's first take a look at a short tutorial on how to install Xperf and how to use it to debug various Windows system performance issues.

Install Xperf

As mentioned earlier, the Windows Performance Toolkit (WPT) is released with the Windows Software Development Kit (SDK). Before installing the SDK, you must first install Microsoft. NET Framework 4. Unless you want to install the entire SDK up to 4GB, you should only select Windows Performance Toolkit and Windows Debugging Tools, as shown in Figure 1.

You should also select the WPT and Debugging Tools options under the Redistributable Package so that you can install and use a tool separately later without having to reinstall the SDK. Windows Performance Suite and debugging tools resulting from the installation can be found at:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Redist\Windows Performance Toolkit

Figure 1: Windows SDK installation options

If you encounter problems with the SDK installation process, you can refer to this troubleshooting page for help, such as cleaning up files in the AppData\Local\Temp directory (which I often need to do). After installation, a new program group will be created for WPT, as shown in Figure 2. Related tools are located in the following directory:

C:\Program Files\Microsoft Windows Performance Toolkit

Figure 2: Windows Performance Toolkit Assemblies

Configuring and using Xperf

After installing WPT (Xperf) on the server in question, the next step is to start collecting event trace information. Depending on the problem you encounter, you can track and collect a large number of events. We can start with the following CLI command for Xperf:

Xperf –on DiagEasy

This command collects several kinds of kernel events, including PROC_THREAD, LOADER, DISK_IO, HARD_FAULTS, DPC, INTERRUPT, CSWITCH, and PERF_COUNTER, and logs the data to a log file called kernel.etl. To list all kinds of kernel events, use this command:

Xperf –providers KG

Note: Rich online help explains each event in detail

Once you have started collecting event data, have the server reproduce the problem you are going to debug, and then end the collection with the following command:

Xperf –d trace.etl

This merges the data cached in kernel.etl and eventually creates a trace log file named trace.etl. Trace log files can be debugged either on the server in question or on another server with WPT installed. To view the resulting graphs and charts, use this command:

Xperf trace.etl

The trace file will be processed in two steps to produce various graphs. Default graphics include:

Utilization by CPU

CPU Usage by Process

CPU Usage by Thread

CPU idle state

Disk I/O, Disk Usage

Disk Usage by Process

Process life cycle

CPU Usage for DPC

CPU usage interrupted

hardware failure

Other Common Events

Hover the mouse pointer over a particular line in the graph and you can see more details, such as the names of processes that consume all CPU time. For example, in Figure 3 you can clearly see how the antivirus program Rtvscan.exe consumes CPU.

Figure 3: CPU Usage-Progress Chart

Another convenience of using Xperf is that you can zoom in on a graph within a certain time range to see the graph in that area more clearly. In Figure 4, you can see a spike in disk occupancy after the first 60 seconds. Click and drag that part of the graph with the mouse pointer, then right-click and select Zoom To Selection to zoom in on the time area where the problem occurred. This will produce a new graph containing the time zone you specify. To return to the original image, right-click and select Unzoom.

Figure 4: Xperf's zoom function

For more detailed information, right-click on the graph and select Summary Table. This produces a chart that records all the counters and data associated with the graph. For example, Figure 5 shows a summary of the disk I/O graph. The *** line in the table clearly shows that the Rtvscan.exe process does a lot of reads, which means it is scanning for viruses.

Figure 5: Disk Summary Table for Disk I/O Graph

That's all for "How Microsoft Xperf monitors Windows performance." Thanks for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report