Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp72577rwe; Wed, 24 Aug 2022 17:17:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR7tHutwOLNyBS0bxlqWqUmXvGYiNfLM5aZfeeySb3PRAN3RGD8nSzR0CQwrEOqAgbPn8qyM X-Received: by 2002:a05:6402:f29:b0:446:6629:bbb6 with SMTP id i41-20020a0564020f2900b004466629bbb6mr1125183eda.384.1661386621536; Wed, 24 Aug 2022 17:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661386621; cv=none; d=google.com; s=arc-20160816; b=OGXwq/jW7acdE+lwF3+FbFKflMc3paORTYp6SGz6ipO98vi5uJIAorqfjvclpblwBT od5ZZHMW+f8jDes1sjleH8cBuD0ga/3bdl2t+agDHJfQbhkbcWo/lRculA8+WP4+Xxg4 MHTOaP+HTbcYpEFC7ih+n566rKohEf9h1y+srjXKty+78R2z6Sy48i0H/u7oE8EKSWIO fzPNWStcFM2mh5cfXvxcI1iKQV4pXko01uBh74ihKYn3NbatbqKfMrCGn1hGktuirGt5 95241Pdd420QzNMm/Oz45Bn1PG8GyGoZjF3iHUgm5Zhklt3LbQG9hXbsrj9e6DrWg8Xg uosg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qdenZNOnfMmQDVA+dVcw/A5Rdh+nYpdo/ob2KEpD0dU=; b=nwSF+yZtBHtgZKqjA6tFtOYAhOH8NkLyC9eLm8r/R/REDoAq7Cm+IRQ2bZn6j47CJD capCdoOTBaRKjE31br2ArRTjqdBue55tJkWSDN3ydgOXZv8IrYjGISRTDwySfdFCuVaP jar9aBhBfZ/5GxH6avaIUz8Bx4n9lizInHz4MAwG8PrR1DXpR7G/eEWLyytN+0AWfdT8 kWbxO12+oB7QWXPY8baOCZ+sLYGYtmpWGOgIFFhT7ssazSPJlOfH7aPKScgSICQpDHy6 XyUcpIo9SVWfd00ZxMIh3hkXEYw0utrznsuNLEUHoZQzhlYxfzCI3C/MWSx9wjN64Gly av3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FksFY9oA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg31-20020a170907971f00b00730a1069b72si2907580ejc.684.2022.08.24.17.16.35; Wed, 24 Aug 2022 17:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FksFY9oA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbiHXXZj (ORCPT + 99 others); Wed, 24 Aug 2022 19:25:39 -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-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" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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