From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A8C78D808CC for ; Tue, 15 Aug 2023 01:12:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=p5fbNEsvMgYDeOgwVGXpRo2ax3h4pdBP26Q5BlcaHrE=; c=relaxed/simple; d=groups.io; h=MIME-version:Subject:From:In-reply-to:Date:Cc:Message-id:References:To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-type:Content-transfer-encoding; s=20140610; t=1692061939; v=1; b=iX+Lz3/AUiOxpOLsgxW7Zfoa8fSJbEx/LFWzJkosx2OSzRrWoj5uN6d8MVnGJAx6lZyxchgK vRiDpurVVjokkAMVMZOsyCN9lWWY2HC5sGeqEWp0pkpO2TyUVwSt9uN6M+UhOSsV59p9oDBDq6v rxrwZcfnAkOgWRYuILcl+ons= X-Received: by 127.0.0.2 with SMTP id VxyzYY7687511xWd9VetUdFq; Mon, 14 Aug 2023 18:12:19 -0700 X-Received: from ma-mailsvcp-mx-lapp01.apple.com (ma-mailsvcp-mx-lapp01.apple.com [17.32.222.22]) by mx.groups.io with SMTP id smtpd.web10.124318.1692061938576865637 for ; Mon, 14 Aug 2023 18:12:18 -0700 X-Received: from ma-mailsvcp-mta-lapp02.corp.apple.com (ma-mailsvcp-mta-lapp02.corp.apple.com [10.226.18.134]) by ma-mailsvcp-mx-lapp01.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZE0070CRCH8M30@ma-mailsvcp-mx-lapp01.apple.com> for devel@edk2.groups.io; Mon, 14 Aug 2023 18:12:17 -0700 (PDT) X-Proofpoint-GUID: NKoH26Z0o3XQ4XQ7nN3J2g-WoJyqKmJF X-Proofpoint-ORIG-GUID: NKoH26Z0o3XQ4XQ7nN3J2g-WoJyqKmJF X-Received: from ma-mailsvcp-mmp-lapp03.apple.com (ma-mailsvcp-mmp-lapp03.apple.com [17.32.222.16]) by ma-mailsvcp-mta-lapp02.corp.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0RZE00EIZRCHL720@ma-mailsvcp-mta-lapp02.corp.apple.com>; Mon, 14 Aug 2023 18:12:17 -0700 (PDT) X-Received: from process_milters-daemon.ma-mailsvcp-mmp-lapp03.apple.com by ma-mailsvcp-mmp-lapp03.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0RZE00J00R05V700@ma-mailsvcp-mmp-lapp03.apple.com>; Mon, 14 Aug 2023 18:12:17 -0700 (PDT) X-Va-A: X-Va-T-CD: dd812dbd5dd7b5688a1a739da1e3f239 X-Va-E-CD: c51aabcee4ed1cb91c3a9cdee7e1cc98 X-Va-R-CD: 1e06e21a91ba478d544276c36c3bda2a X-Va-ID: 208234d0-c27f-4459-9c30-831011371236 X-Va-CD: 0 X-V-A: X-V-T-CD: dd812dbd5dd7b5688a1a739da1e3f239 X-V-E-CD: c51aabcee4ed1cb91c3a9cdee7e1cc98 X-V-R-CD: 1e06e21a91ba478d544276c36c3bda2a X-V-ID: 9399a7a0-a9fd-43e3-acd7-05643d61cc4c X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.234.148.110]) by ma-mailsvcp-mmp-lapp03.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0RZE00GC4RCDUD00@ma-mailsvcp-mmp-lapp03.apple.com>; Mon, 14 Aug 2023 18:12:17 -0700 (PDT) MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: [edk2-devel] [PATCH v1 0/7] Add DebugMacroCheck From: "Andrew Fish via groups.io" In-reply-to: Date: Mon, 14 Aug 2023 18:12:02 -0700 Cc: edk2-devel-groups-io , Pedro Falcato , Abner Chang , Alexei Fedorov , Ard Biesheuvel , Gerd Hoffmann , Igor Kulchytskyy , Jian J Wang , Jiewen Yao , Jordan Justen , Leif Lindholm , Liming Gao , Mike Kinney , Nickle Wang , Pierre Gondois , Sami Mujawar , Sean Brogan Message-id: <67F1D9F8-6DDB-4CBC-A19E-2EEE0FB0FA03@apple.com> References: <20230814204859.257-1-mikuback@linux.microsoft.com> To: Michael Kubacki Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,afish@apple.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: y4rr8ASut7rBGMudcmN5bW2qx7686176AA= Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="iX+Lz3/A"; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none > On Aug 14, 2023, at 5:26 PM, Michael Kubacki wrote: >=20 > On 8/14/2023 8:23 PM, Andrew Fish via groups.io wrote: >>> On Aug 14, 2023, at 3:51 PM, Pedro Falcato wr= ote: >>>=20 >>> On Mon, Aug 14, 2023 at 9:49=E2=80=AFPM Michael Kubacki >>> > wr= ote: >>>>=20 >>>> From: Michael Kubacki >>>>=20 >>>> Adds a new script and build plugin called DebugMacroCheck. >>>>=20 >>>> The script verifies that the number of print specifiers match the >>>> number of arguments in DEBUG() calls. >>>>=20 >>>> Overview: >>>>=20 >>>> - Build plugin: BuildPlugin/DebugMacroCheckBuildPlugin.py >>>> - Runs on any build target that is not NO-TARGET >>>> - Standalone script: DebugMacroCheck.py >>>> - Run `DebugMacroCheck.py --help` to see command line options >>>> - Unit tests: >>>> - Tests/test_DebugMacroCheck.py >>>> - Can be run with: >>>> `python -m unittest discover -s ./.pytool/Plugin/DebugMacroCheck/te= sts -v` >>>> - Also visible in VS Code Test Explorer >>>>=20 >>>> Background: >>>>=20 >>>> The tool has been constantly run against edk2 derived code for about >>>> a year now. During that time, its found over 20 issues in edk2, over >>>> 50 issues in various vendor code, and numerous other issues specific >>>> to Project Mu. >>>>=20 >>>> See the following series for a batch of issues previously fixed in >>>> edk2 discovered by the tool: >>>>=20 >>>> https://edk2.groups.io/g/devel/message/93104 >>>>=20 >>>> I've received interest from vendors to place it in edk2 to >>>> immediately find issues in the upstream and make it easier for edk2 >>>> consumers to directly acquire it. That led to this patch series. >>>>=20 >>>> This would run in edk2 as a build plugin. All issues in the edk2 >>>> codebase have been resolved so this would find new issues before >>>> they are merged into the codebase. >>>=20 >>> Hi, >>>=20 >>> I really like this change but I cannot stop and think that if DEBUG >>> and PrintLib were ISO C compliant, we could be using normal interfaces >>> with normal argument types and the compiler's intrinsic knowledge of >>> printf-like functions. >>> Have you explored that option for future code? See e.g >>> https://godbolt.org/z/4e8d3WToT (I don= 't know what MSVC uses, if >>> anything). >>>=20 >> I have a dream that we add an eft_print as an attribute format archetype= and then do what you recommend. After all clang and gcc are open source. > I agree that would be preferred. I did something in similar in GCC at the= time, but I couldn't find an equivalent in VS. The issues kept appearing s= o this was a cross-platform way to address it. >=20 This is a case that CI can help :) Thanks, Andrew Fish=20 > I uploaded some usage examples to the PR for reference: > https://github.com/tianocore/edk2/pull/4736 >=20 > Thanks, > Michael >> Thanks, >> Andrew Fish >>> -- >>> Pedro >>>=20 >>>=20 >>=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107752): https://edk2.groups.io/g/devel/message/107752 Mute This Topic: https://groups.io/mt/100745693/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-