[wperf] WPERF-1084: Add version check before we execute any do_ commands

Introduction

In this MR we make the check for the version mismatch between driver and user-space one of the first thing that the tool checks and if there's a mismatch The app exits and prints an error saying that there was a version mismatch!

Example usage

Check if wperf and wperf-driver versions are the same

>wperf --version
        Component     Version  GitVer          FeatureString
        =========     =======  ======          =============
        wperf         4.1.0    2ee5d93e-dirty  +etw-app+spe
        wperf-driver  4.1.0    453e6b42        +etw-drv+spe

Check if wperf and wperf-driver versions are different

>wperf --version
error: version mismatch between wperf-driver and wperf.
wperf-driver version: 4.0.0
wperf version: 4.1.0

In this patch:

  • wperf: check if version of wperf and wperf-driver match
  • wperf: add pmu_device::do_version_check() function
  • [wperf]: fix wperf version mismatch check before doing any commands
  • [wperf]: sperate getting version and printing version text
  • [wperf]: version mismatch fix

Testing

Pytest

collected 679 items / 8 skipped

wperf_cli_common_test.py ....                                                                                    [  0%]
wperf_cli_config_test.py .....                                                                                   [  1%]
wperf_cli_cpython_bench_test.py .s                                                                               [  1%]
wperf_cli_cpython_dep_record_test.py ................                                                            [  3%]
wperf_cli_cpython_dep_sample_test.py .                                                                           [  4%]
wperf_cli_dmc_test.py s                                                                                          [  4%]
wperf_cli_dmc_value_test.py s                                                                                    [  4%]
wperf_cli_extra_events_test.py ....                                                                              [  5%]
wperf_cli_hammer_core_test.py ..................                                                                 [  7%]
wperf_cli_help_test.py .s                                                                                        [  7%]
wperf_cli_info_str_test.py .                                                                                     [  8%]
wperf_cli_json_validator_test.py ..............s                                                                 [ 10%]
wperf_cli_list_test.py .....s                                                                                    [ 11%]
wperf_cli_lock_test.py .....                                                                                     [ 11%]
wperf_cli_man_test.py .....................................................................                      [ 22%]
wperf_cli_man_ts_test.py ....................................................................................... [ 34%]
.......................................................................                                          [ 45%]
wperf_cli_metrics_test.py ..s....s                                                                               [ 46%]
wperf_cli_padding_test.py ..............                                                                         [ 48%]
wperf_cli_prettytable_test.py .....                                                                              [ 49%]
wperf_cli_record_test.py ................s                                                                       [ 51%]
wperf_cli_sample_test.py ..........                                                                              [ 53%]
wperf_cli_stat_test.py ......................................................................                    [ 63%]
wperf_cli_stat_value_test.py ................................................................................... [ 75%]
.................................................................................................                [ 90%]
wperf_cli_test_test.py ...........                                                                               [ 91%]
wperf_cli_timeline_test.py .....................................................                                 [ 99%]
wperf_cli_xperf_test.py s                                                                                        [ 99%]
wperf_lib_app_test.py .                                                                                          [ 99%]
wperf_lib_c_compat_test.py .                                                                                     [100%]
Edited by Przemyslaw Wirkus

Merge request reports

Loading