Skip to contentSkip to conversation

tests: Move benchmarks into a separate folder

PATCH In review Thomas Huth 3 participants 4 messages Mar 12, 2021 – Mar 15, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Move benchmarks into a separate folder

Make it clear that these files are related to benchmarks by moving them into a new folder called "bench".

---
Based-on: [email protected]

 tests/{ => bench}/atomic64-bench.c          |  0
 tests/{ => bench}/atomic_add-bench.c        |  0
 tests/{ => bench}/benchmark-crypto-cipher.c |  0
 tests/{ => bench}/benchmark-crypto-hash.c   |  0
 tests/{ => bench}/benchmark-crypto-hmac.c   |  0
 tests/bench/meson.build                     | 34 +++++++++++++++++++++
 tests/{ => bench}/qht-bench.c               |  0
 tests/meson.build                           | 34 +--------------------
 8 files changed, 35 insertions(+), 33 deletions(-)
 rename tests/{ => bench}/atomic64-bench.c (100%)
 rename tests/{ => bench}/atomic_add-bench.c (100%)
 rename tests/{ => bench}/benchmark-crypto-cipher.c (100%)
 rename tests/{ => bench}/benchmark-crypto-hash.c (100%)
 rename tests/{ => bench}/benchmark-crypto-hmac.c (100%)
 create mode 100644 tests/bench/meson.build
 rename tests/{ => bench}/qht-bench.c (100%)
