From nobody Mon Feb 9 18:44:18 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568039563; cv=none; d=zoho.com; s=zohoarc; b=KfJX6NuHsj3N6PLbpGXEvpZJ9WHVkg9vkYRChGwkuCCdfG2mFn5s7Avau8E/QniR/S2ek0ElZJtonfQOyShW/p7McZFcpHFC43pkDOF7WtqSxsCF2+qBVTpaCL0qOlzaUWDjuCiiZm5nJK8Id2A7W/dj3t9xJcoOOD1nq1HOWNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568039563; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vRg7aw2LbKeAthPW0mK+MEd2IrFGZl0eDlWnekaQ2HM=; b=CYFgTCgLa+jh3qxoyHrRjKoB15B5RxKMxW9uA1tOtihzQv6Oc8ykbEhIX45d1mAeTSZBGSJvL8WOZQS7pUEIBJGp0qtvLihicV4wFOZwRY6v2+HvntBsulsIcpkB+TTn8HpXuIseemYrDRRrHnfw0xzPZIsY6rAXp9j9GIqLEpI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568039563754286.8338294939291; Mon, 9 Sep 2019 07:32:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7Khg-0001Ni-2X; Mon, 09 Sep 2019 14:31:40 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7Khe-0001NW-Sq for xen-devel@lists.xenproject.org; Mon, 09 Sep 2019 14:31:38 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 87735a62-d30e-11e9-ac0d-12813bfff9fa; Mon, 09 Sep 2019 14:31:38 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 45CD0B65B; Mon, 9 Sep 2019 14:31:37 +0000 (UTC) X-Inumbo-ID: 87735a62-d30e-11e9-ac0d-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 9 Sep 2019 16:31:31 +0200 Message-Id: <20190909143134.15379-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190909143134.15379-1-jgross@suse.com> References: <20190909143134.15379-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v4 2/5] xen: add new CONFIG_DEBUG_LOCKS option X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Instead of enabling debugging for debug builds only add a dedicated Kconfig option for that purpose which defaults to DEBUG. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - rename to CONFIG_DEBUG_LOCKS (Jan Beulich) --- xen/Kconfig.debug | 7 +++++++ xen/common/spinlock.c | 4 ++-- xen/include/xen/spinlock.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index e10e314e25..1faaa3ba6a 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -51,6 +51,13 @@ config LOCK_PROFILE You can use serial console to print (and reset) using 'l' and 'L' respectively, or the 'xenlockprof' tool. =20 +config DEBUG_LOCKS + bool "Lock debugging" + default DEBUG + ---help--- + Enable debugging features of lock handling. Some additional + checks will be performed when acquiring and releasing locks. + config PERF_COUNTERS bool "Performance Counters" ---help--- diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 1be1b5ebe6..79e70a9947 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -9,7 +9,7 @@ #include #include =20 -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_LOCKS =20 static atomic_t spin_debug __read_mostly =3D ATOMIC_INIT(0); =20 @@ -97,7 +97,7 @@ void spin_debug_disable(void) atomic_dec(&spin_debug); } =20 -#else /* defined(NDEBUG) */ +#else /* CONFIG_DEBUG_LOCKS */ =20 #define check_lock(l) ((void)0) #define check_barrier(l) ((void)0) diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 24405386a7..6da55e74a2 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -7,7 +7,7 @@ =20 #define SPINLOCK_CPU_BITS 12 =20 -#ifndef NDEBUG +#ifdef CONFIG_DEBUG_LOCKS union lock_debug { uint16_t val; #define LOCK_DEBUG_INITVAL 0xffff --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel