From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.5469.1645670015592223334 for ; Wed, 23 Feb 2022 18:33:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=CtJKSBWH; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: guomin.jiang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645670015; x=1677206015; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gYmaKgjn4cGH4/sFU2F/RBhcOYaZZh3TFY7adKdMbMw=; b=CtJKSBWHrbSBz98LV2yoDr92joYx8OjeaKkyseGT2X2ryAxLYDCr7lzv 0d2Pm7FkR1KOuH8WE168/7I7hG3iKfTfQl8K4ckJjIRRMhjFSRw41+uQj MKVtPGixc1kfg/Tlq8cG4V6CzCWJakvmf6FkFG65G3AyHdKKZeCh+Yzp7 Dja4ySbSM1TyjC0faxYj8E9OsimPAgPbUyQ1FkAztUFAYKLSCXXKbBzI4 6VxWEX09Ay9VCNBiGrQpwj7Dx1r2ICCHio2RyjHTIRjJNIGCa5d9wyp4l wxqS1WDQyDGW7c6WuUnke+hmTc4yRaN/ncvthRLgUKGqcbKsjtAk9dO9v A==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="251869129" X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="251869129" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 18:33:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,392,1635231600"; d="scan'208";a="543549613" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga007.fm.intel.com with ESMTP; 23 Feb 2022 18:33:32 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 23 Feb 2022 18:33:31 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 23 Feb 2022 18:33:31 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 23 Feb 2022 18:33:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1mGSjZnEDdFPgLXyD6oTU09IakfveKYYADHDyOO1lTPMfv50D8G2r+V4AECfAHmVSk4r3xiN0ABIIqptgr873B1x0yQXctCNC0rSnNNgXBcmmgtDi+tZZSVO+G9fiJFEkoI2G+MbqgY4CETfeEH7TM4l4kakacC/W4brdeNRkjJkod0+0TVACtJ+ru7ZNViV4rr61O+ATHTWzXEogq+BCRFCksAX+Gw+lK13qW3D1dAcoeaPyJ38018waLvAK5SJKi94jIBv/r8NPIpF+JVoWBYB5HeuQCjeXt2caZOGN+Von/Pw40m8VwNNPtGgkn9KukxxwFXAgGOoO9WISer6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZlDOeYdTQJ/seDgN6YAzNtnJzGKZaAMz+pek/ZkR9TE=; b=Oqewygi6XjknNeZcmNBzhwe9CJb3Z6TyjU0HfFF/GdHY7DfPpCfJgCqmW8xSrWUit7OpuV89wp7FBm2bLwsNLsPXX7VyMbGRUK9lJtPKW8Y0lY2GDKmJomETscJHsC2gIzGO9mPH+02kw2R+3EERA2/J+iqsE44rLeZpXJsm9UWsCnrDg34mTNMA18AIYAyQFP5T/8EZVCbwlvoHZ4laau0hz/vgDG11/kz9kzKZ3GDzX2tMpuE57xBhtiSnnBjDxbQdUC4zRUuX67snkZsSV5hRbZWL4y2lbARTNBQMFuzESbWDDQpMNN4GIfniMwxHFJ5VZMjI0nL2wPF96MztUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN0PR11MB5696.namprd11.prod.outlook.com (2603:10b6:408:14b::11) by SA0PR11MB4703.namprd11.prod.outlook.com (2603:10b6:806:9f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23; Thu, 24 Feb 2022 02:33:27 +0000 Received: from BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::f80c:f1ef:6d46:20ec]) by BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::f80c:f1ef:6d46:20ec%2]) with mapi id 15.20.5017.022; Thu, 24 Feb 2022 02:33:27 +0000 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "Liu, Zhiguang" , "Gao, Liming" CC: "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH 2/2] MdePkg/Include: Define new DEBUG_FILE to specify path. Thread-Topic: [edk2-devel] [PATCH 2/2] MdePkg/Include: Define new DEBUG_FILE to specify path. Thread-Index: AQHYJG+kwmT6PlopHEOl9xeI/KzEKayiBJXQ Date: Thu, 24 Feb 2022 02:33:27 +0000 Message-ID: References: <20220218023008.1347-1-guomin.jiang@intel.com> <16D4C08DC1603ADF.6551@groups.io> In-Reply-To: <16D4C08DC1603ADF.6551@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 57e22500-0f46-4bc5-4022-08d9f73e09cf x-ms-traffictypediagnostic: SA0PR11MB4703:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mdhNBgFTz7scB4PGwiN8Q+k2MTV2fXG71MkHNaq/HbpnZaW4vsdw5NhU4i1PDjXlt2NSo3q5u3MlwSkFdpYzc02IfxubU8Kb52zwjrpl1JRSo7luK8DikSln31XpDrM9RHSHBwkhgS+eyHW6V0xR1nuqfJRroDsBlpKmTiqx0OsYRtca0vBLDFbW8zA1cq0APTHc9m7hUjOVvMKBkqcujs4KcFTv6qWKnUEogfiF+jR01OSwToV2pBs5IjYx9IJyIDp5sCbE71Gh21B8qN9pjk7o80Lsf+0updlqi6yVp4tjUcruYs6oIK7m/MXtd7/hgyBjYIkyP+o4nnG4mSYJPAM+5j8rXb87CEX97DAOE1qzyJlPnm2Erdc0WkLRoUZFDufD43t2wZx8aDAIQHFbx43j3HyeCFFqJLH1lxFLCMODAPY2d9r30IhDguSPoqZHbGtNadpWto/7UyF/fz4AqpiNTDEFWhOFw4VzcgeOlje062dc0mk4jFR4NC9iHq3UN8wCPpDs8hw0CfTJKmS6S4MK5yq/jK+XUDPmR/efDXObedi2np0z6kyg54VJjh9+8ODqpiWRZrp7DaNMszmvgc8pXUNhPUhhMaBOgvQeGgk/yRn3NYjJRYmbIr171UW9WA3ttFdKP+HnghZUcKDJkOrCUdPpKNzWSv9OnJI5woFyejECFOBKep8jn+ea+caTkkLQC4YZUYYbl8Dk6rdzggCwSyWBqfoOoJ5PasfnLqtyF0i9K4AiK690qj4UWmywDWY6oRjP/cKkHBhuRP+ecJfK7glEY7Y6nNCDEvDWuCLchJ5SR6/aha+Sye3yNKhKMt1qACRTSs5bpAoyKucCog== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR11MB5696.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(26005)(8936002)(52536014)(5660300002)(186003)(316002)(110136005)(107886003)(38100700002)(71200400001)(966005)(508600001)(86362001)(33656002)(38070700005)(9686003)(53546011)(6506007)(2906002)(83380400001)(66946007)(76116006)(7696005)(55016003)(122000001)(66556008)(8676002)(64756008)(66476007)(66446008)(82960400001)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yZBhZG/Mlt80P04oMDvf/OycBU9NS4A52CyC0hOFLmQvhFiKMi7J1wJIvgV0?= =?us-ascii?Q?6Gez1km3GtjI5H8Nmex8Zo3BRGs7l+P36oRav9DYl2GAhXl4Qiq9ejbALNWv?= =?us-ascii?Q?/3PHq+UQ+Aqj+0j9lWsbp+A5Sl7LxBuO+jP76ntdhFmebCCuxkI1M7bOduOc?= =?us-ascii?Q?AbyymoLXUbgzHqau0YCimCoBeYXb9NCxRZb51hHFxhIii/ozrLfRM1vI3Mnr?= =?us-ascii?Q?bZ2lREs58KOGqAa1EEdsxGhIG1nf8Bnw3vrup8tSCixwHqN9L7dDNGLi9JP0?= =?us-ascii?Q?nw0aoUpkQCxyjr7siOFiNGPk7XqB/Pm63cy/o+uNmbbPvDEa2BDy7PHIK8dy?= =?us-ascii?Q?daenO/vezIr5b8YPSKaKw//VKXXGjK73sQMi9e0YPQC0FhW1JqbQh6C7YASd?= =?us-ascii?Q?9BWhXC3R/txfYcpkK/3M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-ascii?Q?ed8o/rQ88rSFtgPcWd9YaXiLeMckX7kN1ek53Xo4RvSCucXWpQxmhBKzm0he?= =?us-ascii?Q?G6f/N4ThrVDdoLMWfQgiN8pKuo4pL7Ra+QbeB+t+MCx+LqDljRHFDYPtQate?= =?us-ascii?Q?y0N/6OR37YK0cG/MAWxXTG/Qc1vfuI6lVKS36fES6E4FFkcj30t/CttcQhaI?= =?us-ascii?Q?xaJQwELIn2jYrsomdMJCASPLLo6VGimNkEPO8rdo0e9RNMKD+UNi+lprHzea?= =?us-ascii?Q?T5yzAhUGk/2lS4nrXRNZo9Q9VtrOC9+dR0rWXsPEtt95XtRx7avvCYzF2tkP?= =?us-ascii?Q?w7syaww8wnwJTAIzpudawl8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5696.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57e22500-0f46-4bc5-4022-08d9f73e09cf X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2022 02:33:27.3465 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NyUTVl/o4Hf58d5DYGXNhKr5dbfKMBIU8So5vCYDxLtm+2YFFgzEcG1RjK6zguktQyTonQv/AtH5ePzyoCAZIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4703 Return-Path: guomin.jiang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Kinney, Liming, Zhiguang, Can you give comments on this patch Thanks Guomin > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Guomin > Jiang > Sent: Friday, February 18, 2022 10:30 AM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang > Subject: [edk2-devel] [PATCH 2/2] MdePkg/Include: Define new > DEBUG_FILE to specify path. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3840 >=20 > Use DEBUG_FILE to control ASSERT path >=20 > Motivation and Goal: > 1. The path will occupy many size in DEBUG build when file path is long 2= . We > hope can reduce the size but not impact the debug capability 3. If only u= se > filename, we can search the filename to locate file. It > can save many size meanwhile. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Guomin Jiang > --- > MdePkg/Include/Library/DebugLib.h | 39 ++++++++++++++++++++++------- > -- > 1 file changed, 28 insertions(+), 11 deletions(-) >=20 > diff --git a/MdePkg/Include/Library/DebugLib.h > b/MdePkg/Include/Library/DebugLib.h > index 8d3d08638d73..5469c6308422 100644 > --- a/MdePkg/Include/Library/DebugLib.h > +++ b/MdePkg/Include/Library/DebugLib.h > @@ -8,7 +8,7 @@ > of size reduction when compiler optimization is disabled. If > MDEPKG_NDEBUG is > defined, then debug and assert related macros wrapped by it are the NU= LL > implementations. >=20 > -Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -85,6 +85,31 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define > DEBUG_LINE_NUMBER __LINE__ #endif >=20 > +// > +// Source file. > +// Default is use the to compiler provided __FILE__ macro value. The > +__FILE__ // mapping can be overriden by predefining DEBUG_FILE // // > +Defining DEBUG_FILE to a fixed value is useful when comparing builds // > +across machine or configuration with different slash or path // file. > +// > +// Another benefit is we can customize the ASSERT path without > +depending on // compiler ability // // It's for all no matter VS, GCC, > +CLANG // #ifdef DEBUG_FILE #else #define DEBUG_FILE __FILE__ #endif > + > +// Blow override for keep clang behavior #if defined (__clang__) && > +defined (__FILE_NAME__) #undef DEBUG_FILE #define DEBUG_FILE > +__FILE_NAME__ #endif > + > /** > Macro that converts a Boolean expression to a Null-terminated ASCII st= ring. >=20 > @@ -337,17 +362,9 @@ UnitTestDebugAssert ( > IN CONST CHAR8 *Description > ); >=20 > - #if defined (__clang__) && defined (__FILE_NAME__) -#define > _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > - #else > -#define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > - #endif > +#define _ASSERT(Expression) UnitTestDebugAssert (DEBUG_FILE, > +DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > #else > - #if defined (__clang__) && defined (__FILE_NAME__) -#define > _ASSERT(Expression) DebugAssert (__FILE_NAME__, > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > - #else > -#define _ASSERT(Expression) DebugAssert (__FILE__, > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > - #endif > +#define _ASSERT(Expression) DebugAssert (DEBUG_FILE, > +DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) > #endif >=20 > /** > -- > 2.35.1.windows.2 >=20 >=20 >=20 >=20 >=20