From nobody Wed Nov 5 10:10:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534670541030999.9618081539841; Sun, 19 Aug 2018 02:22:21 -0700 (PDT) Received: from localhost ([::1]:42168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJuV-00011O-MB for importer@patchew.org; Sun, 19 Aug 2018 05:22:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJmS-0002N3-7R for qemu-devel@nongnu.org; Sun, 19 Aug 2018 05:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frJmP-0000dt-OE for qemu-devel@nongnu.org; Sun, 19 Aug 2018 05:13:52 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35053) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1frJmP-0000ce-6D; Sun, 19 Aug 2018 05:13:49 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 94B6B21B81; Sun, 19 Aug 2018 05:13:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 19 Aug 2018 05:13:48 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 86E821028D; Sun, 19 Aug 2018 05:13:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=6QtggCMRebidfH QmEsLpL+9R2vyurFG5lmQj7Q0+4S4=; b=T9vkG6gZLGCWY2eeEeC4diAJtGE1gB 79gpgtqIHhg347dOgYRPHFBgkgLYGaLwJWhZrIkZJ1RTbbvZPoOl56fI2+Bm/MCc u4VP5xyaQaKVP3vx74hBlCtSbUALM1gJaM4ooNJybvLios+6J+XtEGX3pdonbxtC 5mSX7eBxU2dZ4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=6QtggCMRebidfHQmEsLpL+9R2vyurFG5lmQj7Q0+4S4=; b=vpOM2mcf xvYJqNZKyCQLYh6PmUZebWVdG8+/CmtOTENzf31vjWm/3YuWTHH1ZR+1wzfI4UuJ CJVEIATkYyv3L+JB/3bWgAyI0HfZqECNOyK+horQMDKlzAmWxd97GOIgPCEnubLY B5y4iwJTMCPMuPkyfosH4IkKI9FF/w2Cnyvdf3XYvTBxkSWjPVzFSlb1RcwftFJB Rz9WBFJUgySAq/ig6gr7+IneZ7E2LWxBglYVtuo99KuvW4agE0Qw8LJzGh7aihJF r7skboR1ouXhjZeBX9fh7Ts6bHL2ry6bTaZ+owrHzZTGc6HL90WYMV2kyYKpwu0a DPD6blp5XC0Z2A== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Sun, 19 Aug 2018 05:13:32 -0400 Message-Id: <20180819091335.22863-9-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180819091335.22863-1-cota@braap.org> References: <20180819091335.22863-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 08/11] tests: add test-list-simpleq X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Crosthwaite , Riku Voipio , Alexander Graf , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota --- tests/test-rcu-list.c | 17 +++++++++++++++++ tests/test-rcu-simpleq.c | 2 ++ tests/Makefile.include | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 tests/test-rcu-simpleq.c diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 9bd11367a0..c8bdf49743 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 =3D=3D 1 QLIST_ENTRY(list_element) entry; +#elif TEST_LIST_TYPE =3D=3D 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_he= ad; #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 =3D=3D 2 +static QSIMPLEQ_HEAD(, list_element) Q_list_head =3D + 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 0000000000..057f7d33f7 --- /dev/null +++ b/tests/test-rcu-simpleq.c @@ -0,0 +1,2 @@ +#define TEST_LIST_TYPE 2 +#include "test-rcu-list.c" diff --git a/tests/Makefile.include b/tests/Makefile.include index 760a0f18b6..997c27421a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -116,6 +116,8 @@ check-unit-y +=3D tests/rcutorture$(EXESUF) gcov-files-rcutorture-y =3D util/rcu.c check-unit-y +=3D tests/test-rcu-list$(EXESUF) gcov-files-test-rcu-list-y =3D util/rcu.c +check-unit-y +=3D tests/test-rcu-simpleq$(EXESUF) +gcov-files-test-rcu-simpleq-y =3D util/rcu.c check-unit-y +=3D tests/test-qdist$(EXESUF) gcov-files-test-qdist-y =3D util/qdist.c check-unit-y +=3D tests/test-qht$(EXESUF) @@ -600,6 +602,7 @@ test-obj-y =3D 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 @@ -649,6 +652,7 @@ tests/test-cutils$(EXESUF): tests/test-cutils.o util/cu= tils.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) --=20 2.17.1