[WPERF-600] Add PARSE_INTERVAL_DEFAULT constant as pmu_device.sampling.INTERVAL_DEFAULT to `wperf test`

Introduction

Default sampling frequency is defined in wperf like this:

windowsperf/wperf$ git grep PARSE_INTERVAL_DEFAULT
parsers.cpp:        uint32_t interval = PARSE_INTERVAL_DEFAULT;
parsers.h:inline constexpr uint32_t PARSE_INTERVAL_DEFAULT = 0x4000000;

We want to show this value in wperf test output so tools like vs-extension can use it in GUI/UX workflow. Example output from wperf test after this change:

>wperf test
        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_device.sampling.INTERVAL_DEFAULT                0x4000000
        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
        PMU_CTL_QUERY_HW_CFG [id_aa64dfr0_value]            0x00000000000110305408
        gpc_nums[EVT_CORE]                                  6
        gpc_nums[EVT_DSU]                                   6
        gpc_nums[EVT_DMC_CLK]                               2
        gpc_nums[EVT_DMC_CLKDIV2]                           8
        fpc_nums[EVT_CORE]                                  1
        fpc_nums[EVT_DSU]                                   1
        fpc_nums[EVT_DMC_CLK]                               0
        fpc_nums[EVT_DMC_CLKDIV2]                           0
        ioctl_events[EVT_CORE].index
        ioctl_events[EVT_CORE].note
        ioctl_events[EVT_DSU].index
        ioctl_events[EVT_DSU].note
        ioctl_events[EVT_DMC_CLK].index
        ioctl_events[EVT_DMC_CLK].note
        ioctl_events[EVT_DMC_CLKDIV2].index
        ioctl_events[EVT_DMC_CLKDIV2].note
        config.count.period                                 100
        config.count.period_max                             100
        config.count.period_min                             10

In this patch:

  • wperf-scripts: add test for 'pmu_device.sampling.INTERVAL_DEFAULT'
  • wperf: add parser::PARSE_INTERVAL_DEFAULT as pmu_device.sampling.INTERVAL_DEFAULT

This is default sampling frequency when users do not specify frequency with command line.

Testing

>pytest
=================================== test session starts ====================================
platform win32 -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
rootdir: C:\Users\$USER\Desktop\wperf\merge-request\WPERF-600, configfile: pytest.ini
collected 194 items / 1 skipped

wperf_cli_common_test.py ....                                                         [  2%]
wperf_cli_config_test.py .....                                                        [  4%]
wperf_cli_extra_events_test.py ....                                                   [  6%]
wperf_cli_info_str_test.py .                                                          [  7%]
wperf_cli_json_validator_test.py ..........                                           [ 12%]
wperf_cli_list_test.py .....                                                          [ 14%]
wperf_cli_metrics_test.py ................                                            [ 23%]
wperf_cli_padding_test.py ..............                                              [ 30%]
wperf_cli_record_test.py ..............                                               [ 37%]
wperf_cli_stat_test.py ...................................................            [ 63%]
wperf_cli_test_test.py ......                                                         [ 67%]
wperf_cli_timeline_test.py ...................................................        [ 93%]
wperf_cli_ustress_bench_test.py ......                                                [ 96%]
wperf_cli_ustress_dep_record_test.py .                                                [ 96%]
wperf_cli_ustress_dep_wperf_test.py .....                                             [ 99%]
wperf_lib_app_test.py s                                                               [100%]

================================= short test summary info ==================================
SKIPPED [1] wperf_cli_ustress_dep_wperf_lib_timeline_test.py:110: Can not find wperf-lib-timeline.exe
SKIPPED [1] wperf_lib_app_test.py:44: Can not run wperf-lib-app.exe
======================== 193 passed, 2 skipped in 575.36s (0:09:35) ========================
Edited by Przemyslaw Wirkus

Merge request reports

Loading