We are excited to introduce version 2.1.0 of the WindowsPerf Visual Studio Extension, now available on the Visual Studio Marketplace. This update brings several new features aimed at enhancing performance profiling on Windows on Arm devices. The extension is fully compatible with WindowsPerf version 3.7.2, a tool inspired by Linux Perf but optimized for Windows on Arm systems.
You can easily install the tool directly from the Visual Studio Marketplace or through the Visual Studio IDE by navigating to "Extensions > Manage Extensions…" and searching for "WindowsPerf GUI."
Note: To install WindowsPerf 3.7.2 on your Windows on Arm system follow steps described here.
While the command line interface of WindowsPerf is powerful, it can be intimidating for many users. The WindowsPerf GUI was designed to offer a more intuitive, user-friendly experience, enabling developers to adjust settings, run profiling, and visualize results directly within Visual Studio.
Windows Performance Analyzer (WPA) is a tool designed to create detailed graphs and data tables from Event Tracing for Windows (ETW) events. WPA can process any event trace log (ETL) file for in-depth analysis.
WPA capabilities can be expanded upon using the Microsoft Performance Toolkit SDK by creating plugins which enable parsing any type of data (WindowsPerf JSON output in our case).
The counting model provides an overall performance statistic for a program. This model can be attached to a currently running process, initiated with a new process, or even set to monitor the entire system. It returns an aggregated count of selected events, event groups, and metrics. This model is implemented in WindowsPerf user space through the command "wperf stat" and using the "--json" flag it returns the data in a JSON format that can be exploited by the extension.
The latest update integrates a "wperf stat" command builder within the GUI.
For more information, check out our Counting Settings Tutorial.
WindowsPerf GUI Counting Settings window with example counting results and launched WPA-plugin in WPA.
One of the critical aspects of performance profiling is ensuring that the data collected is accurate and free from interference. When WindowsPerf communicates with its Kernel Driver, the driver automatically acquires a lock, preventing other instances of WindowsPerf from accessing the driver and its resources. This locking mechanism is essential for protecting the integrity of the current WindowsPerf execution, ensuring that no other processes can interfere with the ongoing profiling session.
However, this also means that if another WindowsPerf process has locked the driver, any new attempts to use WindowsPerf will be blocked, and users will receive an error message indicating that access has been denied:
"warning: other WindowsPerf process acquired the WindowsPerf-driver. Operation canceled!"
In order to force the release of the lock, a new --force-lock command argument was introduced to both WindowsPerf and the extension that lets you interrupt the ongoing WindowsPerf process and take over the lock.
However, interrupting a running `wperf` process would result in losing all the collected data. If interrupted, WidowsPerf will show the following error message:
"warning: other WindowsPerf process hijacked (forced lock) the wperf-driver, see --force-lock. Operation terminated, your data was lost!"
"Received ERROR_BAD_COMMAND, driver status:
STATUS_INVALID_DEVICE_STATE
error: PMU_CTL_LOCK_RELEASE can't be release"
The addition of disassembly support in the WindowsPerf extension represents a significant enhancement for developers who require deep insights into performance bottlenecks within their code. Disassembly support allows users to examine the specific instructions executed by the CPU, providing a detailed view of performance hotspots at the instruction level. This level of analysis is crucial for optimizing code, as it enables developers to identify the exact points in their codebase where performance issues arise.
Explore how to leverage this powerful feature in our Sampling Explorer Tutorial.
A new "Build and Run" button has been added to the extension, providing a seamless way to ensure that all performance tests are conducted on the latest version of your code. This feature simplifies the testing process, reducing the risk of analyzing outdated code and ensuring that performance profiling always reflects the most current state of the project.
Several user experience improvements have been implemented to make the extension more intuitive and user-friendly. These include a case-insensitive event search feature, which allows users to find events more easily regardless of the case used in their search terms. Additionally, tooltips have been added to certain icon buttons, providing users with helpful information when they hover over these elements. These enhancements are designed to streamline the user experience, making it easier for developers to navigate the extension and access the features they need.
We're committed to continuously improving the WindowsPerf Visual Studio Extension. Future updates will include alignment with the latest WindowsPerf releases, better support for telemetry solutions, and enhanced lock/unlock functionality. Stay tuned for more!
The extension is open sourced and freely available under the BSD license.
Saemie is the Chief Technology Officer (CTO) at Day Devs, with a background in application development and software engineering since 2010. Passionate about the latest advancements in artificial intelligence, he is dedicated to finding where AI truly excels. His main focus is the chip industry, and he is excited about its future innovations and possibilities.
See All Works