* performance protocol interfaces.\r
* performance variables. \r
\r
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available under \r
the terms and conditions of the BSD License that accompanies this distribution. \r
The full text of the license may be found at\r
#ifndef __PERFORMANCE_DATA_H__\r
#define __PERFORMANCE_DATA_H__\r
\r
+#define PERFORMANCE_PROPERTY_REVISION 0x1\r
+\r
+typedef struct {\r
+ UINT32 Revision;\r
+ UINT32 Reserved;\r
+ UINT64 Frequency;\r
+ UINT64 TimerStartValue;\r
+ UINT64 TimerEndValue;\r
+} PERFORMANCE_PROPERTY;\r
+\r
//\r
// PEI_PERFORMANCE_STRING_SIZE must be a multiple of 8.\r
//\r
This library is mainly used by DxeCore to start performance logging to ensure that\r
Performance Protocol is installed at the very beginning of DXE phase.\r
\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
GetGaugeEx\r
};\r
\r
+PERFORMANCE_PROPERTY mPerformanceProperty;\r
+\r
/**\r
Searches in the gauge array with keyword Handle, Token, Module and Identifier.\r
\r
)\r
{\r
EFI_STATUS Status;\r
+ PERFORMANCE_PROPERTY *PerformanceProperty;\r
+\r
\r
if (!PerformanceMeasurementEnabled ()) {\r
//\r
\r
InternalGetPeiPerformance ();\r
\r
- return Status;\r
+ Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, &PerformanceProperty);\r
+ if (EFI_ERROR (Status)) {\r
+ //\r
+ // Install configuration table for performance property.\r
+ //\r
+ mPerformanceProperty.Revision = PERFORMANCE_PROPERTY_REVISION;\r
+ mPerformanceProperty.Reserved = 0;\r
+ mPerformanceProperty.Frequency = GetPerformanceCounterProperties (\r
+ &mPerformanceProperty.TimerStartValue,\r
+ &mPerformanceProperty.TimerEndValue\r
+ );\r
+ Status = gBS->InstallConfigurationTable (&gPerformanceProtocolGuid, &mPerformanceProperty);\r
+ ASSERT_EFI_ERROR (Status);\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
}\r
\r
/**\r
BaseLib\r
HobLib\r
DebugLib\r
+ UefiLib\r
\r
\r
[Guids]\r
## SOMETIMES_CONSUMES ## HOB\r
## PRODUCES ## UNDEFINED # Install protocol\r
+ ## PRODUCES ## SystemTable\r
gPerformanceProtocolGuid\r
## SOMETIMES_CONSUMES ## HOB\r
## PRODUCES ## UNDEFINED # Install protocol\r
This header file holds the prototypes of the Performance and PerformanceEx Protocol published by this\r
library instance at its constructor.\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, 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
#include <Library/PcdLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiLib.h>\r
\r
//\r
// Interface declarations for PerformanceEx Protocol.\r
GetGaugeEx\r
};\r
\r
+PERFORMANCE_PROPERTY mPerformanceProperty;\r
+\r
/**\r
Searches in the gauge array with keyword Handle, Token, Module and Identfier.\r
\r
{\r
EFI_STATUS Status;\r
EFI_HANDLE Handle;\r
+ PERFORMANCE_PROPERTY *PerformanceProperty;\r
\r
//\r
// Initialize spin lock\r
ASSERT_EFI_ERROR (Status);\r
Status = gSmst->SmiHandlerRegister (SmmPerformanceHandlerEx, &gSmmPerformanceExProtocolGuid, &Handle);\r
ASSERT_EFI_ERROR (Status);\r
+\r
+ Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, &PerformanceProperty);\r
+ if (EFI_ERROR (Status)) {\r
+ //\r
+ // Install configuration table for performance property.\r
+ //\r
+ mPerformanceProperty.Revision = PERFORMANCE_PROPERTY_REVISION;\r
+ mPerformanceProperty.Reserved = 0;\r
+ mPerformanceProperty.Frequency = GetPerformanceCounterProperties (\r
+ &mPerformanceProperty.TimerStartValue,\r
+ &mPerformanceProperty.TimerEndValue\r
+ );\r
+ Status = gBS->InstallConfigurationTable (&gPerformanceProtocolGuid, &mPerformanceProperty);\r
+ ASSERT_EFI_ERROR (Status);\r
+ }\r
}\r
\r
/**\r
# This library is mainly used by SMM Core to start performance logging to ensure that\r
# SMM Performance and PerformanceEx Protocol are installed at the very beginning of SMM phase.\r
# \r
-# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2017, 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
SynchronizationLib\r
SmmServicesTableLib\r
SmmMemLib\r
+ UefiLib\r
\r
[Protocols]\r
gEfiSmmBase2ProtocolGuid ## CONSUMES\r
## PRODUCES ## UNDEFINED # Install protocol\r
## CONSUMES ## UNDEFINED # SmiHandlerRegister\r
gSmmPerformanceExProtocolGuid\r
+ ## PRODUCES ## SystemTable\r
+ gPerformanceProtocolGuid\r
\r
[Pcd]\r
gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask ## CONSUMES\r