Skip to content

Commit 63f0545

Browse files
Merge pull request #1347 from PrzemekWirkus/devel_update_wperf_cheatsheet
Update "Get started with WindowsPerf" - add cheat sheet and fix links
2 parents 0f3a6d5 + 30dc171 commit 63f0545

File tree

4 files changed

+123
-7
lines changed

4 files changed

+123
-7
lines changed

content/learning-paths/laptops-and-desktops/windowsperf/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Get started with WindowsPerf
33

4-
minutes_to_complete: 15
4+
minutes_to_complete: 20
55

66
who_is_this_for: This is an introductory topic for software developers working on laptops and desktops and new to the Arm architecture.
77

@@ -19,6 +19,7 @@ skilllevels: Introductory
1919
subjects: Performance and Architecture
2020
armips:
2121
- Cortex-A
22+
- neoverse
2223
operatingsystems:
2324
- Windows
2425
tools_software_languages:

content/learning-paths/laptops-and-desktops/windowsperf/_review.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ review:
1919
- "False"
2020
correct_answer: 1
2121
explanation: >
22-
The available counters may vary between processors. Use `wprof -l` to generate a list of available counters.
22+
The available counters may vary between processors. Use `wperf list` to generate a list of available counters.
2323
2424
- questions:
2525
question: >
@@ -41,6 +41,26 @@ review:
4141
explanation: >
4242
Some `wperf` commands such as `list`, `test` or `stat` can output data in JSON format.
4343
44+
- questions:
45+
question: >
46+
Command `wperf sample` can be used together with `--annotate` or `--disassemble` command line options.
47+
answers:
48+
- "True"
49+
- "False"
50+
correct_answer: 1
51+
explanation: >
52+
Yes, you can add annotate and disassemble output to `wperf sample` command.
53+
54+
- questions:
55+
question: >
56+
Command `wperf record` can be used together with `--annotate` or `--disassemble` command line options.
57+
answers:
58+
- "True"
59+
- "False"
60+
correct_answer: 1
61+
explanation: >
62+
Yes, you can add annotate and disassemble output to `wperf record` command.
63+
4464
4565
# ================================================================================
4666
# FIXED, DO NOT MODIFY

content/learning-paths/laptops-and-desktops/windowsperf/windowsperf.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ weight: 2
66

77
# Overview
88

