Skip to content

Commit

Permalink
Merge pull request #570 from PrzemekWirkus/docs_wperf_update_getting_…
Browse files Browse the repository at this point in the history
…started

WindowsPerf: Update Get started with WindowsPerf
  • Loading branch information
pareenaverma authored Nov 8, 2023
2 parents 91dfedc + b09dcdb commit 829f338
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 7 deletions.
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 @@ -61,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 829f338

Please sign in to comment.