From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] test/py: mmc: Add 'mmc read' performance check
Date: Wed, 13 Mar 2019 17:49:29 +0100 [thread overview]
Message-ID: <20190313164929.32753-5-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20190313164929.32753-1-marek.vasut+renesas@gmail.com>
Add option to the mmc rd test to check the duration of the
execution of the mmc read command. This allows intercepting
read performance regressions.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
---
test/py/tests/test_mmc_rd.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/test/py/tests/test_mmc_rd.py b/test/py/tests/test_mmc_rd.py
index aba512adfe..2dc715bb51 100644
--- a/test/py/tests/test_mmc_rd.py
+++ b/test/py/tests/test_mmc_rd.py
@@ -6,6 +6,7 @@
# read if the test configuration contains a CRC of the expected data.
import pytest
+import time
import u_boot_utils
"""
@@ -187,6 +188,7 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
sector = env__mmc_rd_config.get('sector', 0)
count_sectors = env__mmc_rd_config.get('count', 1)
expected_crc32 = env__mmc_rd_config.get('crc32', None)
+ read_duration_max = env__mmc_rd_config.get('read_duration_max', 0)
count_bytes = count_sectors * 512
bcfg = u_boot_console.config.buildconfig
@@ -213,7 +215,9 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
# Read data
cmd = 'mmc read %s %x %x' % (addr, sector, count_sectors)
+ tstart = time.time()
response = u_boot_console.run_command(cmd)
+ tend = time.time()
good_response = 'MMC read: dev # %d, block # %d, count %d ... %d blocks read: OK' % (
devid, sector, count_sectors, count_sectors)
assert good_response in response
@@ -226,3 +230,10 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
assert expected_crc32 in response
else:
u_boot_console.log.warning('CONFIG_CMD_CRC32 != y: Skipping check')
+
+ # Check if the command did not take too long
+ if read_duration_max:
+ elapsed = tend - tstart
+ u_boot_console.log.info('Reading %d bytes took %f seconds' %
+ (count_bytes, elapsed))
+ assert elapsed <= (read_duration_max - 0.01)
--
2.20.1
next prev parent reply other threads:[~2019-03-13 16:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 16:49 [U-Boot] [PATCH 1/5] test/py: mmc: Factor out device selection Marek Vasut
2019-03-13 16:49 ` [U-Boot] [PATCH 2/5] test/py: mmc: Add 'mmc dev' test Marek Vasut
2019-03-19 1:23 ` Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot,2/5] " Tom Rini
2019-03-13 16:49 ` [U-Boot] [PATCH 3/5] test/py: mmc: Add 'mmc rescan' test Marek Vasut
2019-03-19 1:23 ` Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot,3/5] " Tom Rini
2019-03-13 16:49 ` [U-Boot] [PATCH 4/5] test/py: mmc: Add 'mmc info' test Marek Vasut
2019-03-19 1:23 ` Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot,4/5] " Tom Rini
2019-03-13 16:49 ` Marek Vasut [this message]
2019-03-19 1:23 ` [U-Boot] [PATCH 5/5] test/py: mmc: Add 'mmc read' performance check Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot, " Tom Rini
2019-03-19 1:23 ` [U-Boot] [PATCH 1/5] test/py: mmc: Factor out device selection Simon Glass
2019-04-10 12:20 ` [U-Boot] [U-Boot, " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190313164929.32753-5-marek.vasut+renesas@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox