From nobody Wed Nov 5 10:09: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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534670669444478.0491662339829; Sun, 19 Aug 2018 02:24:29 -0700 (PDT) Received: from localhost ([::1]:42190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJwh-0002lD-J8 for importer@patchew.org; Sun, 19 Aug 2018 05:24:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJmS-0002N1-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-0000do-OX for qemu-devel@nongnu.org; Sun, 19 Aug 2018 05:13:52 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1frJmP-0000cL-6M; 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 8A57221B7C; 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 BC8BA1028F; 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=YAoV2GI7FcAtz8 dJpYMADW24/TcDHq5JvP1X4D+aYX4=; b=nWtGcOzX4ixJ2Sd0MIlVfAWoQIjgRO xzQpu14esVyWnc5rE9dRppoMwFIeYV18/e9XSGuhLgKH/WSd8VoguSGvnxo2B9bW zSJBsbALuG9LeiWH2st03W69JDJjGiisPaCXiUbUPHabDYGPc/vynzzubYJ1Lm4V oUm8Cc8kzOitM= 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=YAoV2GI7FcAtz8dJpYMADW24/TcDHq5JvP1X4D+aYX4=; b=JwoVOqjf N3KMYzlTdL5R2aYzAP2vuWRjPze20cKpvT5XdoofydSKy0zFupt/uhNUZyUUUm+D Uuji9tGRhe6pWjynSV9/4sBNkEK5RRsocVmTnGJD4zP+4shXgQGkZAy8puERZiNP /Ria6c5YbhWaZJSLq1OrezoyK9B1drbtTwGiDvNdTzkWPKuAM/s0Zw1Nta5Txi8b +umCfK/GeBXKHG7WaanunsSmgwJDr+yE3cDojMkX3OHLF6pCdevS1smI1/5e05FA YElQeFtZCdqQ1N4gvv5Kb0nc4pXgQCegWnZ+OrYKFGd4FHcp2fPAN/Qnp/3qr1A7 9zs5FTUcl2ca+A== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Sun, 19 Aug 2018 05:13:33 -0400 Message-Id: <20180819091335.22863-10-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 09/11] tests: add test-rcu-tailq 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 | 15 +++++++++++++++ tests/test-rcu-tailq.c | 2 ++ tests/Makefile.include | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 tests/test-rcu-tailq.c diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index c8bdf49743..8434700746 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -91,6 +91,8 @@ struct list_element { QLIST_ENTRY(list_element) entry; #elif TEST_LIST_TYPE =3D=3D 2 QSIMPLEQ_ENTRY(list_element) entry; +#elif TEST_LIST_TYPE =3D=3D 3 + QTAILQ_ENTRY(list_element) entry; #else #error Invalid TEST_LIST_TYPE #endif @@ -129,6 +131,19 @@ static QSIMPLEQ_HEAD(, list_element) Q_list_head =3D #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 + +#elif TEST_LIST_TYPE =3D=3D 3 +static QTAILQ_HEAD(, list_element) Q_list_head; + +#define TEST_NAME "qtailq" +#define TEST_LIST_REMOVE_RCU(el, f) QTAILQ_REMOVE_RCU(&Q_list_head, el, f) + +#define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \ + QTAILQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f) + +#define TEST_LIST_INSERT_HEAD_RCU QTAILQ_INSERT_HEAD_RCU +#define TEST_LIST_FOREACH_RCU QTAILQ_FOREACH_RCU +#define TEST_LIST_FOREACH_SAFE_RCU QTAILQ_FOREACH_SAFE_RCU #else #error Invalid TEST_LIST_TYPE #endif diff --git a/tests/test-rcu-tailq.c b/tests/test-rcu-tailq.c new file mode 100644 index 0000000000..8d487e0ee0 --- /dev/null +++ b/tests/test-rcu-tailq.c @@ -0,0 +1,2 @@ +#define TEST_LIST_TYPE 3 +#include "test-rcu-list.c" diff --git a/tests/Makefile.include b/tests/Makefile.include index 997c27421a..5fe32fcfd0 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -118,6 +118,8 @@ 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-rcu-tailq$(EXESUF) +gcov-files-test-rcu-tailq-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) @@ -603,6 +605,7 @@ test-obj-y =3D tests/check-qnum.o tests/check-qstring.o= tests/check-qdict.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-rcu-tailq.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 @@ -653,6 +656,7 @@ 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-rcu-tailq$(EXESUF): tests/test-rcu-tailq.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