From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: [PATCH v2 7/8] MdeModulePkg/FirmwarePerfSmm:Enhance for new pref infrastructure
Date: Tue, 30 Jan 2018 21:53:56 +0800 [thread overview]
Message-ID: <1517320437-11688-8-git-send-email-dandan.bi@intel.com> (raw)
In-Reply-To: <1517320437-11688-1-git-send-email-dandan.bi@intel.com>
V2:
Update FirmwarePerformanceSmm to receive the address
of performance records instead of records content.
Receive buffer address of Boot performance records
which are reported by SmmCorePerformanceLib.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
.../FirmwarePerformanceSmm.c | 29 +++++-----------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c
index c750331..28fb3d0 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.c
@@ -82,11 +82,11 @@ FpdtStatusCodeListenerSmm (
)
{
EFI_STATUS Status;
UINT64 CurrentTime;
EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD S3SuspendRecord;
- UINT8 *NewRecordBuffer;
+ SMM_BOOT_PERFORMANCE_TABLE *mSmmBootPerformanceTable;
//
// Check whether status code is what we are interested in.
//
if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) != EFI_PROGRESS_CODE) {
@@ -96,34 +96,17 @@ FpdtStatusCodeListenerSmm (
//
// Collect one or more Boot records in boot time
//
if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {
AcquireSpinLock (&mSmmFpdtLock);
-
- if (mBootRecordSize + Data->Size > mBootRecordMaxSize) {
- //
- // Try to allocate big SMRAM data to store Boot record.
- //
- if (mSmramIsOutOfResource) {
- ReleaseSpinLock (&mSmmFpdtLock);
- return EFI_OUT_OF_RESOURCES;
- }
- NewRecordBuffer = ReallocatePool (mBootRecordSize, mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE, mBootRecordBuffer);
- if (NewRecordBuffer == NULL) {
- ReleaseSpinLock (&mSmmFpdtLock);
- mSmramIsOutOfResource = TRUE;
- return EFI_OUT_OF_RESOURCES;
- }
- mBootRecordBuffer = NewRecordBuffer;
- mBootRecordMaxSize = mBootRecordSize + Data->Size + EXTENSION_RECORD_SIZE;
- }
//
- // Save boot record into the temp memory space.
+ // Get the boot performance data.
//
- CopyMem (mBootRecordBuffer + mBootRecordSize, Data + 1, Data->Size);
- mBootRecordSize += Data->Size;
-
+ CopyMem (&mSmmBootPerformanceTable, Data + 1, Data->Size);
+ mBootRecordBuffer = ((UINT8 *) (mSmmBootPerformanceTable)) + sizeof (SMM_BOOT_PERFORMANCE_TABLE);
+ mBootRecordSize = mSmmBootPerformanceTable->Header.Length - sizeof (SMM_BOOT_PERFORMANCE_TABLE) ;
+
ReleaseSpinLock (&mSmmFpdtLock);
return EFI_SUCCESS;
}
if ((Value != PcdGet32 (PcdProgressCodeS3SuspendStart)) &&
--
1.9.5.msysgit.1
next prev parent reply other threads:[~2018-01-30 13:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 13:53 [PATCH v2 0/8] Update EDKII Performance infrastructure based on ACPI FPDT table Dandan Bi
2018-01-30 13:53 ` [PATCH v2 1/8] MdeModulePkg:Add definitions for new Performance infrastructure Dandan Bi
2018-01-31 2:07 ` Zeng, Star
2018-01-30 13:53 ` [PATCH v2 2/8] MdeModulePkg/PeiPerformance:Updated to track FPDT record in PEI phase Dandan Bi
2018-01-30 13:53 ` [PATCH v2 3/8] MdeModulePkg/DxeCorePerformanceLib:Track FPDT record in DXE phase Dandan Bi
2018-05-01 16:26 ` Ard Biesheuvel
2018-05-22 0:33 ` Bi, Dandan
2018-05-22 8:51 ` Ard Biesheuvel
2018-05-22 8:58 ` Zeng, Star
2018-05-22 9:02 ` Ard Biesheuvel
2018-05-22 9:38 ` Zeng, Star
2018-05-22 10:00 ` Laszlo Ersek
2018-05-22 10:38 ` Zeng, Star
2018-05-22 10:43 ` Ard Biesheuvel
2018-05-22 10:00 ` Ard Biesheuvel
2018-01-30 13:53 ` [PATCH v2 4/8] MdeModulePkg/SmmCorePerformanceLib:Track FPDT record in SMM phase Dandan Bi
2018-01-30 13:53 ` [PATCH v2 5/8] MdeModulePkg/FirmwarePerformancePei:Add FPDT records for S3 phase Dandan Bi
2018-01-30 13:53 ` [PATCH v2 6/8] MdeModulePkg/FirmwarePerfDxe:Enhance for new pref infrastructure Dandan Bi
2018-01-30 13:53 ` Dandan Bi [this message]
2018-01-30 13:53 ` [PATCH v2 8/8] ShellPkg/Dp: Updated to dump perf log based on FPDT table Dandan Bi
2020-04-28 7:45 ` [edk2-devel] [PATCH v2 0/8] Update EDKII Performance infrastructure based on ACPI " boonewang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1517320437-11688-8-git-send-email-dandan.bi@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox