From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65815C433FE for ; Fri, 30 Sep 2022 23:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbiI3XpK (ORCPT ); Fri, 30 Sep 2022 19:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbiI3Xo6 (ORCPT ); Fri, 30 Sep 2022 19:44:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8AB8252BE for ; Fri, 30 Sep 2022 16:44:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F2EDAB82AC0 for ; Fri, 30 Sep 2022 23:44:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87B86C433C1; Fri, 30 Sep 2022 23:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1664581474; bh=uvYpddO6MRenGX78zzZpTJyrDLbw97c/2eqNe4roZ9Q=; h=Date:To:From:Subject:From; b=ht9NK3fvk6D40aQNnUNKq0Cvi9Dd/4jbzMlgxUUFsxKyNxdneuSuRzrefdWRMELm5 15S6jXiwf/QqWyFDNLxILYPC2jyXvYyUd7YIV3YyxTRaNJf6HwJaLct+BbrnpqYji1 RZ8hRl1G394kCuEynl7Jf0j/xhnDuXmcCiMx8IGs= Date: Fri, 30 Sep 2022 16:44:33 -0700 To: mm-commits@vger.kernel.org, vbabka@suse.cz, peterz@infradead.org, ndesaulniers@google.com, nathan@kernel.org, michal.lkml@markovi.net, maskray@google.com, masahiroy@kernel.org, linux@rasmusvillemoes.dk, keescook@chromium.org, jpoimboe@kernel.org, isabbasso@riseup.net, edumazet@google.com, dan.j.williams@intel.com, dmitrii.bundin.a@gmail.com, akpm@linux-foundation.org From: Andrew Morton Subject: [to-be-updated] kbuild-add-debug-level-and-macro-defs-options.patch removed from -mm tree Message-Id: <20220930234434.87B86C433C1@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The quilt patch titled Subject: kbuild: add debug level and macro defs options has been removed from the -mm tree. Its filename was kbuild-add-debug-level-and-macro-defs-options.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Dmitrii Bundin Subject: kbuild: add debug level and macro defs options Date: Mon, 15 Aug 2022 04:33:17 +0300 Add config options to control debug info level and producing of macro definitions for GCC/Clang. Option DEBUG_INFO_LEVEL is responsible for controlling debug info level. Before GCC 11 and Clang 12 -gsplit-dwarf implicitly uses -g2. To provide a way to override the setting with, e.g. -g1, DEBUG_INFO_LEVEL is set independently from DEBUG_INFO_SPLIT. Option DEBUG_MACRO_DEFINITIONS is responsible for controlling inclusion of macro definitions. Since Clang uses -fdebug-macro to control if macro definitions are produced which is different from GCC, provides a compiler-specific way of handling macro inclusion. The option is handled after DEBUG_INFO_LEVEL since -g3 -g2 implies -g2, but -g2 -g3 implies -g3 and GCC uses -g3 to produce macro definitions. Link: https://lkml.kernel.org/r/20220815013317.26121-1-dmitrii.bundin.a@gmail.com Signed-off-by: Dmitrii Bundin Cc: Dan Williams Cc: Eric Dumazet Cc: Fangrui Song Cc: Isabella Basso Cc: Josh Poimboeuf Cc: Kees Cook Cc: Masahiro Yamada Cc: Michal Marek Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Rasmus Villemoes Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- lib/Kconfig.debug | 20 ++++++++++++++++++++ scripts/Makefile.debug | 12 ++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) --- a/lib/Kconfig.debug~kbuild-add-debug-level-and-macro-defs-options +++ a/lib/Kconfig.debug @@ -304,6 +304,26 @@ config DEBUG_INFO_REDUCED DEBUG_INFO build and compile times are reduced too. Only works with newer gcc versions. +config DEBUG_INFO_LEVEL + int "Debug info level" + range 1 3 + default "2" + help + Sets the level of how much debug information to generate (-glevel). + Level 1 produces minimal debug information without including information + about local variables. Level 3 includes extra information like macro + definitions. Setting up level 3 will require significantly more disk + space and increase built time. + +config DEBUG_MACRO_DEFINITIONS + bool "Add macro definitions to debug info" + default n + help + Generates macro definitions to provide a way to expand macros right + in the debugging session. This information can be used with macro expand, + info macro in gdb. This option is equivalent to setting -g3 in GCC and + -fdebug-macro in Clang. + config DEBUG_INFO_COMPRESSED bool "Compressed debugging information" depends on $(cc-option,-gz=zlib) --- a/scripts/Makefile.debug~kbuild-add-debug-level-and-macro-defs-options +++ a/scripts/Makefile.debug @@ -2,8 +2,6 @@ DEBUG_CFLAGS := ifdef CONFIG_DEBUG_INFO_SPLIT DEBUG_CFLAGS += -gsplit-dwarf -else -DEBUG_CFLAGS += -g endif ifndef CONFIG_AS_IS_LLVM @@ -16,6 +14,16 @@ dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5 DEBUG_CFLAGS += -gdwarf-$(dwarf-version-y) endif +DEBUG_CFLAGS += -g$(CONFIG_DEBUG_INFO_LEVEL) +ifdef CONFIG_DEBUG_MACRO_DEFINITIONS +ifdef CONFIG_CC_IS_GCC +DEBUG_CFLAGS += -g3 +endif +ifdef CONFIG_CC_IS_CLANG +DEBUG_CFLAGS += -fdebug-macro +endif +endif + ifdef CONFIG_DEBUG_INFO_REDUCED DEBUG_CFLAGS += -fno-var-tracking ifdef CONFIG_CC_IS_GCC _ Patches currently in -mm which might be from dmitrii.bundin.a@gmail.com are