[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/16] meson: convert the speed tests
From: |
marcandre . lureau |
Subject: |
[PATCH 13/16] meson: convert the speed tests |
Date: |
Fri, 28 Aug 2020 15:07:31 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Use meson benchmark() for them, adjust mtest2make.py for that.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Makefile | 2 +-
scripts/mtest2make.py | 3 ++-
tests/Makefile.include | 11 -----------
tests/meson.build | 16 ++++++++++++++++
4 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index 81794d5c34..a2d068ca37 100644
--- a/Makefile
+++ b/Makefile
@@ -71,7 +71,7 @@ ${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}:
.var.command += -MP
# reread (and MESON won't be empty anymore).
ifneq ($(MESON),)
Makefile.mtest: build.ninja scripts/mtest2make.py
- $(MESON) introspect --tests | $(PYTHON) scripts/mtest2make.py > $@
+ $(MESON) introspect --tests --benchmarks | $(PYTHON)
scripts/mtest2make.py > $@
-include Makefile.mtest
endif
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index d7a51bf97e..06d017154c 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -50,7 +50,8 @@ endef
suites = defaultdict(Suite)
i = 0
-for test in json.load(sys.stdin):
+introspect = json.load(sys.stdin)
+for test in introspect['tests'] + introspect['benchmarks']:
env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v))
for k, v in test['env'].items()))
executable = test['cmd'][0]
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 9fb61ff900..30d4c6f932 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -38,16 +38,8 @@ export SRC_PATH
SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
$(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
-check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF)
-check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF)
-check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF)
-
QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest
-tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o
$(test-crypto-obj-y)
-tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o
$(test-crypto-obj-y)
-tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o
$(test-crypto-obj-y)
-
tests/migration/stress$(EXESUF): tests/migration/stress.o
$(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $<
,"LINK","$(TARGET_DIR)$@")
@@ -97,9 +89,6 @@ define do_test_tap
"TAP","$@")
endef
-check-speed: $(check-speed-y)
- $(call do_test_human, $^)
-
# Per guest TCG tests
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
diff --git a/tests/meson.build b/tests/meson.build
index a2902bde45..4d6bcf06b3 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -108,6 +108,8 @@ tests = {
'test-qapi-util': {},
}
+benchs = {}
+
if have_block
tests += {
'test-coroutine': {'deps': [testblock]},
@@ -166,6 +168,11 @@ if have_block
if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host
tests += {'test-crypto-pbkdf': {'deps': [io]}}
endif
+ benchs += {
+ 'benchmark-crypto-hash': {'deps': [crypto]},
+ 'benchmark-crypto-hmac': {'deps': [crypto]},
+ 'benchmark-crypto-cipher': {'deps': [crypto]},
+ }
endif
if have_system
@@ -225,6 +232,15 @@ foreach test_name, extra_args: tests
suite: suite)
endforeach
+foreach bench_name, extra_args: benchs
+ src = extra_args.get('src', [bench_name + '.c'])
+ exe = executable(bench_name, src,
+ dependencies: [qemuutil] + extra_args.get('deps', []))
+ benchmark(bench_name, exe,
+ args: ['--tap', '-k'],
+ protocol: 'tap',
+ suite: ['speed'])
+endforeach
if have_tools and 'CONFIG_VHOST_USER' in config_host
executable('vhost-user-bridge',
--
2.26.2
- Re: [PATCH 05/16] tests: qga has virtio-serial by default when host has it, (continued)
- [PATCH 06/16] meson: convert the unit tests, marcandre . lureau, 2020/08/28
- [PATCH 07/16] meson: move keyutils dependency check, marcandre . lureau, 2020/08/28
- [PATCH 08/16] meson: remove old socket_scm_helper rule, marcandre . lureau, 2020/08/28
- [PATCH 09/16] meson: convert vhost-user-bridge, marcandre . lureau, 2020/08/28
- [PATCH 10/16] meson: convert atomic*-bench, marcandre . lureau, 2020/08/28
- [PATCH 11/16] tests/Makefile.include: update check-build, marcandre . lureau, 2020/08/28
- [PATCH 12/16] tests: do not print benchmark output to stdout, marcandre . lureau, 2020/08/28
- [PATCH 13/16] meson: convert the speed tests,
marcandre . lureau <=
- [PATCH 14/16] tests/migration/stress: remove unused exit_success, marcandre . lureau, 2020/08/28
- [PATCH 15/16] meson: fix migration/stress compilation with glib>=2.30, marcandre . lureau, 2020/08/28
- [PATCH 16/16] meson: convert migration/initrd-stress, marcandre . lureau, 2020/08/28
- Re: [PATCH 00/16] meson: convert unit tests in tests/Makefile.include, Thomas Huth, 2020/08/28