Skip to content

[wperf] WPERF-895: Handle sampling max frequency in CLI parser

Introduction

This patch adds interval check. I've switched to std::stoul() to account for unsigned values. Max frequency is 0xFFFFFFFF (unsinged 32-bit max). Interval/frequency check parsing is done by capturing:

  • std::invalid_argument and
  • std::out_of_range of std::stoul. See std::stoul.

Added unit tests to cover core parser flow.

In this patch:

  • wperf-test: add tests for sampling event interval
  • wperf: handle sample event frequency/interval parsing

Testing

Unite test results

>make test
  Passed test_parse_events_str_for_sample_interval_ok_max [< 1 ms]
  Passed test_parse_events_str_for_sample_interval_invalid_argument [8 ms]
Edited by Przemyslaw Wirkus

Merge request reports

Loading