SecurityPkg/Tcg: Add use case for new Perf macro
authorDandan Bi <dandan.bi@intel.com>
Tue, 17 Jul 2018 05:09:02 +0000 (13:09 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 26 Jul 2018 05:37:59 +0000 (13:37 +0800)
Add an example case for the usage of
PERF_CALLBACK_BEGIN/PERF_CALLBACK_END

Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao Zhang<chao.b.zhang@intel.com>
SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
SecurityPkg/Tcg/TcgPei/TcgPei.c
SecurityPkg/Tcg/TcgPei/TcgPei.inf

index 74cdd1f..09ef0c7 100644 (file)
@@ -161,6 +161,8 @@ EndofPeiSignalNotifyCallBack (
 \r
   MeasuredHobData = NULL;\r
 \r
+  PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid);\r
+\r
   //\r
   // Create a Guid hob to save all measured Fv\r
   //\r
@@ -186,6 +188,8 @@ EndofPeiSignalNotifyCallBack (
     CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex));\r
   }\r
 \r
+  PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 1ed11a1..d070475 100644 (file)
@@ -41,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/Tpm12DeviceLib.h>\r
 #include <Library/Tpm12CommandLib.h>\r
 #include <Library/BaseCryptLib.h>\r
+#include <Library/PerformanceLib.h>\r
 \r
 BOOLEAN                 mImageInMemory  = FALSE;\r
 \r
@@ -170,6 +171,8 @@ EndofPeiSignalNotifyCallBack (
 \r
   MeasuredHobData = NULL;\r
 \r
+  PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid);\r
+\r
   //\r
   // Create a Guid hob to save all measured Fv\r
   //\r
@@ -195,6 +198,8 @@ EndofPeiSignalNotifyCallBack (
     CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex));\r
   }\r
 \r
+  PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 0252511..4c8a055 100644 (file)
@@ -56,6 +56,7 @@
   MemoryAllocationLib\r
   ReportStatusCodeLib\r
   Tpm12CommandLib\r
+  PerformanceLib\r
 \r
 [Guids]\r
   gTcgEventEntryHobGuid                                               ## PRODUCES               ## HOB\r