Windows Performance Analyzer

0 views
Skip to first unread message

Gwenda Arguin

unread,
Aug 5, 2024, 7:57:15 AM8/5/24
to unraijuxdo
Anywaywhen I finished, I was prompt to open the Trace result (*.etl file), and by default it has been open in Windows performance analyzer. I can see that something has been recorded, but non of symbols are available

I do think you will prefer the Graphical Interface method of doing this , but the site where it is hosted is going to close down at some point. So I will be attaching a link to the download, in case it becomes a lost web site.


Actually there are a couple of tools we should be aware of. So this article is about Ways to Use Xperf to collect logs for support evaluations. Specifically, I am calling out three ways; the command line, The Core Windows Recorder, and two additional tools.


So all of these tools will require xperf to be installed. this is part of the Windows performance tool kit. this also contains windows performance recorder and analyzer. The truth is you can just run the windows performance recorder, and this will achieve the objective of this article. But, you cant just let the recorder run, in perpetuity. There is a hit to the system for running it, and it will eventually fill up your hard drive.


Not that these other tools have methods which are any better. The main thing you need to know, is you must monitor resources and know when to start and stop these tools your self. They can be dangerous if not used by an IT person with experience. The bottom line is use caution!


Now to the meat of the show. Two Tools I think you may find helpful. XPerf123 and the Clue tool. Clue is Collection of logs and the User Experience. Xperf123 is at codeplex, but they say codeplex is closing. I will not include links to their site. I will have a copy of the tool in this article. Xperf123 Download


So how do I use it????

1. Follow the wizard interface of the tool.

2. From the drop down menu, select the kind of trace you want to capture.

3. Click on Start button.

4. Reproduce the issue.

5. Click on Stop button.

6. The file is will be created in the same location as the XPerf123.exe


Unless necessary, the General option should be able to get all the required information.

The program is designed to auto elevate, but if not getting the required results, please try running it as an administrator.

For reviewing XPerf logs, we need the xperfview.exe.




And we are done. Click Start to start the captureCLUE TOOLNow we have one tool left. This is the newest I have seen. This tool will collect logs when there is a problem on the system. This could be a good tool to use under some circumstances.This tool is the CLUE tool:Clue stands for Collection of Logs and the User Experience. This tool is an automated way to collect the logs only when the issue is occurring. This is helpful, because the log collection itself can be part of a slowness or latency problem


LinkedIn and 3rd parties use essential and non-essential cookies to provide, secure, analyze and improve our Services, and to show you relevant ads (including professional and job ads) on and off LinkedIn. Learn more in our Cookie Policy.


Why the CPU utilization is near to 100% on my server machine? Why there is a steady decrease in the available memory? Why the calls are getting dropped? We often get these kinds of questions If we are from a performance upkeep team. And most of the times we do not know the answers of any of those questions. Fortunately, now, Microsoft has come for our rescue with Microsoft performance toolkit. Using this toolkit, you can answer which API / function of your server consumes high percentage of CPU time. You can answer which function is leaking memory, where the network is getting stuck. You can track almost all the OS resources like disk I/O, File I/O, Power usage, GPU activity, audio, video and many more. In this article we will see how to use the windows performance tool kit to do high CPU utilization analysis and memory leak analysis.


Windows performance toolkit has two main components: Windows Performance Recorder (WPR) and Windows Performance analyzer(WPA). Windows performance recorder is used to record windows session. It can record all activities / events and resource consumption for the current session. The collected data is then stored in a file. Windows performance analyzer is used to analyze the data collected by WPR.


In the following program functions highCPU(), midCPU() and lowCPU() are CPU bound functions. The names given to these functions indicate the level of CPU usage. Function memoryLeak() leaks some memory allocated on heap. This function is used to demonstrate the memory leak analysis. First, start recording session using windows performance recorder (WPR) and then start executing the following program. Once the program finishes execution stop the recording and open the recorded file in windows performance analyzer.


