Revision: 17561
http://sourceforge.net/p/edk2/code/17561
Author: lzeng14
Date: 2015-06-04 13:16:18 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
MdeModulePkg DxeSmmPerformanceLib: Cover no SMM performance data case.
1. Continue to get performance data by Performance Protocol
when no SMM performance data found.
2. Not try to get SMM performance data again
if no SMM performance handler found.
3. Correct typo 'totol' and 'guage'.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
Modified:
trunk/edk2/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
2015-06-04 07:10:17 UTC (rev 17560)
+++ trunk/edk2/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
2015-06-04 13:16:18 UTC (rev 17561)
@@ -41,6 +41,9 @@
GAUGE_DATA_ENTRY_EX *mGaugeDataEx = NULL;
UINTN mGaugeNumberOfEntriesEx = 0;
+BOOLEAN mNoSmmPerfHandler = FALSE;
+BOOLEAN mNoSmmPerfExHandler = FALSE;
+
//
// The cached Performance Protocol and PerformanceEx Protocol interface.
//
@@ -372,7 +375,7 @@
On exit, the key of the next performance log
entry.
@retval !NULL Get all gauge data success.
- @retval NULL Get all guage data failed.
+ @retval NULL Get all gauge data failed.
**/
GAUGE_DATA_ENTRY *
EFIAPI
@@ -386,13 +389,21 @@
UINTN CommSize;
UINTN DataSize;
+ if (mNoSmmPerfHandler) {
+ //
+ // Not try to get the SMM gauge data again
+ // if no SMM Performance handler found.
+ //
+ return NULL;
+ }
+
if (LogEntryKey != 0) {
if (mGaugeData != NULL) {
return mGaugeData;
}
} else {
//
- // Reget the SMM guage data at the first entry get.
+ // Reget the SMM gauge data at the first entry get.
//
if (mGaugeData != NULL) {
FreePool (mGaugeData);
@@ -418,10 +429,13 @@
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;
//
- // Get totol number of SMM gauge entries
+ // Get total number of SMM gauge entries
//
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;
Status = mSmmCommunication->Communicate (mSmmCommunication,
mSmmPerformanceBuffer, &CommSize);
+ if (Status == EFI_NOT_FOUND) {
+ mNoSmmPerfHandler = TRUE;
+ }
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) ||
SmmPerfCommData->NumberOfEntries == 0) {
return NULL;
}
@@ -459,7 +473,7 @@
On exit, the key of the next performance log
entry.
@retval !NULL Get all gauge data success.
- @retval NULL Get all guage data failed.
+ @retval NULL Get all gauge data failed.
**/
GAUGE_DATA_ENTRY_EX *
EFIAPI
@@ -473,13 +487,21 @@
UINTN CommSize;
UINTN DataSize;
+ if (mNoSmmPerfExHandler) {
+ //
+ // Not try to get the SMM gauge data again
+ // if no SMM PerformanceEx handler found.
+ //
+ return NULL;
+ }
+
if (LogEntryKey != 0) {
if (mGaugeDataEx != NULL) {
return mGaugeDataEx;
}
} else {
//
- // Reget the SMM guage data at the first entry get.
+ // Reget the SMM gauge data at the first entry get.
//
if (mGaugeDataEx != NULL) {
FreePool (mGaugeDataEx);
@@ -505,10 +527,13 @@
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;
//
- // Get totol number of SMM gauge entries
+ // Get total number of SMM gauge entries
//
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;
Status = mSmmCommunication->Communicate (mSmmCommunication,
mSmmPerformanceBuffer, &CommSize);
+ if (Status == EFI_NOT_FOUND) {
+ mNoSmmPerfExHandler = TRUE;
+ }
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) ||
SmmPerfCommData->NumberOfEntries == 0) {
return NULL;
}
@@ -658,7 +683,15 @@
GaugeData = (GAUGE_DATA_ENTRY_EX *) &mGaugeData[LogEntryKey++];
*Identifier = 0;
} else {
- return 0;
+ return GetByPerformanceProtocol (
+ LogEntryKey,
+ Handle,
+ Token,
+ Module,
+ StartTimeStamp,
+ EndTimeStamp,
+ Identifier
+ );
}
}
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits