Skip to content

Commit

Permalink
Merge pull request #576 from ArmDeveloperEcosystem/main
Browse files Browse the repository at this point in the history
Merge to production
  • Loading branch information
pareenaverma authored Nov 8, 2023
2 parents b4dfad7 + 5545e45 commit 55fadbe
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1648,4 +1648,7 @@ prepend
initialise
ptr
LLSoftSecBook
nodeSelector
nodeSelector
KMDF
DevCon

41 changes: 37 additions & 4 deletions content/install-guides/license/flexnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ multi_install: false # Set to true if first page of multi-page articl
multitool_install_part: true # Set to true if a sub-page of a multi-page article, else false
layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles
---
Older Arm products do not support UBL licenses. These will be enabled with FlexNet Publisher floating licenses. You will be supplied with license key(s) to generate your license(s).
Older Arm products do not support user-based licenses. These will be enabled with FlexNet Publisher floating licenses.

You will be supplied with license key(s) to generate such license(s).

## License server set up

Expand Down Expand Up @@ -55,11 +57,42 @@ export ARMLMD_LICENSE_FILE=port@server

The license can also be activated in the various Arm tool IDEs.

For example [Arm Development Studio](https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio)), via `Help` > `Arm License Manager`. You will need to specify the appropriate Development Studio Edition as the `Active Product`.
For example [Arm Development Studio](https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio)), via `Help` > `Arm License Manager`.

If `ARMLMD_LICENSE_FILE` is not set, use `Add` > `Add product license`, and specify `port` and `server` information for your license server.

Arm Development Studio will also ask to specify the appropriate [Edition](https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio#Editions) as the `Active Product`.

### Verify setup

To verify that the license is set up correctly, execute an Arm tool that does not support user-based licensing, for example:
To verify that the license is set up correctly, set the following environment variable:

#### Windows
```console
set FLEXLM_DIAGNOSTICS=3
```
#### Linux
```console
export FLEXLM_DIAGNOSTICS=3
```

and execute an appropriate Arm tool, for example `Arm Compiler for Embedded`:
```command
armcc --vsn
armclang --version
```

Observe the output, which will be similar to:
```output
Checkout succeeded: ds_suite_rowan/04C6 0E2A CDA4 6344
License file: port@server
License Server: port@server
Checkout succeeded: ds_compiler_rowan/141D C968 2E7F 4187
License file: port@server
License Server: port@server
Product: Arm Development Studio Gold Edition 2023.0
Component: Arm Compiler for Embedded 6.20
```

{{% notice Note %}}
Unset the `FLEXLM_DIAGNOSTICS` environment variable afterwards, as this will impact the tools performance.
{{% /notice %}}
51 changes: 44 additions & 7 deletions content/install-guides/wperf.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/releases
To download directly from command prompt, use:

```console
mkdir windowsperf-bin-3.2.0
cd windowsperf-bin-3.2.0
curl https://gitlab.com/api/v4/projects/40381146/packages/generic/windowsperf/3.2.0/windowsperf-bin-3.2.0.zip --output windowsperf-bin-3.2.0.zip
mkdir windowsperf-bin-3.2.1
cd windowsperf-bin-3.2.1
curl https://gitlab.com/api/v4/projects/40381146/packages/generic/windowsperf/3.2.1/windowsperf-bin-3.2.1.zip --output windowsperf-bin-3.2.1.zip
```

Unzip the package:

```console
tar -xmf windowsperf-bin-3.2.0.zip
tar -xmf windowsperf-bin-3.2.1.zip
```

## Install wperf driver
Expand All @@ -80,7 +80,7 @@ Open a `Windows Command Prompt` terminal with `Run as administrator` enabled.

Navigate to the `windowsperf-bin-<version>` directory.
```command
cd windowsperf-bin-3.2.0
cd windowsperf-bin-3.2.1
```

### Install with devcon {#devcon}
Expand Down Expand Up @@ -136,9 +136,46 @@ You should see output similar to:
```output
Component Version GitVer
========= ======= ======
wperf 3.2.0 a947eed8
wperf-driver 3.2.0 a947eed8
wperf 3.2.1 c831cfc2
wperf-driver 3.2.1 c831cfc2
```

## Uninstall wperf driver

You can uninstall (aka "remove") the kernel driver using either the Visual Studio [devcon](#devcon) utility or the supplied [installer](#devgen).

{{% notice Note%}}
You must uninstall the driver as `Administrator`.
{{% /notice %}}

### Uninstall with devcon {#devcon}

Below command removes the device from the device tree and deletes the device stack for the device. As a result of these actions, child devices are removed from the device tree and the drivers that support the device are unloaded. See [DevCon Remove](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-remove) article for more details.

```command
devcon remove wperf-driver.inf Root\WPERFDRIVER
```
You should see output similar to:
```output
ROOT\SYSTEM\0001 : Removed
1 device(s) were removed.
```

### Uninstall with wperf-devgen {#devgen}

```command
wperf-devgen uninstall
```
You should see output similar to:
```console
Executing command: uninstall.
Uninstall requested.
Waiting for device creation...
Device uninstalled successfully.
Trying to remove driver <path>\wperf-driver.inf.
Driver removed successfully.
```

## Further reading

[Announcing WindowsPerf: Open-source performance analysis tool for Windows on Arm](https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/announcing-windowsperf)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ tools_software_languages:
- Coding
operatingsystems:
- Linux

shared_path: true
shared_between:
- laptops-and-desktops
- servers-and-cloud-computing
- smartphones-and-mobile


### FIXED, DO NOT MODIFY
# ================================================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
next_step_guidance: You should now be able to test the `restrict` keyword in your own code. Why not explore these other embedded software learning paths.
next_step_guidance: You should now be able to test the `restrict` keyword in your own code. We recommend exploring the learning path on porting your code to Arm Scalable Vector Extensions as a next step.

recommended_path: /learning-paths/embedded-systems/
recommended_path: /learning-paths/servers-and-cloud-computing/sve/

further_reading:
- resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ further_reading:
title: Announcing WindowsPerf Open-source performance analysis tool for Windows on Arm
link: https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/announcing-windowsperf
type: blog
- resource:
title: WindowsPerf release 2.4.0 introduces the first stable version of sampling model support
link: https://www.linaro.org/blog/windowsperf-release-2-4-0-introduces-the-first-stable-version-of-sampling-model-support/
type: blog
- resource:
title: WindowsPerf Release 2.5.1
link: https://www.linaro.org/blog/windowsperf-release-2-5-1/
type: blog
- resource:
title: WindowsPerf Release 3.0.0
link: https://www.linaro.org/blog/windowsperf-release-3-0-0/
type: blog
- resource:
title: Windows on Arm overview
link: https://learn.microsoft.com/en-us/windows/arm/overview
Expand Down
11 changes: 11 additions & 0 deletions content/learning-paths/laptops-and-desktops/windowsperf/_review.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ review:
explanation: >
Use `-c` to specify the processor(s) in the system you wish to profile.
- 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
# ================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@ layout: learningpathall
title: WindowsPerf
weight: 2
---
[WindowsPerf](https://gitlab.com/Linaro/WindowsPerf/windowsperf) is a port of the popular Linux [perf](https://perf.wiki.kernel.org) tool for performance analysis.

# Overview

[WindowsPerf](https://gitlab.com/Linaro/WindowsPerf/windowsperf) is (Linux [perf]([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.

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

## WindowsPerf architecture

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

## WindowsPerf releases

You can find all binary releases of `WindowsPerf` [here](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/releases).

# Installation

For installation instructions see the [install guide](/install-guides/wperf).

## Using WindowsPerf
Expand Down Expand Up @@ -46,24 +61,82 @@ List of supported metrics (to be used in -m)
...
```

{{% notice Note%}}
You can extend `wperf list` command output with additional information like event and metrics description with `-v` command line option.
{{% /notice %}}

## Obtain information about wperf configuration

Command line option `test` prints on screen various `wperf` configuration settings:

```command
wperf test
```

```output
Test Name Result
========= ======
request.ioctl_events [EVT_CORE] False
request.ioctl_events [EVT_DSU] False
request.ioctl_events [EVT_DMC_CLK/EVT_DMC_CLKDIV2] False
pmu_device.vendor_name Arm Limited
pmu_device.product_name neoverse-n1
pmu_device.product_name(extended) Neoverse N1 (neoverse-n1), armv8.1, pmu_v3
pmu_device.product [] armv8-a,armv9-a,neoverse-n1,neoverse-n2,neoverse-n2-r0p0,neoverse-n2-r0p1,neoverse-n2-r0p3,neoverse-v1
pmu_device.m_product_alias (neoverse-n2-r0p0:neoverse-n2),(neoverse-n2-r0p1:neoverse-n2)
pmu_device.events_query(events) [EVT_CORE] 110
pmu_device.events_query(events) [EVT_DSU] 9
pmu_device.events_query(events) [EVT_DMC_CLK] 3
pmu_device.events_query(events) [EVT_DMC_CLKDIV2] 26
PMU_CTL_QUERY_HW_CFG [arch_id] 0x000f
PMU_CTL_QUERY_HW_CFG [core_num] 0x0050
PMU_CTL_QUERY_HW_CFG [fpc_num] 0x0001
PMU_CTL_QUERY_HW_CFG [gpc_num] 0x0006
PMU_CTL_QUERY_HW_CFG [total_gpc_num] 0x0006
PMU_CTL_QUERY_HW_CFG [part_id] 0x0d0c
PMU_CTL_QUERY_HW_CFG [pmu_ver] 0x0004
PMU_CTL_QUERY_HW_CFG [rev_id] 0x0001
PMU_CTL_QUERY_HW_CFG [variant_id] 0x0003
PMU_CTL_QUERY_HW_CFG [vendor_id] 0x0041
PMU_CTL_QUERY_HW_CFG [midr_value] 0x000000000000413fd0c1
...
```

{{% notice Note%}}
You can output `wperf test` command in JSON format. Use `--json` command line option to enable JSON output.
{{% /notice %}}

## Generate sample profile

Specify the `event` to profile with `-e`. Groups of events, known as `metrics` can be specified with `-m`.

For example, generate a report for Core 0 (`-c 0`) for two seconds (`-d 2`) with:
For example, generate a report for CPU core 0 (`-c 0`) for two seconds (`sleep 2`) with:
```command
wperf stat -e cpu_cycles -m icache -c 0 -d 2
wperf stat -e cpu_cycles -m icache -c 0 sleep 2
```
This will output a report similar to:
```output
counting ... done
Performance counter stats for core 0, no multiplexing, kernel mode excluded, on Arm Limited core implementation:
note: 'e' - normal event, 'gN' - grouped event with group number N, metric name will be appended if 'e' or 'g' comes from it
counter value event name event idx event note
============= ========== ========= ==========
649,973,325 cycle fixed e
277,788,076 l1i_cache 0x14 g0,icache
7,415,699 l1i_cache_refill 0x01 g0,icache
7,408,075 cycle fixed e
2,271,166 l1i_cache 0x14 g0,icache
126,875 l1i_cache_refill 0x01 g0,icache
0 l2i_cache 0x27 g0,icache
0 l2i_cache_refill 0x28 g0,icache
813,129,394 inst_retired 0x08 g0,icache
649,973,325 cpu_cycles 0x11 e
6,247,674 inst_retired 0x08 g0,icache
7,408,075 cpu_cycles 0x11 e
2.281 seconds time elapsed
```

{{% notice Note%}}
You can output `wperf stat` command in JSON format. Use `--json` command line option to enable JSON output.
{{% /notice %}}


Example use cases are provided in the WindowsPerf [documentation](https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/blob/main/wperf/README.md#counting-model).

0 comments on commit 55fadbe

Please sign in to comment.