From c3108e1d15a7869bc654701331f2dfca2371dc42 Mon Sep 17 00:00:00 2001 From: Virendra Kakade Date: Wed, 16 Mar 2022 15:08:20 -0500 Subject: test: add support for new benchmark_rate args Add support for the new "priority" and "multi_streamer" benchmark_rate args to run_benchmark_rate.py to enable batch runs of benchmark_rate using those arguments. Signed-off-by: Virendra Kakade --- .../streaming_performance/parse_benchmark_rate.py | 18 ++++++++++-------- host/tests/streaming_performance/run_benchmark_rate.py | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'host/tests') diff --git a/host/tests/streaming_performance/parse_benchmark_rate.py b/host/tests/streaming_performance/parse_benchmark_rate.py index e30c3e6aa..f7fde629d 100644 --- a/host/tests/streaming_performance/parse_benchmark_rate.py +++ b/host/tests/streaming_performance/parse_benchmark_rate.py @@ -72,18 +72,20 @@ def parse(result_str): rx_rate = 0.0 num_rx_channels = 0 expr = "Testing receive rate ([0-9]+\.[0-9]+) Msps on (\d+) channels" - match = re.search(expr, result_str) - if match is not None: - rx_rate = float(match.group(1)) * 1.0e6 - num_rx_channels = int(match.group(2)) + matches = re.findall(expr, result_str) + if matches: + rx_rate = float(matches[0][0]) * 1.0e6 + for match in matches: + num_rx_channels += int(match[1]) tx_rate = 0.0 num_tx_channels = 0 expr = "Testing transmit rate ([0-9]+\.[0-9]+) Msps on (\d+) channels" - match = re.search(expr, result_str) - if match is not None: - tx_rate = float(match.group(1)) * 1.0e6 - num_tx_channels = int(match.group(2)) + matches = re.findall(expr, result_str) + if matches: + tx_rate = float(matches[0][0]) * 1.0e6 + for match in matches: + num_tx_channels += int(match[1]) # Parse results expr = "Benchmark rate summary:" diff --git a/host/tests/streaming_performance/run_benchmark_rate.py b/host/tests/streaming_performance/run_benchmark_rate.py index 1989b6d92..141dc5dc3 100644 --- a/host/tests/streaming_performance/run_benchmark_rate.py +++ b/host/tests/streaming_performance/run_benchmark_rate.py @@ -40,6 +40,8 @@ def create_parser(): parser.add_argument("--random", type=str, help="Run with random values of samples in send() and recv()") parser.add_argument("--rx_channels", type=str, help="which RX channel(s) to use") parser.add_argument("--tx_channels", type=str, help="which TX channel(s) to use") + parser.add_argument("--priority", type=str, help="thread priority (normal, high)") + parser.add_argument("--multi_streamer", action="count", help="create a separate streamer per channel") return parser def parse_args(): -- cgit v1.2.3