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 848AEC04AA5 for ; Wed, 24 Aug 2022 23:25:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230249AbiHXXZk (ORCPT ); Wed, 24 Aug 2022 19:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbiHXXZe (ORCPT ); Wed, 24 Aug 2022 19:25:34 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9AB24F31 for ; Wed, 24 Aug 2022 16:25:32 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id l1so25470207lfk.8 for ; Wed, 24 Aug 2022 16:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=qdenZNOnfMmQDVA+dVcw/A5Rdh+nYpdo/ob2KEpD0dU=; b=FksFY9oAmSOHfvq06W6xAF3vyRHVNtyCiY4HBZsHFTf4mahnVqotP09dXrZK0+U8q3 yT+ErzrB41E+RR7FMzXnthM1TKzdoXfmJfYuFYCwUPthyDqsAKvIJ7El+Tqaxj9wr7Z+ DONrDC7wiaaQraljh1BJH/uRIyPx+GDm2pX/EeFeAfZUmJtWYn2pVI+Kk5H7QX2ogwz3 h2tpX3Q6NN8Z4aOM4fYIO1SOcpjsof5lHpi5uSr4yDxp6qQw3uMv1RvOM34jypQerRxR ZObWkZlxYXqtxm1USOVCxsMeMonEKoiJp7FA/ALI2NuFriUMPZNpPloTl3E40ynQo9/d HIQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=qdenZNOnfMmQDVA+dVcw/A5Rdh+nYpdo/ob2KEpD0dU=; b=rPpCOc0k46zgL7mxWKxUQqhiNCL/Afm5/rNfFniPokR8uFBfxkUdm/roCR/56s9n7B flrqdyQGdRXP3L/S8vr5zIjGNvZoeX5aaoJnZk4mKwa88PV3y1FbCKnd4ZEqssooAE39 MnYrS+9XaryVmOf1b9kyFHGCCJSSMcJjtXN7y4e3OPnT/Qx8TWvzeM14LOhsff4Wczty XDUO7ONhivRmGcWxE5E0N0QMiXkpnUXq3l9MIP3btiYhF5ejBrW/GQMiR6+uqaDFx1Un WPnjZ2y6lw4DajPjWSmfhdUHToD3ao5jnxCPWwXwgRmkZu+nLClKj8mgwqI1OvAXRRBD ToiQ== X-Gm-Message-State: ACgBeo0/TFG8Q7MSK1g+7TZVjaTY0fEz0VuDdCn6xFWMQebZFcE6VqyR 97ZXQSCPCelo/oRPLdXpqXkjMYuP7hskwdDhjhD+lA== X-Google-Smtp-Source: AA6agR4zfL+mCyLPMvuzZV2d0nSZGb30JxRL/1Oxqun0mRzweDJVz11GA913syEmKL4OC4Jzm+bxlVcirJkUIN9yLQc= X-Received: by 2002:a05:6512:2356:b0:492:e06d:7530 with SMTP id p22-20020a056512235600b00492e06d7530mr296877lfu.103.1661383530456; Wed, 24 Aug 2022 16:25:30 -0700 (PDT) MIME-Version: 1.0 References: <20220815013317.26121-1-dmitrii.bundin.a@gmail.com> In-Reply-To: From: Nick Desaulniers Date: Wed, 24 Aug 2022 16:25:19 -0700 Message-ID: Subject: Re: [PATCH v3] kbuild: add debug level and macro defs options To: Dmitrii Bundin Cc: Masahiro Yamada , Andrew Morton , Dan Williams , Eric Dumazet , Isabella Basso , Josh Poimboeuf , Kees Cook , Linux Kbuild mailing list , Linux Kernel Mailing List , Rasmus Villemoes , Fangrui Song , Michal Marek , Nathan Chancellor , "Peter Zijlstra (Intel)" , Vlastimil Babka , Doug Anderson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 22, 2022 at 3:42 PM Dmitrii Bundin wrote: > > On Tue, Aug 23, 2022 at 12:36 AM Nick Desaulniers > wrote: > > > > or perhaps that simply needs to be `-g -gsplit-dwarf`? In which case, > > that if/else could just be re-arranged. > > How about simply assigning DEBUG_CFLAGS := -g at the very beginning > without any conditions? This would provide the default with the > possibility of overriding later and -gsplit-dwarf does not necessarily > come with -g implicitly. SGTM; I'd accept such a patch. > > Honestly, I really don't think we need to be wrapping every compiler > > command line flag under the sun in a kconfig option. > > This indeed sounds reasonable to me. So the key point here is to not > bloat the kconfig with options related to every compiler flag. But I > think it still might be useful to provide some option that would > include sort of full debug information compilers may produce. With > this approach there would be, in fact 3 different levels of debug > information supported by Kconfig: reduced, default and full. The full > level would increase everything like -g3, and -fdebug-macro for Clang, > and probably others. Has anyone asked for that though? It seems like your intent with this patch is to fix the surprising+user hostile behavior of compilers requiring -g to be used when -gsplit-dwarf is used. If someone using GDB_SCRIPTS or KGDB was like "man, I wish I could debug macros" then sure I'd be more likely to accept this. Without the need, this is just wrapping every compiler option in a kconfig, which frustrates randconfig testing bots. This will slow them down and bloat their artifacts when randconfig selects -g3, so I'd like someone to come forward saying they need this and why. > > > Or add -g1 to CONFIG_DEBUG_INFO_REDUCED. > > I ran some tests and there was indeed some decrease in size. That > combination probably might be useful. > > Any thoughts? I think there's also -gmlt; when that is preferable to -g1 IDK. Why either of those weren't used in the first place, IDK. The help text in DEBUG_INFO_REDUCED in lib/Kconfig.debug makes it sound like -gmlt is what is wanted. Maybe that should be updated. But I think DEBUG_INFO_REDUCED is redundant if we were to accept DEBUG_INFO_LEVEL. Both don't need to exist IMO. -- Thanks, ~Nick Desaulniers