Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/install-guides/windows-perf-wpa-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles

## What is the Windows Performance Analyzer plugin?

The Windows Performance Analyzer (WPA) plugin connects [Windows Perf](/learning-paths/laptops-and-desktops/windowsperf/) to the Windows Performance Analyzer. Windows Perf is a lightweight performance profiling tool inspired by Linux Perf and designed for Windows on Arm.
The Windows Performance Analyzer (WPA) plugin connects [WindowsPerf](/learning-paths/laptops-and-desktops/windowsperf/) to the Windows Performance Analyzer. Windows Perf is a lightweight performance profiling tool inspired by Linux Perf and designed for Windows on Arm.

Windows Performance Analyzer is a useful tool that supports developers with diagnostics and performance tuning. It generates data tables and graphs of Event Tracing for Windows (ETW) events, which are recorded in one of three ways:
- Windows Performance Recorder (WPR)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Get started with WindowsPerf WPA Plugin
title: Get started with the Windows Performance Analyzer (WPA) plugin for WindowsPerf

draft: true
cascade:
draft: true

minutes_to_complete: 15

who_is_this_for: This is an introductory topic for software developers working on laptops and desktops and new to the Arm architecture.
who_is_this_for: This is an introductory topic for software developers interested in using the Windows Performance Analyzer (WPA) plugin for performance analysis.

learning_objectives:
- Install WindowsPerf WPA Plugin on Windows
- Import a WindowsPerf counting timeline as a .json file in WPA
- Visualize the timeline in WPA using the Windowsperf WPA Plugin
- Import WindowsPerf data as a .json file in WPA.
- Visualize the timeline and telemetry data in WPA using the WPA plugin.

prerequisites:
- Windows desktop or development machine
- Windows Performance Analyzer installed
- WindowsPerf WPA Plugin installed
- (Optional) [WindowsPerf](/install-guides/wperf/) installed on a WoA machine [(Installation guide)](/install-guides/wperf/)
- A Windows on Arm laptop with WindowsPerf, Windows Performance Analyzer (WPA), and the WPA plugin installed.

author_primary: Alaaeddine Chakroun

Expand All @@ -23,7 +23,7 @@ skilllevels: Introductory
subjects: Performance and Architecture
armips:
- Cortex-A
- neoverse
- Neoverse
operatingsystems:
- Windows
tools_software_languages:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
next_step_guidance: Now that you have an idea of how the WindowsPerf WPA Plugin works, You can try exploring the WindowsPerf CLI for more flexibility.
next_step_guidance: Now that you have an idea of how the WindowsPerf WPA plugin works, You can try exploring the WindowsPerf CLI for more flexibility.

recommended_path: "/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
# ================================================================================
# Edit
# ================================================================================

# Always 3 questions. Should try to test the reader's knowledge, and reinforce the key points you want them to remember.
# question: A one sentence question
# answers: The correct answers (from 2-4 answer options only). Should be surrounded by quotes.
# correct_answer: An integer indicating what answer is correct (index starts from 0)
# explanation: A short (1-3 sentence) explanation of why the correct answer is correct. Can add additional context if desired


review:
- questions:
question: >
The WPA plugin connects WindowsPerf to the Windows Performance Analyzer.
answers:
- "True"
- "False"
correct_answer: 1
explanation: >
The Windows Performance Analyzer (WPA) plugin connects WindowsPerf to the Windows Performance Analyzer.

- questions:
question: >
Which views can WPA display
answers:
- "Timeline"
- "Telemetry"
- "Function profile"
- "Timeline and telemetry"
- "All of the above"
correct_answer: 3
explanation: >
WPA can display both the timeline and the telemetry views.

- questions:
question: >
WindowsPerf can output data in JSON format with `--json` command line option.
answers:
- "True"
- "False"
correct_answer: 1
explanation: >
Some `wperf` commands such as `list`, `test` or `stat` can output data in JSON format.


# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
title: "Review" # Always the same title
weight: 20 # Set to always be larger than the content in this path
layout: "learningpathall" # All files under learning paths have this same wrapper
---
Original file line number Diff line number Diff line change
@@ -1,93 +1,104 @@
---
layout: learningpathall
title: WindowsPerf WPA Plugin
title: Visualize data from WindowsPerf using WPA
weight: 2
---

# Overview
## Before you begin

WindpwsPerf WPA plugin is a plugin built for WPA that parses JSON output of `wperf` command line tool to visualize counting and telemetry events as timeline graphs.
The Windows Performance Analyzer (WPA) plugin connects WindowsPerf to the Windows Performance Analyzer.