9-
[WindowsPerf](https://gitlab.com/Linaro/WindowsPerf/windowsperf) is a (Linux [perf](https://perf.wiki.kernel.org) inspired) Windows on Arm performance profiling tool. Profiling is based on ARM64 PMU and its hardware counters. WindowsPerf supports the counting model for obtaining aggregate counts of occurrences of special events, and sampling model for determining the frequencies of event occurrences produced by program locations at the function, basic block, and/or instruction levels.
9+
[WindowsPerf](https://github.com/arm-developer-tools/windowsperf) is a (Linux [perf](https://perf.wiki.kernel.org) inspired) Windows on Arm performance profiling tool. Profiling is based on ARM64 PMU and its hardware counters. WindowsPerf supports the counting model for obtaining aggregate counts of occurrences of special events, and sampling model for determining the frequencies of event occurrences produced by program locations at the function, basic block, and/or instruction levels.
1010

1111
Learn more in this [blog](https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/announcing-windowsperf) announcing the first release.
1212

1313
## WindowsPerf architecture
1414

1515
`WindowsPerf` is composed of two main components:
16-
- [wperf](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/tree/main/wperf) a command line interface (CLI) sometimes referred as "user-space app" and
17-
- [wperf-driver](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/tree/main/wperf-driver) a (signed) Kernel-Mode Driver Framework (KMDF) driver.
16+
- [wperf](https://github.com/arm-developer-tools/windowsperf/tree/main/wperf) a command line interface (CLI) sometimes referred as "user-space app" and
17+
- [wperf-driver](https://github.com/arm-developer-tools/windowsperf/tree/main/wperf-driver) a (signed) Kernel-Mode Driver Framework (KMDF) driver.
1818

1919
## WindowsPerf releases
2020

21-
You can find all binary releases of `WindowsPerf` [here](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/releases).
21+
You can find all binary releases of `WindowsPerf` [here](https://github.com/arm-developer-tools/windowsperf/releases).
2222

2323
# Installation
2424

@@ -106,6 +106,30 @@ wperf test
106106
You can output `wperf test` command in JSON format. Use `--json` command line option to enable JSON output.
107107
{{% /notice %}}
108108

109+
## Obtain plain text information about specified event, metric, or group of metrics.
110+
111+
Command line option `man` prints on screen information about specified event, metric, or group of metrics.
112+
113+
```command
114+
wperf man l1d_cache_mpki
115+
```
116+
117+
```output
118+
CPU
119+
neoverse-n1
120+
NAME
121+
l1d_cache_mpki - L1D Cache MPKI
122+
EVENTS
123+
inst_retired, l1d_cache_refill
124+
DESCRIPTION
125+
This metric measures the number of level 1 data cache accesses missed per
126+
thousand instructions executed.
127+
FORMULA
128+
l1d_cache_refill / inst_retired * 1000
129+
UNIT
130+
MPKI
131+
```
132+
109133
## Generate sample profile
110134

111135
Specify the `event` to profile with `-e`. Groups of events, known as `metrics` can be specified with `-m`.
@@ -139,4 +163,4 @@ You can output `wperf stat` command in JSON format. Use `--json` command line op
139163
{{% /notice %}}
140164

141165

142-
Example use cases are provided in the WindowsPerf [documentation](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/blob/main/wperf/README.md#counting-model).
166+
Example `wperf stat` command use cases are provided in the WindowsPerf [documentation](https://github.com/arm-developer-tools/windowsperf/tree/main/wperf#counting-model).
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
layout: learningpathall
3+
title: WindowsPerf cheat sheet
4+
weight: 2
5+
---
6+
7+
# WindowsPerf cheat sheet
8+
9+
The cheat sheet for the `wperf` command line tool focuses specifically on counting and sampling commands. It includes `wperf stat` for counting occurrences of specific PMU events and `wperf sample` and `wperf record` for sampling PMU event. Each command is explained with practical example.
10+
11+
## WindowsPerf cheat sheet (PMU Counting Examples)
12+
13+
- Count events `inst_spec`, `vfp_spec`, `ase_spec` and `ld_spec` on core #0 for 3 seconds:
14+
15+
```command
16+
wperf stat -e inst_spec,vfp_spec,ase_spec,ld_spec -c 0 --timeout 3
17+
```
18+
19+
- Count metric `imix` (metric events will be grouped) and additional event `l1i_cache` on core #7 for 10.5 seconds:
20+
21+
```command
22+
wperf stat -m imix -e l1i_cache -c 7 --timeout 10.5
23+
```
24+
25+
- Count in timeline mode (output counting to CSV file) metric `imix` 3 times on core #1 with 2 second intervals (delays between counts). Each count will last 5 seconds:
26+
27+
```command
28+
wperf stat -m imix -c 1 -t -i 2 -n 3 --timeout 5
29+
```
30+
31+
## WindowsPerf cheat sheet (PMU Sampling Examples)
32+
33+
- Launch and pin `python_d.exe –c 10**10**100` to core no. 1 and sample given image name:
34+
35+
```command
36+
start /affinity 2 python_d.exe -c 10**10**100
37+
wperf sample -e ld_spec:100000 -c 1 --pe_file python_d.exe --image_name python_d.exe
38+
```
39+
40+
Same workflow can be wrapped with `wperf record` command, see example below:
41+
42+
- Launch `python_d.exe -c 10**10**100` process and start sampling event `ld_spec` with frequency `100000` on core no. 1 for 30 seconds.
43+
44+
```command
45+
wperf record -e ld_spec:100000 -c 1 --timeout 30 -- python_d.exe -c 10**10**100
46+
```
47+
48+
{{% notice Hint%}}
49+
Add `--annotate` or `--disassemble` to `wperf record` command line parameters to increase sampling "resolution".
50+
{{% /notice %}}
51+
52+
## WindowsPerf cheat sheet (SPE Examples)
53+
54+
Use Arm SPE optional extension to sample on core no. 1 process `python_d.exe`. SPE filter `load_filter` / `ld` enables collection of load sampled operations, including atomic operations that return a value to a register.
55+
56+
Note: Double-dash operator `--` can be used with SPE as well to launch the process.
57+
58+
```command
59+
wperf record -e arm_spe_0/ld=1/ -c 1 -– python_d.exe -c 10**10**100
60+
```
61+
62+
Above command can be replaces by below two commands:
63+
64+
```command
65+
start /affinity 2 python_d.exe -c 10**10**100
66+
wperf sample -e arm_spe_0/ld=1/ -c 1 --pe_file python_d.exe --image_name python_d.exe
67+
```
68+
69+
{{% notice Hint%}}
70+
Add `--annotate` or `--disassemble` to `wperf record` command line parameters to increase sampling "resolution".
71+
{{% /notice %}}

0 commit comments

Comments
 (0)