Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio_readdev/iio_writedev: Fix benchmark feature
The --benchmark/-B option previously introduced in iio_readdev and iio_writedev did not really work as intended. For each buffer, it would compute the transfer speed, and eventually computed the mean value after every 10 transfers. The problem was that some transfers can appear almost instant, for instance when there is already a block of samples available to dequeue on the kernel side. In that case, the apparent transfer speed would be extremely high, and the resulting mean value would be completely wrong. Address this issue by computing the cumulated time spent transferring data every 10 transfers, and derive the transfer rate from this result. The value computed was also wrong for a different reason: it displayed MiB/s (where one MiB == 1,048,576 bytes) but actually computed MB/s (where one MB == 1,000,000 bytes). Signed-off-by: Paul Cercueil <paul@crapouillou.net>
- Loading branch information