From patchwork Tue May 24 13:56:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 9133725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC54E6075E for ; Tue, 24 May 2016 13:59:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EDEF28233 for ; Tue, 24 May 2016 13:59:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 939D928258; Tue, 24 May 2016 13:59:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E4ED2824F for ; Tue, 24 May 2016 13:59:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5CpP-000650-23; Tue, 24 May 2016 13:56:59 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5CpN-00064m-FM for xen-devel@lists.xen.org; Tue, 24 May 2016 13:56:57 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id 8C/22-17755-8AD54475; Tue, 24 May 2016 13:56:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRWlGSWpSXmKPExsVyMXThEd0VsS7 hBh03WCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oz3/dOZCqaLVGxatJ2pgbFRsIuRi0NIYBKj xPNLv5hAHBaBecwSjTu+soM4EgL9rBJH5hxn62LkAHJiJDadsOxi5AQyyyVOPm5nBbGFBBQkf k84xAQxaQqTxLOt3xlBEmwCGhJPfs1gA7FFBKQlrn2+zAhSxCzwjEni9eEuZpCEsIC5xL53l5 hAbBYBVYkrL2eCNfMKOEp0tCxlh1gsJ7HgvQ+IySngJLHtmzzEXkeJx/OPME9gFFjAyLCKUaM 4tagstUjX0EIvqSgzPaMkNzEzR9fQ0EQvN7W4ODE9NScxqVgvOT93EyMwsOoZGBh3MB7Z7nmI UZKDSUmU10DLJVyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBG9BDFBOsCg1PbUiLTMHGOIwaQkOH iUR3qsgad7igsTc4sx0iNQpRkuOLb+vrWXi+LTxDpDcNvXeWiYhlrz8vFQpcYh5AiANGaV5cO NgcXiJUVZKmJeRgYFBiKcgtSg3swRV/hWjOAejkjDvE5ApPJl5JXBbXwEdxAR0kP8XZ5CDShI RUlINjMv/mcakJyZv0bU4UDFJVmnj1wLtXy+3VV87tCBPsaN+J7/RWoFjZY3Z154177uwL+pw ZcQxx86GFaZMGy/LOdxw7Tno2Stj4PGm9FeQr/Syrm/N1+w+f+FoY7m7sKhQ9ne/ecf8x3cU1 l/onpYpNOWBcKZKfMjT8F9H9oXKhbn4iZzpklFQV2Ipzkg01GIuKk4EACJdZkW+AgAA X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1464098214!43580444!1 X-Originating-IP: [209.85.161.196] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21615 invoked from network); 24 May 2016 13:56:55 -0000 Received: from mail-yw0-f196.google.com (HELO mail-yw0-f196.google.com) (209.85.161.196) by server-12.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 May 2016 13:56:55 -0000 Received: by mail-yw0-f196.google.com with SMTP id l126so2322265ywe.3 for ; Tue, 24 May 2016 06:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=82mXQNuksOqZKoZpnXOGH+DKukH0b/pq+oyeJWoUBtM=; b=BRNEYcmJGia73gUVPcXVoSecnBqKpkOiKCCK5Dux0TMXtGACJhpMv3UyUUgQd9TGDG 5sFbX0MRkqZcB7mQ6Je3xMOfcvQmymlaQECM+DH+CHrmV9WlExUXN6ORdJZayFWI856U xzXnt3RNnmCj5cggIVelzQtcSaiQ7kAdkgBhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=82mXQNuksOqZKoZpnXOGH+DKukH0b/pq+oyeJWoUBtM=; b=erxRe50H8fe1ud6oB4yFNRHsS1maPaxtfaMqy+6giIkn5KplpFATwDu4laMvUSefei ggtBw05jmCaGihJO/IBS7PFSqaf8PP5mJt68d9N76ENgeXrvB39PpCsNEb9ojXO2+Jm8 VLg4Iy3+taY5/VhF8gCu9+wZqval3af+rxKPm3EchSctEN1vQl4/3af9VrLD4uDUNenV rTCJrlCR2YNkzH+MkogevcqJfovGYmIT6VhM6odQfZzwx++JYZk4HfoKfThm3dA+xURa x8rCTUGnfi5U6RUmTCv/FidIgAhA5OdFDq46J3TPlQhyw4+gQPjZwud1zEFr8rEexsAG Yu1w== X-Gm-Message-State: ALyK8tJI4yZGe0TmSGpDU5L2psf5yueADPZ68OZ3LKNgwl9M7Glgo4NoEZhgH+h8sqCwug== X-Received: by 10.13.246.6 with SMTP id g6mr2613020ywf.202.1464098214153; Tue, 24 May 2016 06:56:54 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id i67sm22199641ywf.34.2016.05.24.06.56.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 May 2016 06:56:52 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Tue, 24 May 2016 08:56:34 -0500 Message-Id: <1464098199-19851-2-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1464098199-19851-1-git-send-email-cardoe@cardoe.com> References: <1464098199-19851-1-git-send-email-cardoe@cardoe.com> Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Doug Goldstein , Tim Deegan , Jan Beulich , Ian Jackson Subject: [Xen-devel] [PATCH v5 1/6] build: convert debug to Kconfig X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enabling debug will disable NDEBUG which will result in more debug prints. There are a number of debugging options for Xen so place the debug option under a menu for different debugging options to have a way to group them all together. Signed-off-by: Doug Goldstein Reviewed-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich --- CC: Andrew Cooper CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Tim Deegan CC: Wei Liu --- xen/Kconfig | 2 ++ xen/Kconfig.debug | 14 ++++++++++++++ xen/Rules.mk | 5 +++-- xen/include/xen/config.h | 4 ++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 xen/Kconfig.debug diff --git a/xen/Kconfig b/xen/Kconfig index fa8b27c..0fe7a1a 100644 --- a/xen/Kconfig +++ b/xen/Kconfig @@ -26,3 +26,5 @@ config DEFCONFIG_LIST config EXPERT string option env="XEN_CONFIG_EXPERT" + +source "Kconfig.debug" diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug new file mode 100644 index 0000000..796af0c --- /dev/null +++ b/xen/Kconfig.debug @@ -0,0 +1,14 @@ + +menu "Debugging Options" + +config DEBUG + bool "Developer Checks" + default y + ---help--- + If you say Y here this will enable developer checks such as asserts + and extra printks. This option is intended for development purposes + only, and not for production use. + + You probably want to say 'N' here. + +endmenu diff --git a/xen/Rules.mk b/xen/Rules.mk index 961d533..da2f490 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -20,13 +20,14 @@ include $(XEN_ROOT)/Config.mk ifeq ($(debug),y) verbose := y frame_pointer := y -else -CFLAGS += -DNDEBUG endif ifeq ($(perfc_arrays),y) perfc := y endif +ifeq ($(origin debug),command line) +$(warning "You must use 'make menuconfig' to enable/disable debug now.") +endif ifneq ($(origin kexec),undefined) $(error "You must use 'make menuconfig' to enable/disable kexec now.") endif diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index ef6e5ee..473c5e8 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -81,4 +81,8 @@ /* allow existing code to work with Kconfig variable */ #define NR_CPUS CONFIG_NR_CPUS +#ifndef CONFIG_DEBUG +#define NDEBUG +#endif + #endif /* __XEN_CONFIG_H__ */