[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 43/74] tests: add test-list-simpleq
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 43/74] tests: add test-list-simpleq |
Date: |
Tue, 21 Aug 2018 19:02:15 +0200 |
From: "Emilio G. Cota" <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/Makefile.include | 4 ++++
tests/test-rcu-list.c | 17 +++++++++++++++++
tests/test-rcu-simpleq.c | 2 ++
3 files changed, 23 insertions(+)
create mode 100644 tests/test-rcu-simpleq.c
diff --git a/tests/Makefile.include b/tests/Makefile.include
index f3a761b..f6b6b22 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -116,6 +116,8 @@ check-unit-y += tests/rcutorture$(EXESUF)
gcov-files-rcutorture-y = util/rcu.c
check-unit-y += tests/test-rcu-list$(EXESUF)
gcov-files-test-rcu-list-y = util/rcu.c
+check-unit-y += tests/test-rcu-simpleq$(EXESUF)
+gcov-files-test-rcu-simpleq-y = util/rcu.c
check-unit-y += tests/test-qdist$(EXESUF)
gcov-files-test-qdist-y = util/qdist.c
check-unit-y += tests/test-qht$(EXESUF)
@@ -598,6 +600,7 @@ test-obj-y = tests/check-qnum.o tests/check-qstring.o
tests/check-qdict.o \
tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \
tests/test-opts-visitor.o tests/test-qmp-event.o \
tests/rcutorture.o tests/test-rcu-list.o \
+ tests/test-rcu-simpleq.o \
tests/test-qdist.o tests/test-shift128.o \
tests/test-qht.o tests/qht-bench.o tests/test-qht-par.o \
tests/atomic_add-bench.o
@@ -647,6 +650,7 @@ tests/test-cutils$(EXESUF): tests/test-cutils.o
util/cutils.o $(test-util-obj-y)
tests/test-int128$(EXESUF): tests/test-int128.o
tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y)
tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y)
+tests/test-rcu-simpleq$(EXESUF): tests/test-rcu-simpleq.o $(test-util-obj-y)
tests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y)
tests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y)
tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF)
$(test-util-obj-y)
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 9bd1136..c8bdf49 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -89,6 +89,8 @@ static void wait_all_threads(void)
struct list_element {
#if TEST_LIST_TYPE == 1
QLIST_ENTRY(list_element) entry;
+#elif TEST_LIST_TYPE == 2
+ QSIMPLEQ_ENTRY(list_element) entry;
#else
#error Invalid TEST_LIST_TYPE
#endif
@@ -112,6 +114,21 @@ static QLIST_HEAD(q_list_head, list_element) Q_list_head;
#define TEST_LIST_INSERT_HEAD_RCU QLIST_INSERT_HEAD_RCU
#define TEST_LIST_FOREACH_RCU QLIST_FOREACH_RCU
#define TEST_LIST_FOREACH_SAFE_RCU QLIST_FOREACH_SAFE_RCU
+
+#elif TEST_LIST_TYPE == 2
+static QSIMPLEQ_HEAD(, list_element) Q_list_head =
+ QSIMPLEQ_HEAD_INITIALIZER(Q_list_head);
+
+#define TEST_NAME "qsimpleq"
+#define TEST_LIST_REMOVE_RCU(el, f) \
+ QSIMPLEQ_REMOVE_RCU(&Q_list_head, el, list_element, f)
+
+#define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \
+ QSIMPLEQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f)
+
+#define TEST_LIST_INSERT_HEAD_RCU QSIMPLEQ_INSERT_HEAD_RCU
+#define TEST_LIST_FOREACH_RCU QSIMPLEQ_FOREACH_RCU
+#define TEST_LIST_FOREACH_SAFE_RCU QSIMPLEQ_FOREACH_SAFE_RCU
#else
#error Invalid TEST_LIST_TYPE
#endif
diff --git a/tests/test-rcu-simpleq.c b/tests/test-rcu-simpleq.c
new file mode 100644
index 0000000..057f7d3
--- /dev/null
+++ b/tests/test-rcu-simpleq.c
@@ -0,0 +1,2 @@
+#define TEST_LIST_TYPE 2
+#include "test-rcu-list.c"
--
1.8.3.1
- [Qemu-devel] [PULL 18/74] qsp: QEMU's Synchronization Profiler, (continued)
- [Qemu-devel] [PULL 18/74] qsp: QEMU's Synchronization Profiler, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 48/74] qemu-guest-agent: freeze-hook to ignore dpkg files as well, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 21/74] qsp: support call site coalescing, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 32/74] kvm: add call to qemu_add_opts() for -overcommit option, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 25/74] hmp-commands: add sync-profile, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 47/74] hw/intc/apic: Switch away from old_mmio, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 28/74] update-linux-headers.sh: add qemu_fw_cfg.h, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 34/74] target-i386: Fix lcall/ljmp to call gate in IA-32e mode, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 37/74] rcu_queue: remove barrier from QLIST_EMPTY_RCU, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 17/74] seqlock: constify seqlock_read_begin, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 43/74] tests: add test-list-simpleq,
Paolo Bonzini <=
- [Qemu-devel] [PULL 44/74] tests: add test-rcu-tailq, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 49/74] module: Use QEMU_MODULE_DIR as a search path, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 51/74] seqlock: add QemuLockable support, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 41/74] test-rcu-list: access counters with atomics, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 39/74] rcu_queue: add RCU QTAILQ, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 46/74] qom: convert the CPU list to RCU, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 23/74] tests/atomic_add-bench: add -p to enable sync profiler, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 52/74] cpus: protect TimerState writes with a spinlock, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 38/74] rcu_queue: add RCU QSIMPLEQ, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 45/74] spapr: do not use CPU_FOREACH_REVERSE, Paolo Bonzini, 2018/08/21