From nobody Mon Feb 9 09:33:48 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=1568294960; cv=none; d=zoho.com; s=zohoarc; b=fBPpl5KIIY+H0gm2Z+G254k7IhKVCHkVdn/GvsTU5y3022dnvvbpVe22rxbBXZHZpnMInIreYpavdss0AKGMZm0Aof7zjrucGg/qOBA+7gKiFcsh+s8dHZs6AmMqiC3NDafpTeS1d2UaQ7X+oQ6T+7m9gehhe2AggJn26H0X71w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568294960; 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=NKipkRNUdB+bNr1JBWDM2Ne1Ecgj3toW0U1yAJCnGhU=; b=fg8EjsY8SShZxRQFX1jcdRC0sBPrsqdn2XmQ50WBAs9G6FQQbeEUhrboUgKFKycgDEDcGta4wn6pNRClMhQ+dpmbfITE2Ep85/jmg2k7KpDgV7ptwjZMOMkQVfZA5cTng/OfZLAo1Lsu9fvK4FErBtPwU/PxfOehHx5Ii5C1yHo= 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 1568294960709127.37822371601112; Thu, 12 Sep 2019 06:29:20 -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 1i8P93-0005of-54; Thu, 12 Sep 2019 13:28:21 +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 1i8P91-0005oK-Ip for xen-devel@lists.xenproject.org; Thu, 12 Sep 2019 13:28:19 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2e769616-d561-11e9-9599-12813bfff9fa; Thu, 12 Sep 2019 13:28:18 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A57DAAFA4; Thu, 12 Sep 2019 13:28:17 +0000 (UTC) X-Inumbo-ID: 2e769616-d561-11e9-9599-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Thu, 12 Sep 2019 15:28:10 +0200 Message-Id: <20190912132813.6509-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190912132813.6509-1-jgross@suse.com> References: <20190912132813.6509-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v5 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 6bb1709881..f028bdca91 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 @@ -99,7 +99,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 df37550f02..79b582e05d 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