tests/bench/atomic64-bench.c renamed from tests/atomic64-bench.c +0 -0
similarity index 100%
rename from tests/atomic64-bench.c
rename to tests/bench/atomic64-bench.c
tests/bench/atomic_add-bench.c renamed from tests/atomic_add-bench.c +0 -0
similarity index 100%
rename from tests/atomic_add-bench.c
rename to tests/bench/atomic_add-bench.c
tests/bench/benchmark-crypto-cipher.c renamed from tests/benchmark-crypto-cipher.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-cipher.c
rename to tests/bench/benchmark-crypto-cipher.c
tests/bench/benchmark-crypto-hash.c renamed from tests/benchmark-crypto-hash.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-hash.c
rename to tests/bench/benchmark-crypto-hash.c
tests/bench/benchmark-crypto-hmac.c renamed from tests/benchmark-crypto-hmac.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-hmac.c
rename to tests/bench/benchmark-crypto-hmac.c
tests/bench/meson.build new file +34 -0
new file mode 100644
index 0000000000..00b3c209dc
@@ -0,0 +1,34 @@
+
+qht_bench = executable('qht-bench',
+                       sources: 'qht-bench.c',
+                       dependencies: [qemuutil])
+
+executable('atomic_add-bench',
+           sources: files('atomic_add-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+executable('atomic64-bench',
+           sources: files('atomic64-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+benchs = {}
+
+if have_block
+  benchs += {
+     'benchmark-crypto-hash': [crypto],
+     'benchmark-crypto-hmac': [crypto],
+     'benchmark-crypto-cipher': [crypto],
+  }
+endif
+
+foreach bench_name, deps: benchs
+  exe = executable(bench_name, bench_name + '.c',
+                   dependencies: [qemuutil] + deps)
+  benchmark(bench_name, exe,
+            args: ['--tap', '-k'],
+            protocol: 'tap',
+            timeout: 0,
+            suite: ['speed'])
+endforeach
tests/bench/qht-bench.c renamed from tests/qht-bench.c +0 -0
similarity index 100%
rename from tests/qht-bench.c
rename to tests/bench/qht-bench.c
tests/meson.build +1 -33
index af43fd1eaf..55a7b08275 100644
@@ -1,18 +1,6 @@
 py3 = import('python').find_installation()
 
-qht_bench = executable('qht-bench',
-                       sources: 'qht-bench.c',
-                       dependencies: [qemuutil])
-
-executable('atomic_add-bench',
-           sources: files('atomic_add-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
-
-executable('atomic64-bench',
-           sources: files('atomic64-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
+subdir('bench')
 
 test_qapi_outputs = [
   'qapi-builtin-types.c',
@@ -73,26 +61,6 @@ test_deps = {
   'test-qht-par': qht_bench,
 }
 
-benchs = {}
-
-if have_block
-  benchs += {
-     'benchmark-crypto-hash': [crypto],
-     'benchmark-crypto-hmac': [crypto],
-     'benchmark-crypto-cipher': [crypto],
-  }
-endif
-
-foreach bench_name, deps: benchs
-  exe = executable(bench_name, bench_name + '.c',
-                   dependencies: [qemuutil] + deps)
-  benchmark(bench_name, exe,
-            args: ['--tap', '-k'],
-            protocol: 'tap',
-            timeout: 0,
-            suite: ['speed'])
-endforeach
-
 if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
   executable('vhost-user-bridge',
              sources: files('vhost-user-bridge.c'),
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 130 lines · Thomas Huth

Make it clear that these files are related to benchmarks by moving them into a new folder called "bench".

---
Based-on: [email protected]

  tests/{ => bench}/atomic64-bench.c          |  0
  tests/{ => bench}/atomic_add-bench.c        |  0
  tests/{ => bench}/benchmark-crypto-cipher.c |  0
  tests/{ => bench}/benchmark-crypto-hash.c   |  0
  tests/{ => bench}/benchmark-crypto-hmac.c   |  0
  tests/bench/meson.build                     | 34 +++++++++++++++++++++
  tests/{ => bench}/qht-bench.c               |  0
  tests/meson.build                           | 34 +--------------------
  8 files changed, 35 insertions(+), 33 deletions(-)

rename tests/{ => bench}/atomic64-bench.c (100%) rename tests/{ => bench}/atomic_add-bench.c (100%) rename tests/{ => bench}/benchmark-crypto-cipher.c (100%) rename tests/{ => bench}/benchmark-crypto-hash.c (100%) rename tests/{ => bench}/benchmark-crypto-hmac.c (100%) create mode 100644 tests/bench/meson.build rename tests/{ => bench}/qht-bench.c (100%)

tests/bench/atomic64-bench.c renamed from tests/atomic64-bench.c +0 -0
similarity index 100%
rename from tests/atomic64-bench.c
rename to tests/bench/atomic64-bench.c
tests/bench/atomic_add-bench.c renamed from tests/atomic_add-bench.c +0 -0
similarity index 100%
rename from tests/atomic_add-bench.c
rename to tests/bench/atomic_add-bench.c
tests/bench/benchmark-crypto-cipher.c renamed from tests/benchmark-crypto-cipher.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-cipher.c
rename to tests/bench/benchmark-crypto-cipher.c
tests/bench/benchmark-crypto-hash.c renamed from tests/benchmark-crypto-hash.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-hash.c
rename to tests/bench/benchmark-crypto-hash.c
tests/bench/benchmark-crypto-hmac.c renamed from tests/benchmark-crypto-hmac.c +0 -0
similarity index 100%
rename from tests/benchmark-crypto-hmac.c
rename to tests/bench/benchmark-crypto-hmac.c
tests/bench/meson.build new file +34 -0
new file mode 100644
index 0000000000..00b3c209dc
@@ -0,0 +1,34 @@
+
+qht_bench = executable('qht-bench',
+                       sources: 'qht-bench.c',
+                       dependencies: [qemuutil])
+
+executable('atomic_add-bench',
+           sources: files('atomic_add-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+executable('atomic64-bench',
+           sources: files('atomic64-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+benchs = {}
+
+if have_block
+  benchs += {
+     'benchmark-crypto-hash': [crypto],
+     'benchmark-crypto-hmac': [crypto],
+     'benchmark-crypto-cipher': [crypto],
+  }
+endif
+
+foreach bench_name, deps: benchs
+  exe = executable(bench_name, bench_name + '.c',
+                   dependencies: [qemuutil] + deps)
+  benchmark(bench_name, exe,
+            args: ['--tap', '-k'],
+            protocol: 'tap',
+            timeout: 0,
+            suite: ['speed'])
+endforeach
tests/bench/qht-bench.c renamed from tests/qht-bench.c +0 -0
similarity index 100%
rename from tests/qht-bench.c
rename to tests/bench/qht-bench.c
tests/meson.build +1 -26
index af43fd1eaf..55a7b08275 100644
@@ -1,18 +1,6 @@
  py3 = import('python').find_installation()
 
-qht_bench = executable('qht-bench',
-                       sources: 'qht-bench.c',
-                       dependencies: [qemuutil])
-
-executable('atomic_add-bench',
-           sources: files('atomic_add-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
-
-executable('atomic64-bench',
-           sources: files('atomic64-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
+subdir('bench')
 
  test_qapi_outputs = [
    'qapi-builtin-types.c',
@@ -73,26 +61,6 @@ test_deps = {
    'test-qht-par': qht_bench,
  }
 
-benchs = {}
-
-if have_block
-  benchs += {
-     'benchmark-crypto-hash': [crypto],
-     'benchmark-crypto-hmac': [crypto],
-     'benchmark-crypto-cipher': [crypto],
-  }
-endif
-
-foreach bench_name, deps: benchs
-  exe = executable(bench_name, bench_name + '.c',
-                   dependencies: [qemuutil] + deps)

tests/meson.build test_deps = { · line 66

Quoted 10 lines
tests/meson.build +0 -7
-  benchmark(bench_name, exe,
-            args: ['--tap', '-k'],
-            protocol: 'tap',
-            timeout: 0,
-            suite: ['speed'])
-endforeach
-
  if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
    executable('vhost-user-bridge',
               sources: files('vhost-user-bridge.c'),
#2 lore raw
In reply to Thomas Huth
Quoted 16 lines · Thomas Huth

Make it clear that these files are related to benchmarks by moving them into a new folder called "bench".

---
Based-on: [email protected]

  tests/{ => bench}/atomic64-bench.c          |  0
  tests/{ => bench}/atomic_add-bench.c        |  0
  tests/{ => bench}/benchmark-crypto-cipher.c |  0
  tests/{ => bench}/benchmark-crypto-hash.c   |  0
  tests/{ => bench}/benchmark-crypto-hmac.c   |  0
  tests/bench/meson.build                     | 34 +++++++++++++++++++++
  tests/{ => bench}/qht-bench.c               |  0
  tests/meson.build                           | 34 +--------------------
  8 files changed, 35 insertions(+), 33 deletions(-)
Quoted 7 lines

rename tests/{ => bench}/atomic64-bench.c (100%) rename tests/{ => bench}/atomic_add-bench.c (100%) rename tests/{ => bench}/benchmark-crypto-cipher.c (100%) rename tests/{ => bench}/benchmark-crypto-hash.c (100%) rename tests/{ => bench}/benchmark-crypto-hmac.c (100%) create mode 100644 tests/bench/meson.build rename tests/{ => bench}/qht-bench.c (100%)

I just noticed that I forgot to update MAINTAINERS... I'll squash in this hunk:

MAINTAINERS +1 -1
@@ -2729,7 +2729,7 @@ F: crypto/
 F: include/crypto/
 F: qapi/crypto.json
 F: tests/unit/test-crypto-*
-F: tests/benchmark-crypto-*
+F: tests/bench/benchmark-crypto-*
 F: tests/unit/crypto-tls-*
 F: tests/unit/pkix_asn1_tab.c
 F: qemu.sasl

Thomas

Acked-by on v1 1/1
#3 lore raw
In reply to Thomas Huth
Quoted 7 lines · Thomas Huth

Make it clear that these files are related to benchmarks by moving them into a new folder called "bench".

---
Based-on: [email protected]

Quoted 16 lines
 tests/{ => bench}/atomic64-bench.c          |  0
 tests/{ => bench}/atomic_add-bench.c        |  0
 tests/{ => bench}/benchmark-crypto-cipher.c |  0
 tests/{ => bench}/benchmark-crypto-hash.c   |  0
 tests/{ => bench}/benchmark-crypto-hmac.c   |  0
 tests/bench/meson.build                     | 34 +++++++++++++++++++++
 tests/{ => bench}/qht-bench.c               |  0
 tests/meson.build                           | 34 +--------------------
 8 files changed, 35 insertions(+), 33 deletions(-)
 rename tests/{ => bench}/atomic64-bench.c (100%)
 rename tests/{ => bench}/atomic_add-bench.c (100%)
 rename tests/{ => bench}/benchmark-crypto-cipher.c (100%)
 rename tests/{ => bench}/benchmark-crypto-hash.c (100%)
 rename tests/{ => bench}/benchmark-crypto-hmac.c (100%)
 create mode 100644 tests/bench/meson.build
 rename tests/{ => bench}/qht-bench.c (100%)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|