[**WindowsPerf**](https://github.com/arm-developer-tools/windowsperf) is a lightweight performance profiling tool inspired by Linux perf, specifically tailored for Windows on Arm.
It leverages the ARM64 PMU (Performance Monitor Unit) and its hardware counters to offer precise profiling capabilities.
The [WindowsPerf WPA plugin](https://github.com/arm-developer-tools/windowsperf-wpa-plugin) bridges the gap between the detailed output of **WindowsPerf** and the powerful capabilities of [Windows Performance Analyzer](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer).
Before trying WPA with the WPA plugin, you need to install the following software on your Windows on Arm computer:

## WindowsPerf WPA Plugin releases
- [WindowsPerf](/install-guides/wperf/)
- [WPA plugin](/install-guides/windows-perf-wpa-plugin/)

You can find all binary releases of `WindowsPerf WPA Plugin` [here](https://github.com/arm-developer-tools/windowsperf-wpa-plugin/releases).
The WPA plugin install guide includes the installation of WPA.

# Installation
## Using WindowsPerf data in WPA

For installation instructions see the [install guide](/install-guides/windows-perf-wpa-plugin).
In order to use WPA with WindowsPerf, you need to create a `.json` file which is created from a WindowsPerf `wperf stat` command running on a Windows on Arm machine.

## Using WindowsPerf WPA Plugin
You can save a `.json` output from WindowsPerf by using the `--output` command followed by the filename.

In order to use the `WindowsPerf WPA Plugin`, we first need to get a `.json` output from a WindowsPerf `wperf stat` command running on a Windows on Arm machine.
{{% notice Note%}}
In order to get a `.json` output from WindowsPerf, we need to use the `--output` command followed by the filename.
{{% /notice %}}
1. Create a `.json` file

Example:
To create a file named `example.json`, run the following command:

```command
wperf stat -e ld_spec --output example.json
```
```console
wperf stat -e ld_spec --output example.json
```

2. Open Windows Performance Analyzer, and see the following window:

Upon opening Windows Performance Analyzer, we are greeted with the following window:
![wpa-first-screen](figures/wpa-first-screen.png)
![wpa-first-screen #center](figures/wpa-first-screen.png)

As we can see, the `WindowsPerf WPA Plugin` is installed correctly and it appears under the Installed Plugins section. We can then click on "Open file..." from the start menu on the left side and we're prompted to choose a `.json` file.
Confirm the `WindowsPerf WPA Plugin` appears under the Installed Plugins section.

![wpa-open-file](figures/wpa-open-file.png)
3. Open the `.json` file

By clicking "Open", the output file is then validated to check its format and compatibility with the plugin, and finally the main WPA window opens up.
Click "Open file..." from the start menu on the left side and select the `example.json` file.

![wpa-open-file #center](figures/wpa-open-file.png)

When you click `Open`, the output file is checked for compatibility with the WPA plugin, and the main WPA window opens up.

### Timeline

The WindowsPerf timeline feature (command line option -t) enable continuous counting of Performance Monitoring Unit (PMU) events.
Users can specify sleep intervals (with -i) between counts and set the number of repetitions (with -n), allowing for detailed and flexible data collection.
Users can take advantage of the `WindowsPerf WPA Plugin` to visualize these complex measurements.
This plugin allows for detailed graphical representation of the PMU event data in WPA.
The WindowsPerf timeline feature (command line option -t) enables continuous counting of Performance Monitoring Unit (PMU) events.

You can specify sleep intervals (with -i) between counts and set the number of repetitions (with -n), allowing for detailed and flexible data collection.

For this example we will be running the following command:
You can use WPA to visualize PMU events in the recorded data.

To try the timeline feature, run the command:

```command
wperf stat -m dcache -c 0,1,2,3,4,5,6,7 -t -i 0 -n 50 --json
```

Importing the generated output in WPA will show us the following graph:
![timeline-by-core](figures/timeline-by-core.png)
Open the generated output (`.json` file) in WPA to see the graph:

We can change the default grouping from `Group by core` to `Group by event` to see the following graph instead:
![timeline-by-event](figures/timeline-by-event.png)
![timeline-by-core #center](figures/timeline-by-core.png)

The WindowsPerf WPA Plugin also generates a graph per event note in order to provide a more in-depth grouping of events. To see all the generated graphs we can expand the `Counting timeline` section in the graph explorer section of WPA.
You can change the default grouping from `Group by core` to `Group by event` and see the following graph:

For this example, the following command was used instead:
![timeline-by-event #center](figures/timeline-by-event.png)

```command
The WPA plugin also generates a graph per event note in order to provide a more in-depth grouping of events.

To see all the generated graphs you can expand the `Counting timeline` section in the graph explorer section of WPA.

Run another `wperf` command with different options:

```console
wperf stat -t -i 0 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --json
```

![timeline-events-by-key](figures/timeline-events-by-key.png)
The graph after opening the `.json` file is shown below:

![timeline-events-by-key #center](figures/timeline-events-by-key.png)

We can double click on any graph to expand it under the Analysis tab for further data visualization.
You can double click on any graph to expand it under the Analysis tab for further data visualization.

### Telemetry

The `WindowsPerf WPA Plugin` also allows the visualization of [Arm telemetry metrics](https://developer.arm.com/documentation/109542/0100/About-Arm-CPU-Telemetry-Solution) counted similarly to counting events.
The WPA Plugin also provides visualization of [Arm telemetry metrics](https://developer.arm.com/documentation/109542/0100/About-Arm-CPU-Telemetry-Solution).

For this example, the following command was used:
To visualize telemetry, run the following command:

```command
```console
wperf stat -t -i 0 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --json
```

Similarlry to the graphs generated per event note for timeline events, we can also see the generated telemetry timeline graphs under the grapher explorer level in WPA. These graphs are generated dynamically so only the relevant metrics for the given `.json` output file are visible.
You can also see the telemetry timeline graphs under the graph explorer level in WPA.

These graphs are generated dynamically so only the relevant metrics for the given `.json` output file are visible.

![telemetry-preview](figures/telemetry-preview.png)
![telemetry-preview #center](figures/telemetry-preview.png)

Once expanded, a more in-depth view is visible under the Analysis tab of WPA.

![telemetry-table](figures/telemetry-table.png)
![telemetry-table #center](figures/telemetry-table.png)

You now have a basic understanding of how to use `wperf` generated data in the Windows Performance Analyzer.