From nobody Mon Feb 9 00:02:21 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=1565330953; cv=none; d=zoho.com; s=zohoarc; b=HPGv2tdIaYaEoswjZqh+Srf4wlMT/Umft/Ps9UIz9P68ELpVolxpCmRMRP+X/voIwI14UNFuqYwY/jhiQRf7q+279wO+jZF10HJ5loemU0z9PE7HzOygdHOVNeD3wCaqiKbWzPjvFw5qxX4IhLy1/ew1BKhtT3KhpB2glV+FsvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565330953; 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=5Mejc43ebArGGhg9Kb1skjj1tzJxfqbdpsCBAsXBRoM=; b=kZErOW8S4+S6c4oGYK+pMcJvmoI3RbpUFmuy463vtneLWBa8g58yuGtfyG1YueNmT09qtaA+P/HMyZ5g2u13DHRu6iSlGS7u42lO8K3DwtaoNzH2ze745XL634yUpO5Bs8x8LwX5F4p9CSKulVp8hIopWwscA4BA57SzTkaNozI= 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 1565330953917783.9289571107361; Thu, 8 Aug 2019 23:09:13 -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 1hvy4C-0006dv-S1; Fri, 09 Aug 2019 06:07:56 +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 1hvy4C-0006dW-3r for xen-devel@lists.xenproject.org; Fri, 09 Aug 2019 06:07:56 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0462a7b2-ba6c-11e9-8e86-576d79567877; Fri, 09 Aug 2019 06:07:50 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CD806B07B; Fri, 9 Aug 2019 06:07:48 +0000 (UTC) X-Inumbo-ID: 0462a7b2-ba6c-11e9-8e86-576d79567877 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 9 Aug 2019 08:07:41 +0200 Message-Id: <20190809060744.8985-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190809060744.8985-1-jgross@suse.com> References: <20190809060744.8985-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 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 --- 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 97b6200bf5..dfa0b72f8d 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -6,7 +6,7 @@ #include #include =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