[wperf] WPERF-720: Do not exit when reading metrics that require more than the available number of GPCs.

Introduction

When testing on Ampere with xperf blocking some GPCs I noticed that all calls to wperf exit with the message that not all GPCs are available, even wperf --version. This happens because we read the metrics with parse_events_str which checks for the number of GPCs available. This MR just shows the user the information and keeps running. A sample output is shown here when just a single GPC is available

PS C:\Users\tcwg\wperf-scripts\tests> .\wperf.exe record -e vfp_spec:100000 -c 0 --timeout 5 --annotate -- .\WindowsPerfSample1.exe
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric backend_stalled_cycles is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric branch_misprediction_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric branch_mpki is unable to be used due to lack of hardware resources.
event group size(3) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric branch_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric crypto_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric dtlb_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric dtlb_walk_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric frontend_stalled_cycles is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric integer_dp_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric ipc is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric itlb_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric itlb_walk_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1d_cache_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1d_cache_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1d_tlb_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1d_tlb_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1i_cache_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1i_cache_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1i_tlb_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l1i_tlb_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l2_cache_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l2_cache_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l2_tlb_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric l2_tlb_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric ll_cache_read_hit_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric ll_cache_read_miss_ratio is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric ll_cache_read_mpki is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric load_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric scalar_fp_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric simd_percentage is unable to be used due to lack of hardware resources.
event group size(2) exceeds number of free hardware PMU counters(1) out of a total of (6)
Warning: Metric store_percentage is unable to be used due to lack of hardware resources.
base address of '.\WindowsPerfSample1.exe': 0x7ff70d8e15c4, runtime delta: 0x7ff5cd8d0000
sampling ........ done!
======================== sample source: vfp_spec, top 50 hot functions ========================
df_hot
        line_number  hits  filename
        ===========  ====  ========
        15,732,480   66    C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        33           11    C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        45           8     C:\Users\evert\source\repos\WindowsPerfSample\lib.c

__CheckForDebuggerJustMyCode
        line_number  hits  filename
        ===========  ====  ========
        22           16    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c
        25           10    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c
        27           8     D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c

main
        line_number  hits  filename
        ===========  ====  ========
        62           9     C:\Users\evert\source\repos\WindowsPerfSample\main.c

simd_hot
        line_number  hits  filename
        ===========  ====  ========
        52           4     C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        53           4     C:\Users\evert\source\repos\WindowsPerfSample\lib.c

        overhead  count  symbol
        ========  =====  ======
           62.50     85  df_hot
           25.00     34  __CheckForDebuggerJustMyCode
            6.62      9  main
            5.88      8  simd_hot
100.00%       136  top 4 in total

and now when two GPCs are available

event group size(3) exceeds number of free hardware PMU counters(2) out of a total of (6)
Warning: Metric branch_percentage is unable to be used due to lack of hardware resources.
base address of '.\WindowsPerfSample1.exe': 0x7ff70d8e15c4, runtime delta: 0x7ff5cd8d0000
sampling ........ done!
======================== sample source: vfp_spec, top 50 hot functions ========================
df_hot
        line_number  hits  filename
        ===========  ====  ========
        15,732,480   66    C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        33           16    C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        45           9     C:\Users\evert\source\repos\WindowsPerfSample\lib.c

__CheckForDebuggerJustMyCode
        line_number  hits  filename
        ===========  ====  ========
        27           9     D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c
        22           8     D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c
        25           8     D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c
        23           1     D:\a\_work\1\s\src\vctools\crt\vcstartup\src\misc\debugger_jmc.c

main
        line_number  hits  filename
        ===========  ====  ========
        62           14    C:\Users\evert\source\repos\WindowsPerfSample\main.c

simd_hot
        line_number  hits  filename
        ===========  ====  ========
        53           3     C:\Users\evert\source\repos\WindowsPerfSample\lib.c
        52           1     C:\Users\evert\source\repos\WindowsPerfSample\lib.c

        overhead  count  symbol
        ========  =====  ======
           67.41     91  df_hot
           19.26     26  __CheckForDebuggerJustMyCode
           10.37     14  main
            2.96      4  simd_hot
100.00%       135  top 4 in total

In this patch:

  • [wperf] Do not exit when reading metrics that require more than the available number of GPCs.
Edited by Everton Constantino

Merge request reports

Loading