StartPerformanceMeasurement(), EndPerformanceMeasurement(), StartPerformanceMeasurementEx()\r
and EndPerformanceMeasurementEx() are not implemented.\r
\r
- Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\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
Fills in the end time of a performance measurement.\r
\r
- Looks up the record that matches Handle, Token, Module and Identifier.\r
+ Looks up the record that matches Handle, Token and Module.\r
If the record can not be found then return RETURN_NOT_FOUND.\r
If the record is found and TimeStamp is not zero,\r
then TimeStamp is added to the record as the end time.\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
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
- // 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
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
+ 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
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
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
- // 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
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
+ 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
GaugeData = (GAUGE_DATA_ENTRY_EX *) &mGaugeData[LogEntryKey++];\r
*Identifier = 0;\r
} else {\r
- return 0;\r
+ return GetByPerformanceProtocol (\r
+ LogEntryKey,\r
+ Handle,\r
+ Token,\r
+ Module,\r
+ StartTimeStamp,\r
+ EndTimeStamp,\r
+ Identifier\r
+ );\r
}\r
}\r
\r