Skip to content

Commit e8600d9

Browse files
Merge pull request #1335 from nader-zouaoui/windowsPerf-vs-extension-lp
docs: add full tutorial list to WindowsPerf vs extension
2 parents 6eeaba9 + 66d20f5 commit e8600d9

File tree

14 files changed

+385
-0
lines changed

14 files changed

+385
-0
lines changed
150 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: WindowsPerf Visual Studio extension
3+
4+
minutes_to_complete: 30
5+
6+
who_is_this_for: WindowsPerf users who want to integrate WindowsPerf into their development flow.
7+
8+
learning_objectives:
9+
- Learn how to use the WindowsPerf Visual Studio extension
10+
- Generate a counting report and explore the data
11+
- (Optional) Review the report in Windows Performance Analyzer (WPA)
12+
- Generate a sample report and explore the data
13+
- Generate a sample SPE report and explore the data
14+
15+
prerequisites:
16+
- Windows on Arm desktop or development machine
17+
- WindowsPerf installed [(Installation guide)](/install-guides/wperf/)
18+
- Visual Studio 2022 Community Edition installed [(Installation guide)](/install-guides/vs-woa/)
19+
- WindowsPerf Visual Studio extension installed [(Installation guide)](/install-guides/windows-perf-vs-extension/)
20+
- (Optional) WindowsPerf WPA plugin installed
21+
22+
author_primary: Nader Zouaoui
23+
24+
### Tags
25+
skilllevels: Introductory
26+
subjects: Performance and Architecture
27+
armips:
28+
- Cortex-A
29+
operatingsystems:
30+
- Windows
31+
tools_software_languages:
32+
- WindowsPerf
33+
- perf
34+
- Visual Studio
35+
36+
### FIXED, DO NOT MODIFY
37+
# ================================================================================
38+
weight: 1 # _index.md always has weight of 1 to order correctly
39+
layout: "learningpathall" # All files under learning paths have this same wrapper
40+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
41+
---
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
next_step_guidance: Now that you have an idea of how the extensin works, You can try exploring the WindowsPerf CLI for more flexibility.
3+
4+
recommended_path: "/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython"
5+
6+
further_reading:
7+
- resource:
8+
title: Announcing WindowsPerf Open-source performance analysis tool for Windows on Arm
9+
link: https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/announcing-windowsperf
10+
type: blog
11+
- resource:
12+
title: WindowsPerf Release 3.7.2
13+
link: https://www.linaro.org/blog/expanding-profiling-capabilities-with-windowsperf-372-release/
14+
type: blog
15+
- resource:
16+
title: WindowsPerf Visual Studio Extension v2.1.0
17+
link: https://www.linaro.org/blog/launching--windowsperf-visual-studio-extension-v210/
18+
type: blog
19+
- resource:
20+
title: Windows on Arm overview
21+
link: https://learn.microsoft.com/en-us/windows/arm/overview
22+
type: website
23+
- resource:
24+
title: Linaro Windows on Arm project
25+
link: https://www.linaro.org/windows-on-arm/
26+
type: website
27+
- resource:
28+
title: WindowsPerf Visual Studio extension releases
29+
link: https://github.com/arm-developer-tools/windowsperf-vs-extension/releases
30+
type: website
31+
- resource:
32+
title: WindowsPerf releases
33+
link: https://github.com/arm-developer-tools/windowsperf/releases
34+
type: website
35+
36+
# ================================================================================
37+
# FIXED, DO NOT MODIFY
38+
# ================================================================================
39+
weight: 21 # set to always be larger than the content in this path, and one more than 'review'
40+
title: "Next Steps" # Always the same
41+
layout: "learningpathall" # All files under learning paths have this same wrapper
42+
---
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: The Counting Feature
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Introduction
10+
11+
The Counting feature in the WindowsPerf GUI extension is a powerful tool for analyzing and optimizing your code's performance.
12+
This tutorial guides you through the entire process, from setting up your counting preferences to analyzing the results and interfacing with the WindowsPerf Windows
13+
Performance Analyzer (WPA) Plugin.
14+
15+
## How to Open Counting Settings
16+
17+
**Accessing Counting Settings**:
18+
19+
- In Visual Studio 2022, go to the `View` menu.
20+
- Select `Counting Settings` from the dropdown.
21+
- This action will open the Counting Settings Dialog.
22+
23+
## Configuring the Counting Parameters
24+
25+
1. **Filling in Necessary Fields**:
26+
27+
- The dialog presents multiple fields for configuration. Essential fields to fill in include:
28+
- CPU core selection
29+
> Note: if no target is selected, the CPU core selection allows for multiple
30+
> cores to be selected.
31+
- Event or Metric choice
32+
> Note: Events can be grouped by selecting the events to group, then clicking on
33+
> the `Group events` button.
34+
- Fill these in according to the specifics of the counting you wish to perform.
35+
36+
2. **Optional Parameters**:
37+
38+
- You can also set other parameters as per your requirements.
39+
40+
3. **Command Preview**:
41+
42+
- As you configure the settings, the dialog provides a real-time preview of the
43+
WindowsPerf command that will be executed.
44+
45+
4. **Timeline Parameters**:
46+
47+
The option to create a timeline is available by toggling the `Timeline` checkbox.
48+
You then have the option to:
49+
50+
- Choose the number of iterations to run the timeline (defaults to 1).
51+
- Choose the interval between each iteration (defaults to 0.5 second).
52+
53+
## Initiating the Counting Process
54+
55+
1. **Starting the Counting Process**:
56+
57+
- Click on the `Start` button to kickstart the sampling.
58+
59+
> Note: The `Build and start` button is also available to build the solution
60+
> before starting the counting process if the current project target is selected.
61+
62+
- If you’ve set a timeout, the process will run for the specified duration.
63+
Otherwise, you have the flexibility to end the counting manually using the `Stop` button.
64+
65+
- The `Stop` button can also be used to interrupt the process even if the timeout
66+
hasn’t lapsed and the collected counts will be shown in the table below.
67+
68+
![Start Counting](./start-counting.png)
69+
_Counting Settings UI_
70+
71+
## Delving into the Counting Results
72+
73+
1. **Analyzing the Results**:
74+
75+
- Post-counting, you’ll notice the table in the `Counting Output` located at the
76+
lower section of the Counting Settings dialog displaying the collected counts.
77+
78+
(**Optional**)
79+
80+
- The option to **Open in WPA** is available to open the collected counts in the
81+
Windows Performance Analyzer (WPA) using the WindowsPerf WPA Plugin for a more
82+
in-depth visualization and analysis of the results.
83+
84+
![Open in WPA #center](./open-in-wpa.png)
85+
_WPA UI_
156 KB
Loading
608 KB
Loading
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: The Sampling Feature
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Introduction
10+
11+
The Sampling feature in the WindowsPerf GUI extension is a powerful tool for analyzing and optimizing your code's performance. This tutorial guides you through the entire process, from setting up your sampling preferences to analyzing the results and implementing changes.
12+
13+
## How to Open Sampling Explorer
14+
15+
1. **Accessing Sampling Explorer**:
16+
- In Visual Studio 2022, go to the `View` menu.
17+
- Select `Sampling Explorer` from the dropdown.
18+
19+
## Setting Your Sampling Preferences
20+
21+
1. **Opening Sampling Settings**:
22+
- Inside the Sampling Explorer window, find and click on the `settings wheel` icon.
23+
- This action will open the Sampling Settings Dialog.
24+
25+
## Configuring the Sampling Parameters
26+
27+
1. **Filling in Necessary Fields**:
28+
29+
- The dialog presents multiple fields for configuration. Essential fields to fill in include:
30+
- File payload
31+
- CPU core selection
32+
- Event choice
33+
- Desired frequency
34+
- Fill these in according to the specifics of the sampling you wish to perform.
35+
36+
2. **Optional Parameters**:
37+
38+
- You can also set other parameters as per your requirements.
39+
40+
3. **Command Preview**:
41+
42+
- As you configure the settings, the dialog provides a real-time preview of the WindowsPerf command that will be executed.
43+
44+
4. **Saving Your Settings**:
45+
- Once you are satisfied with your configurations, click `save`.
46+
47+
![Sampling overview #center](./sampling-overview.png)
48+
_Sampling overview UI_
49+
50+
## Initiating the Sampling Process
51+
52+
1. **Starting the Sampling**:
53+
54+
- Click on the play button to kickstart the sampling.
55+
56+
- If you’ve set a timeout, the process will run for the specified duration. Otherwise, you have the flexibility to end the sampling manually using the stop button.
57+
58+
- The stop button can also be used to interrupt the process even if the timeout hasn’t lapsed and the collected samples will be shown in the next screen.
59+
60+
## Delving into the Sampling Results
61+
62+
1. **Analyzing the Results**:
63+
64+
- Post-sampling, you’ll notice the window divides into two sections: a tree view and a detailed analysis section.
65+
66+
- Navigate through the tree view by clicking on the nodes. This will reveal functions triggered, selected events, line numbers in the source code, and the responsible source files.
67+
68+
- An added convenience: Any accessible source file appears as a clickable hyperlink. Selecting it will directly open the file within the IDE.
69+
70+
## Implementing Code Adjustments
71+
72+
![Sampling settings #center](./sampling-settings.png)
73+
_Sampling settings UI_
74+
75+
1. **Optimizing Your Code**:
76+
- Based on the insights gathered from the sampling results, proceed to make any required optimizations or edits to your source code.
77+
78+
![Sampling results #center](./sampling-results.png)
79+
_Sampling results shown in the code editor_
80+
81+
## Re-evaluating Post Edits
82+
83+
1. **Comparing Results**:
84+
85+
- Post editing, run the sampling process again.
86+
87+
- This allows you to instantly compare and contrast the results before and after your code modifications, ensuring optimal performance improvements.
88+
89+
- With these steps, you are well-equipped to make the best of the sampling feature in the WindowsPerf GUI extension. Happy coding and optimizing!
90+
91+
## Lock Unlock
92+
93+
When WindowsPerf communicates with its Kernel Driver, the driver acquires lock and will deny access to other instances of WindowsPerf accessing the driver and its resources. This prevents others from interfering with the current WindowsPerf execution and protects you from interference with your count.
94+
95+
When another WindowsPerf process has “locked” access to the driver you will no longer be able to use WindowsPerf, you will instead receive the following error message:
96+
97+
```shell
98+
warning: other WindowsPerf process acquired the WindowsPerf-driver.
99+
Operation canceled!
100+
```
101+
102+
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.
103+
104+
However, interrupting a running wperf process would result in losing all the collected data. If interrupted, WidowsPerf will show the following error message:
105+
106+
```shell
107+
warning: other WindowsPerf process hijacked (forced lock) the wperf-driver, see --force-lock.
108+
Operation terminated, your data was lost!
109+
110+
Received ERROR_BAD_COMMAND, driver status:
111+
STATUS_INVALID_DEVICE_STATE
112+
error: PMU_CTL_LOCK_RELEASE can't be release
113+
```
1.07 MB
Loading
844 KB
Loading
247 KB
Loading

0 commit comments

Comments
 (0)