Windows Performance Analyzer (WPA) is a tool that creates graphs and data tables of Event Tracing for Windows (ETW) events that are recorded by Windows Performance Recorder (WPR), Xperf, or an assessment that is run in the Assessment Platform. WPA can open any event trace log (ETL) file for analysis.


Double click on the .etl file generated by WPR, it will open that file in WPA. In the WPA on the left-hand side you can see a graph explorer window. By default, you can see an empty analysis view is opened. If not, then go to top menu bar Windows->New Analysis View to open analysis view.


The first thing you should do before starting any analysis is that you should configure symbol paths for your exe / server. To do that click on Trace->Configure Symbol Paths. In the opened dialog box add path to the .pdb files of your application.


On the Analysis tab, you can select a time interval by dragging the pointer horizontally across a section of the graph. The timeline at the bottom of the tab applies to all graphs on the tab.


After you have selected a time interval, you can zoom in to expand that time interval to the full width of the Analysis tab. To do this, right-click the interval, and then select Zoom to selected time range. You can repeat this step several times to see very fine detail of a very small time interval.


In our case, for the poorperformance.exe file, If you zoomed in you will see that the highCPU() was the main culprit for high CPU usage. Please see the image below, the highlighted sky blue color shows the overlap between CPU utilization graph and the time period for which the highCPU() was in execution. This is how you can find out the functions which are responsible for the high CPU usage.


In the zoomed graph you can see that the spike in the memory consumption is due to memoryLeak() function. And, as the memory is not getting released even after the function finishes its execution it shows that there are memory leaks in the memoryLeak(). This is how one can do the memory analysis.


Ozone is a full-featured graphical debugger for embedded applications. With Ozone it is possible to debug any embedded application on C/C++ source and assembly level. Ozone can load applications built with any tool chain / IDE or debug the target's resident application without any source. Ozone includes all well-known debug controls and information windows and makes use of the best performance of J-Link and J-Trace debug probes. The user interface is designed to be used intuitively and is fully configurable. All windows can be moved, re-sized and docked to fit the need of any developer.


Ozone is more than a simple debugger. Its various features, including trace, code profiling and code coverage analysis make it a powerful performance analyzer, enabling you to get full system insight, to track down inefficiencies and bugs, and to make your products even better.


Ozone can be used with any toolchain that generates Elf/Dwarf debug information for its output. The list of tested toolchains and IDEs includes Embedded Studio, and other GCC and GCC-based IDEs, clang/LLVM and Arm Compiler.


In combination with J-Trace, Ozone can record and analyze the runtime behavior of your application. You can step back through the executed instructions to see what your system did last and to visualize, in a timeline, the function and interrupt call path. Additionally, the execution is analyzed to provide a complete code coverage and profiling analysis.


With J-Link's High-Speed Sampling technology, Ozone allows you to sample and visualize your system's variables over time and to easily check values and flags in the debugger, while the target keeps running.


J-Link's power measurement features enable you to record the power consumption of your target device in a debug session. This is especially helpful when you develop a low-power device and need to know how power consumption changes when you enable or disable certain components.


All performance analysis windows can be synchronized to get the link between them. Want to know why your error flag was set? Check the Data Graph and Instruction Trace windows. Want to see what happens when you turn on the display? Take a look at the Timeline and Power Graph.


With its RTOS awareness, Ozone provides you with information about the OS of your application: In which task did the system halt? What are other tasks currently doing? How much stack does each task use?


Ozone projects feature a C-like scripting language that allow you to configure the graphical user interface and to automate the debugging work flow. Most actions that are accessible with the GUI have an affiliated script function that can be evoked from your project script or manually from the debuggers console window.


In a project file you can use various event handlers to perform your actions on certain events, such as on debug start, before download, after reset, or on halt and go. You can also add event handlers to your breakpoints. Using this functionality, you can configure consistent, comprehensive verification and debug setups. This enables automated tests that simply work without user interaction.

3a8082e126
Reply all
Reply to author
Forward
0 new messages