diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-05-20 12:21:47 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-05-20 14:58:43 -0500 |
commit | d2fc12dd8d4eccb79207fc1fcf1c997964dcbe98 (patch) | |
tree | d328b69748d26440d4720a82ee7ec2e4bdd927cf /host/examples | |
parent | 1162f5e98322683fa3128ce9a2369fe64ca0b4d8 (diff) | |
download | uhd-d2fc12dd8d4eccb79207fc1fcf1c997964dcbe98.tar.gz uhd-d2fc12dd8d4eccb79207fc1fcf1c997964dcbe98.tar.bz2 uhd-d2fc12dd8d4eccb79207fc1fcf1c997964dcbe98.zip |
examples: Fix underrun/seq error reporting in benchmark_rate.py
The numbers for these were swapped.
Diffstat (limited to 'host/examples')
-rwxr-xr-x | host/examples/python/benchmark_rate.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/host/examples/python/benchmark_rate.py b/host/examples/python/benchmark_rate.py index 948b30ce3..a2ef1047b 100755 --- a/host/examples/python/benchmark_rate.py +++ b/host/examples/python/benchmark_rate.py @@ -307,7 +307,6 @@ def benchmark_tx_rate_async_helper(tx_streamer, timer_elapsed_event, tx_async_st num_tx_seqerr = 0 num_tx_underrun = 0 num_tx_timeouts = 0 # TODO: Not populated yet - try: while not timer_elapsed_event.is_set(): # Receive the async metadata @@ -317,16 +316,17 @@ def benchmark_tx_rate_async_helper(tx_streamer, timer_elapsed_event, tx_async_st # Handle the error codes if async_metadata.event_code == uhd.types.TXMetadataEventCode.burst_ack: return - elif ((async_metadata.event_code == uhd.types.TXMetadataEventCode.underflow) or - (async_metadata.event_code == uhd.types.TXMetadataEventCode.underflow_in_packet)): - num_tx_seqerr += 1 - elif ((async_metadata.event_code == uhd.types.TXMetadataEventCode.seq_error) or - (async_metadata.event_code == uhd.types.TXMetadataEventCode.seq_error_in_packet)): + if async_metadata.event_code in ( + uhd.types.TXMetadataEventCode.underflow, + uhd.types.TXMetadataEventCode.underflow_in_packet): num_tx_underrun += 1 + elif async_metadata.event_code in ( + uhd.types.TXMetadataEventCode.seq_error, + uhd.types.TXMetadataEventCode.seq_error_in_packet): + num_tx_seqerr += 1 else: logger.warning("Unexpected event on async recv (%s), continuing.", - async_metadata.event_code) - + async_metadata.event_code) finally: # Write the statistics back tx_async_statistics["num_tx_seqerr"] = num_tx_seqerr @@ -402,8 +402,8 @@ def main(): # If the check returned two empty channel lists, that means something went wrong return False logger.info("Selected %s RX channels and %s TX channels", - rx_channels if rx_channels else "no", - tx_channels if tx_channels else "no") + rx_channels if rx_channels else "no", + tx_channels if tx_channels else "no") logger.info("Setting device timestamp to 0...") # If any of these conditions are met, we need to synchronize the channels |