From nobody Wed Dec 25 14:37:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506667422787493.6123332669134; Thu, 28 Sep 2017 23:43:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0B1442095E518; Thu, 28 Sep 2017 23:40:26 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AF76021F303FC for ; Thu, 28 Sep 2017 23:40:24 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2017 23:43:39 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.31]) by fmsmga006.fm.intel.com with ESMTP; 28 Sep 2017 23:43:38 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,451,1500966000"; d="scan'208";a="157422900" From: Star Zeng To: edk2-devel@lists.01.org Date: Fri, 29 Sep 2017 14:43:35 +0800 Message-Id: <1506667415-19896-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg PeiCore: More debug messages for pre-memory allocations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The debug messages can help developer to know the pre-memory allocation usage. Cc: Liming Gao Cc: Qing Huang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Liming Gao --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/C= ore/Pei/Dispatcher/Dispatcher.c index 04ece9a627d5..38299c5d98c6 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -675,7 +675,8 @@ PeiCheckAndSwitchStack ( // usage in temporary memory for debugging. // DEBUG_CODE_BEGIN (); - UINT32 *StackPointer; + UINT32 *StackPointer; + EFI_PEI_HOB_POINTERS Hob; =20 for (StackPointer =3D (UINT32*)SecCoreData->StackBase; (StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + SecCo= reData->StackSize)) \ @@ -691,6 +692,17 @@ PeiCheckAndSwitchStack ( DEBUG ((DEBUG_INFO, " temporary memory heap used for HobList: %d by= tes.\n", (UINT32)((UINTN)Private->HobList.HandoffInformationTable->Efi= FreeMemoryBottom - (UINTN)Private->HobList.Raw) )); + DEBUG ((DEBUG_INFO, " temporary memory heap occupied by memory page= s: %d bytes.\n", + (UINT32)(UINTN)(Private->HobList.HandoffInformationTable->Efi= MemoryTop - Private->HobList.HandoffInformationTable->EfiFreeMemoryTop) + )); + for (Hob.Raw =3D Private->HobList.Raw; !END_OF_HOB_LIST(Hob); Hob.Ra= w =3D GET_NEXT_HOB(Hob)) { + if (GET_HOB_TYPE (Hob) =3D=3D EFI_HOB_TYPE_MEMORY_ALLOCATION) { + DEBUG ((DEBUG_INFO, "Memory Allocation 0x%08x 0x%0lx - 0x%0lx\n"= , \ + Hob.MemoryAllocation->AllocDescriptor.MemoryType, = \ + Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, = \ + Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress + Hob.= MemoryAllocation->AllocDescriptor.MemoryLength - 1)); + } + } DEBUG_CODE_END (); =20 if (PcdGet64(PcdLoadModuleAtFixAddressEnable) !=3D 0 && (Private->HobL= ist.HandoffInformationTable->BootMode !=3D BOOT_ON_S3_RESUME)) { --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel