From nobody Wed Nov 5 14:28:09 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534872253680812.7410675798059; Tue, 21 Aug 2018 10:24:13 -0700 (PDT) Received: from localhost ([::1]:55047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsAO4-00059B-Fi for importer@patchew.org; Tue, 21 Aug 2018 13:24:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsA4b-00025B-F7 for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsA4V-0006mO-D4 for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:04 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:55483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsA4U-0006ZI-Kh for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:03:58 -0400 Received: by mail-wm0-x22d.google.com with SMTP id f21-v6so3618901wmc.5 for ; Tue, 21 Aug 2018 10:03:51 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id v6-v6sm2608955wmc.43.2018.08.21.10.03.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 10:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=S0DpfI/6XsdwkJNdJIsiH+sOJT8JUjZJpHmAc0MT+48=; b=LthhduXuwIfmVllSIhoMMbKZzAwHkT73PW80MoxJxX6mB4KH33Jo/rWb1QmyK5nEgb iwBL+8/pXBC3QAz/maTfxbf0qrcci1iz+uaIk75ZPnrMXNt/gWy/UZUI+/eNT5qJwIAV 06qQ9oYQzzWymFp4lRJhFSE3N5t2l/i0TBavvmEB02sgES5O4LJOXqh0IlTcwn47m2JL sQqA9yujOYnDIuLjWJSGDuMOXaB27f3WLhr81w+qD2G8+ie9pBTCMwe0taGGCNaMAXFF oqesLpnxmxmsYtEgmQu/4XR56ECFnqe0Lsq2MIZ7DMNcaBME7yZKa5Yu3fngH51j4bkA z6QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=S0DpfI/6XsdwkJNdJIsiH+sOJT8JUjZJpHmAc0MT+48=; b=telH0A1Sihzrgt86beKUTgSN3bgJC6t2h2KSKZYo4TYiVJIzLZaRaQ6Fb2rMKaMDJ+ bRAD3K80VkIfIPvduV2OtDygPqtdGUKs3IRXCL8OIGj0ErO8RGfO/GF/qy9symeLQ5Ar thEu5AeT7e1sXKYiDcZ4fuXCQp2DkyVfsYZbQ7YY5u6fVYKyUy1c46Ydzt374Hl64Zh2 LCgueRfJuydNP2cPtAzoza1bHL/oOQ5DeLvssMHUPeCI5Nr4PfWeiz7qN5+w+/qjtL7p Vtuu3p8ERbaVLLO5QERb2Al0KWNNpr1EB5rJLL/AKMRxGMVcAlriCNXJXy3gfSso1Ze5 UIPw== X-Gm-Message-State: APzg51A5N12O9NHp6c4DvEGjld+YRr4LGdjjIIc5d4k+CLo4qKxPvZeY yIxy44smUPi1Bqflbaq3Mm8VFOS6 X-Google-Smtp-Source: ANB0VdbUlpLLdQ1AXalcINCFVglLK/2Jv5uTPMRBGaLvAl9KMIxJnH19Qj+abwjmYvnmsQMWKZWSUQ== X-Received: by 2002:a1c:e54:: with SMTP id 81-v6mr161948wmo.84.1534871030690; Tue, 21 Aug 2018 10:03:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 19:02:15 +0200 Message-Id: <1534870966-9287-44-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> References: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d Subject: [Qemu-devel] [PULL 43/74] 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: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180819091335.22863-9-cota@braap.org> Signed-off-by: Paolo Bonzini --- 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 +=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) @@ -598,6 +600,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 @@ -647,6 +650,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) 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 =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 0000000..057f7d3 --- /dev/null +++ b/tests/test-rcu-simpleq.c @@ -0,0 +1,2 @@ +#define TEST_LIST_TYPE 2 +#include "test-rcu-list.c" --=20 1.8.3.1