Skip to content

Normalize our command line with - for single letters and -- for the long version

Normalize our command line with - for single letters and -- for the long version. Updated tests and README as well.

New output from --help

WindowsPerf ver. 2.5.0 (11bf76aa-dirty/Debug) WOA profiling with performance counters.
Report bugs to: https://gitlab.com/Linaro/WindowsPerf/windowsperf/-/issues

usage: wperf [options]

    Options:
    list                   List supported events and metrics.
    stat                   Count events.If - e is not specified, then count default events.
    test                   Configuration information about driver and application confituration.
    sample                 Sample events. If -e is not specified, cycle counter will be the default sample source
    -e e1, e2...           Specify events to count.Event eN could be a symbolic name or in raw number.
                           Symbolic name should be what's listed by 'perf list', raw number should be rXXXX,
                           XXXX is hex value of the number without '0x' prefix.
                           when doing sampling, support -e e1:sample_freq1,e2:sample_freq2...
    -m m1, m2...           Specify metrics to count. 'imix', 'icache', 'dcache', 'itlb', 'dtlb' supported.
    --timeout SEC          Specify counting duration(in s). The accuracy is 0.1s.
    sleep N                Like --timeout, for compatibility with Linux perf.
    -i N                   Specify counting interval(in s). To be used with -t.
    -t                     Enable timeline mode. It specifies -i 60 --timeout 1 implicitly.
                           Means counting 1 second after every 60 second, and the result
                           is in.csv file in the same folder where wperf is invoked.
                           You can use -i and --timeout to change counting duration and interval.
    -n N                   How many times count in timeline mode (disabled by default).
    --image_name           Specify the image name you want to sample.
    --pe_file              Specify the PE file.
    --pdb_file             Specify the PDB file.
    --sample-display-long  Display decorated symbol names.
    --sample-display-row   Set how many samples you want to see in the summary (50 by default).
    -C config_file         Provide customized config file which describes metrics etc.
    -E config_file         Provide customized config file which describes custom events.
    -E event_list          Provide custom events from command line, e.g. '-E name1:0x1234,name2:0xABCD'
    -c core_idx            Profile on the specified core. Skip -c to count on all cores.
                           In sampling user must specify exactly one core with -c.
    -c cpu_list            Profile on the specified cores, 'cpu_list' is comma separated list e.g. '-c 0,1,2,3'.
    --dmc dmc_idx          Profile on the specified DDR controller. Skip -dmc to count on all DMCs.
    -k                     Count kernel mode as well (disabled by default).
    -h / --help            Show tool help.
    --output               Enable JSON output to file.
    --config               Specify configuration parameters, format NAME=VALUE.
    -q                     Quiet mode, no output is produced.
    --json                 Define output type as JSON.
    -l                     Alias of 'list'.
    --verbose              Enable verbose output.
    -v                     Alias of '-verbose'.
    --version              Show tool version.

Test results.

============================= test session starts =============================
platform win32 -- Python 3.10.3, pytest-7.2.1, pluggy-1.0.0
rootdir: C:\Users\everton\wperf-scripts
collected 104 items

tests\wperf_cli_common_test.py ....                                      [  3%]
tests\wperf_cli_config_test.py .....                                     [  8%]
tests\wperf_cli_extra_events_test.py ....                                [ 12%]
tests\wperf_cli_json_validator_test.py ....                              [ 16%]
tests\wperf_cli_list_test.py .....                                       [ 21%]
tests\wperf_cli_metrics_test.py ..s....sssssssss                         [ 36%]
tests\wperf_cli_padding_test.py ...........                              [ 47%]
tests\wperf_cli_stat_test.py ........................................... [ 88%]
                                                                         [ 88%]
tests\wperf_cli_test_test.py .....                                       [ 93%]
tests\wperf_cli_timeline_test.py ......                                  [ 99%]
tests\wperf_lib_app_test.py s                                            [100%]

================= 93 passed, 11 skipped in 141.58s (0:02:21) ==================
Edited by Everton Constantino

Merge request reports

Loading