[wperf] add --config to set up local configuration
Table of Contents
Description
In this patch: add control over counting timer period (in wperf-driver
) from user space.
- In this patch I want to add new command line option
--config
which will allow users to set up certain configuration values e.g. insidewperf-driver
. - In our case we want to control counting timer period between 10ms and 100ms. See Add counting timer period as part of driver <->... (!300 - merged).
We will set with string count.period=VALUE
(for example count.period=10
) configuration.
Changelog
- wperf-scripts: add regression for --config.
- wperf-driver: fix how we setup counting period (always default value is fixed).
- wperf-driver: add logging for counting period.
- wperf: pass count.period via PMU_CTL_START.
- wperf: add configuration printouts in test command.
- wperf: initialize drvconfig::init() in pmu_device::init().
- wperf-lib: add config.obj as linking dep.
- wperf: all drvconfig::set() when --config is given.
- wperf-test: add tests for drvconfig::set(wstring) interface.
- wperf: add set(wstring) interface to load name=value config.
- wperf-lib: add DIA SDK include path for x64 Release/Debug config.
- wperf-test: add smoke unit tests for drvconfig interface.
- wperf: add drvconfig namespace with interfaces.
- wperf: add drvconfig_get() function.
- wperf: add simple config API.
- wperf: add simple configuration data structure.
- wperf: add config setup source files.
Examples
Set counting period timer value to 10ms.
>wperf stat .... --config count.period=10 ...
wperf test
> wperf test
...
config.count.period 100
config.count.period_max 100
config.count.period_min 10
wperf test (set period)
>wperf test --config count.period=13
...
config.count.period 13
config.count.period_max 100
config.count.period_min 10
Testing
TraceView
wperf stat -m imix -c 1 sleep 2 --config count.period=15
00000103 wperf-driver 4924 3620 4 103 07\25\2023-11:11:59:36 WindowsPerfEvtDeviceControl 176 Queue 0x000059715E565FD8 Request 0x000059715F5D8F08 OutputBufferLength 0 InputBufferLength 160 IoControlCode 2621760512
00000104 wperf-driver 4924 3620 4 104 07\25\2023-11:11:59:36 IOCTL: action 2304
00000105 wperf-driver 4924 3620 4 105 07\25\2023-11:11:59:36 deviceControl 959 enqueuing for action 2304
00000106 wperf-driver 4924 3620 4 106 07\25\2023-11:11:59:36 deviceControl 1045 ctl_req->period = 15
00000107 wperf-driver 4924 3620 4 107 07\25\2023-11:11:59:36 deviceControl 1046 count.period = 30
00000108 wperf-driver 4924 3620 4 108 07\25\2023-11:11:59:36 deviceControl 1047 DueTime.QuadPart = -300000
00000109 wperf-driver 4924 3620 4 109 07\25\2023-11:11:59:36 WindowsPerfEvtDeviceControl 243 deviceControl outputSize=0
00000110 wperf-driver 4 884 5 110 07\25\2023-11:11:59:36 EvtWorkItemFunc Entry (0) for action 2304
00000111 wperf-driver 4 884 5 111 07\25\2023-11:11:59:36 EvtWorkItemFunc Exit
Note: count.period
is 30
because we double it if no multiplexing.
wperf stat -m imix -c 1 sleep 2
00000143 wperf-driver 8640 13176 6 143 07\25\2023-11:13:09:514 WindowsPerfEvtDeviceControl 176 Queue 0x000059715E565FD8 Request 0x000059715F5D8F08 OutputBufferLength 0 InputBufferLength 160 IoControlCode 2621760512
00000144 wperf-driver 8640 13176 6 144 07\25\2023-11:13:09:514 IOCTL: action 2304
00000145 wperf-driver 8640 13176 6 145 07\25\2023-11:13:09:514 deviceControl 959 enqueuing for action 2304
00000146 wperf-driver 8640 13176 6 146 07\25\2023-11:13:09:514 deviceControl 1045 ctl_req->period = 100
00000147 wperf-driver 8640 13176 6 147 07\25\2023-11:13:09:514 deviceControl 1046 count.period = 200
00000148 wperf-driver 8640 13176 6 148 07\25\2023-11:13:09:514 deviceControl 1047 DueTime.QuadPart = -2000000
00000149 wperf-driver 8640 13176 6 149 07\25\2023-11:13:09:514 WindowsPerfEvtDeviceControl 243 deviceControl outputSize=0
00000150 wperf-driver 4 700 5 150 07\25\2023-11:13:09:514 EvtWorkItemFunc Entry (0) for action 2304
00000151 wperf-driver 4 700 5 151 07\25\2023-11:13:09:514 EvtWorkItemFunc Exit
Note: count.period
is 200
because we double it if no multiplexing.
Unit testing
Please note that I've ran these on x64 and I got 6 skipped tests which require ARM64 machine.
Regression
>pytest
platform win32 -- Python 3.11.0rc2, pytest-7.2.0, pluggy-1.0.0
collected 104 items
wperf_cli_common_test.py .... [ 3%]
wperf_cli_config_test.py ..... [ 8%]
wperf_cli_extra_events_test.py .... [ 12%]
wperf_cli_json_validator_test.py .... [ 16%]
wperf_cli_list_test.py ..... [ 21%]
wperf_cli_metrics_test.py ..s....sssssssss [ 36%]
wperf_cli_padding_test.py ........... [ 47%]
wperf_cli_stat_test.py ........................................... [ 88%]
wperf_cli_test_test.py ..... [ 93%]
wperf_cli_timeline_test.py ...... [ 99%]
wperf_lib_app_test.py s [100%]
Edited by Przemyslaw Wirkus