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 <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17561
6f19259b-4bc3-4df7-8a09-
765794883524
GAUGE_DATA_ENTRY_EX *mGaugeDataEx = NULL;\r
UINTN mGaugeNumberOfEntriesEx = 0;\r
\r
GAUGE_DATA_ENTRY_EX *mGaugeDataEx = NULL;\r
UINTN mGaugeNumberOfEntriesEx = 0;\r
\r
+BOOLEAN mNoSmmPerfHandler = FALSE;\r
+BOOLEAN mNoSmmPerfExHandler = FALSE;\r
+\r
//\r
// The cached Performance Protocol and PerformanceEx Protocol interface.\r
//\r
//\r
// The cached Performance Protocol and PerformanceEx Protocol interface.\r
//\r
On exit, the key of the next performance log entry.\r
\r
@retval !NULL Get all gauge data success.\r
On exit, the key of the next performance log entry.\r
\r
@retval !NULL Get all gauge data success.\r
- @retval NULL Get all guage data failed.\r
+ @retval NULL Get all gauge data failed.\r
**/\r
GAUGE_DATA_ENTRY *\r
EFIAPI\r
**/\r
GAUGE_DATA_ENTRY *\r
EFIAPI\r
UINTN CommSize;\r
UINTN DataSize;\r
\r
UINTN CommSize;\r
UINTN DataSize;\r
\r
+ if (mNoSmmPerfHandler) {\r
+ //\r
+ // Not try to get the SMM gauge data again\r
+ // if no SMM Performance handler found.\r
+ //\r
+ return NULL;\r
+ }\r
+\r
if (LogEntryKey != 0) {\r
if (mGaugeData != NULL) {\r
return mGaugeData;\r
}\r
} else {\r
//\r
if (LogEntryKey != 0) {\r
if (mGaugeData != NULL) {\r
return mGaugeData;\r
}\r
} else {\r
//\r
- // Reget the SMM guage data at the first entry get.\r
+ // Reget the SMM gauge data at the first entry get.\r
//\r
if (mGaugeData != NULL) {\r
FreePool (mGaugeData);\r
//\r
if (mGaugeData != NULL) {\r
FreePool (mGaugeData);\r
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;\r
\r
//\r
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;\r
\r
//\r
- // Get totol number of SMM gauge entries\r
+ // Get total number of SMM gauge entries\r
//\r
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;\r
Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);\r
//\r
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;\r
Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);\r
+ if (Status == EFI_NOT_FOUND) {\r
+ mNoSmmPerfHandler = TRUE;\r
+ }\r
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) || SmmPerfCommData->NumberOfEntries == 0) {\r
return NULL;\r
}\r
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) || SmmPerfCommData->NumberOfEntries == 0) {\r
return NULL;\r
}\r
On exit, the key of the next performance log entry.\r
\r
@retval !NULL Get all gauge data success.\r
On exit, the key of the next performance log entry.\r
\r
@retval !NULL Get all gauge data success.\r
- @retval NULL Get all guage data failed.\r
+ @retval NULL Get all gauge data failed.\r
**/\r
GAUGE_DATA_ENTRY_EX *\r
EFIAPI\r
**/\r
GAUGE_DATA_ENTRY_EX *\r
EFIAPI\r
UINTN CommSize;\r
UINTN DataSize;\r
\r
UINTN CommSize;\r
UINTN DataSize;\r
\r
+ if (mNoSmmPerfExHandler) {\r
+ //\r
+ // Not try to get the SMM gauge data again\r
+ // if no SMM PerformanceEx handler found.\r
+ //\r
+ return NULL;\r
+ }\r
+\r
if (LogEntryKey != 0) {\r
if (mGaugeDataEx != NULL) {\r
return mGaugeDataEx;\r
}\r
} else {\r
//\r
if (LogEntryKey != 0) {\r
if (mGaugeDataEx != NULL) {\r
return mGaugeDataEx;\r
}\r
} else {\r
//\r
- // Reget the SMM guage data at the first entry get.\r
+ // Reget the SMM gauge data at the first entry get.\r
//\r
if (mGaugeDataEx != NULL) {\r
FreePool (mGaugeDataEx);\r
//\r
if (mGaugeDataEx != NULL) {\r
FreePool (mGaugeDataEx);\r
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;\r
\r
//\r
CommSize = SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE;\r
\r
//\r
- // Get totol number of SMM gauge entries\r
+ // Get total number of SMM gauge entries\r
//\r
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;\r
Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);\r
//\r
SmmPerfCommData->Function = SMM_PERF_FUNCTION_GET_GAUGE_ENTRY_NUMBER;\r
Status = mSmmCommunication->Communicate (mSmmCommunication, mSmmPerformanceBuffer, &CommSize);\r
+ if (Status == EFI_NOT_FOUND) {\r
+ mNoSmmPerfExHandler = TRUE;\r
+ }\r
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) || SmmPerfCommData->NumberOfEntries == 0) {\r
return NULL;\r
}\r
if (EFI_ERROR (Status) || EFI_ERROR (SmmPerfCommData->ReturnStatus) || SmmPerfCommData->NumberOfEntries == 0) {\r
return NULL;\r
}\r
GaugeData = (GAUGE_DATA_ENTRY_EX *) &mGaugeData[LogEntryKey++];\r
*Identifier = 0;\r
} else {\r
GaugeData = (GAUGE_DATA_ENTRY_EX *) &mGaugeData[LogEntryKey++];\r
*Identifier = 0;\r
} else {\r
+ return GetByPerformanceProtocol (\r
+ LogEntryKey,\r
+ Handle,\r
+ Token,\r
+ Module,\r
+ StartTimeStamp,\r
+ EndTimeStamp,\r
+ Identifier\r
+ );\r