Re: [edk2] [patch 4/4] MdeModulePkg: Remove DxeSmmPerformanceLib

2018-08-03 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Bi, Dandan
>Sent: Monday, July 30, 2018 1:45 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Zeng, Star 
>Subject: [patch 4/4] MdeModulePkg: Remove DxeSmmPerformanceLib
>
>DxeSmmPerformanceLib previously is used by DP tool.
>But in new pweformance infrastructure, we have updated
>Dp tool to get the performance data from firmware
>performance data table in ACPI.
>Now the DxeSmmPerformanceLib is not used by
>any module. So remove it from edk2 code base to
>avoid being used by mistake.
>
>Cc: Liming Gao 
>Cc: Star Zeng 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi 
>---
> .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.c| 866 -
>
> .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf  |  68 --
> .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.uni  |  24 -
> MdeModulePkg/MdeModulePkg.dsc  |   1 -
> 4 files changed, 959 deletions(-)
> delete mode 100644
>MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
> delete mode 100644
>MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.i
>nf
> delete mode 100644
>MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.u
>ni
>
>diff --git
>a/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib
>.c
>b/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib
>.c
>deleted file mode 100644
>index 353174724e..00
>---
>a/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib
>.c
>+++ /dev/null
>@@ -1,866 +0,0 @@
>-/** @file
>-  Performance library instance used in DXE phase to dump both PEI/DXE and
>SMM performance data.
>-
>-  This library instance allows a DXE driver or UEFI application to dump both
>PEI/DXE and SMM performance data.
>-  StartPerformanceMeasurement(), EndPerformanceMeasurement(),
>StartPerformanceMeasurementEx()
>-  and EndPerformanceMeasurementEx() are not implemented.
>-
>-  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
>-This program and the accompanying materials
>-are licensed and made available under the terms and conditions of the BSD
>License
>-which accompanies this distribution.  The full text of the license may be
>found at
>-http://opensource.org/licenses/bsd-license.php
>-
>-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
>-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>EXPRESS OR IMPLIED.
>-
>-**/
>-
>-
>-#include 
>-
>-#include 
>-
>-#include 
>-#include 
>-#include 
>-#include 
>-#include 
>-#include 
>-#include 
>-#include 
>-
>-#include 
>-
>-#include 
>-#include 
>-
>-#define SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE
>(OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data)  + sizeof
>(SMM_PERF_COMMUNICATE))
>-
>-EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication = NULL;
>-UINT8   *mSmmPerformanceBuffer;
>-GAUGE_DATA_ENTRY*mGaugeData = NULL;
>-UINTN   mGaugeNumberOfEntries = 0;
>-GAUGE_DATA_ENTRY_EX *mGaugeDataEx = NULL;
>-UINTN   mGaugeNumberOfEntriesEx = 0;
>-
>-BOOLEAN mNoSmmPerfHandler = FALSE;
>-BOOLEAN mNoSmmPerfExHandler = FALSE;
>-
>-//
>-// The cached Performance Protocol and PerformanceEx Protocol interface.
>-//
>-PERFORMANCE_PROTOCOL*mPerformance = NULL;
>-PERFORMANCE_EX_PROTOCOL *mPerformanceEx = NULL;
>-
>-/**
>-  The function caches the pointer to SMM Communication protocol.
>-
>-  The function locates SMM Communication protocol from protocol database.
>-
>-  @retval EFI_SUCCESS SMM Communication protocol is successfully
>located.
>-  @retval Other   SMM Communication protocol is not located to log
>performance.
>-
>-**/
>-EFI_STATUS
>-GetCommunicationProtocol (
>-  VOID
>-  )
>-{
>-  EFI_STATUS  Status;
>-  EFI_SMM_COMMUNICATION_PROTOCOL  *Communication;
>-
>-  if (mSmmCommunication != NULL) {
>-return EFI_SUCCESS;
>-  }
>-
>-  Status = gBS->LocateProtocol (, NULL,
>(VOID **) );
>-  if (!EFI_ERROR (Status)) {
>-ASSERT (Communication != NULL);
>-//
>-// Cache SMM Communication protocol.
>-//
>-mSmmCommunication = Communication;
>-  }
>-
>-  return Status;
>-}
>-
>-/**
>-  The function caches the pointers to PerformanceEx protocol and
>Performance Protocol.
>-
>-  The function locates PerformanceEx protocol and Performance Protocol
>from protocol database.
>-
>-  @retval EFI_SUCCESS PerformanceEx protocol or Performance Protocol is
>successfully located.
>-  @retval EFI_NOT_FOUND   Both PerformanceEx protocol and Performance
>Protocol are not located to log performance.
>-
>-**/
>-EFI_STATUS
>-GetPerformanceProtocol (
>-  VOID
>-  )
>-{
>-  EFI_STATUSStatus;
>-  PERFORMANCE_PROTOCOL  *Performance;
>-  PERFORMANCE_EX_PROTOCOL   *PerformanceEx;
>-
>-  if (mPerformanceEx != NULL || mPerformance != NULL) {
>-return EFI_SUCCESS;
>-  }
>-
>- 

[edk2] [patch 4/4] MdeModulePkg: Remove DxeSmmPerformanceLib

2018-07-29 Thread Dandan Bi
DxeSmmPerformanceLib previously is used by DP tool.
But in new pweformance infrastructure, we have updated
Dp tool to get the performance data from firmware
performance data table in ACPI.
Now the DxeSmmPerformanceLib is not used by
any module. So remove it from edk2 code base to
avoid being used by mistake.

Cc: Liming Gao 
Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.c| 866 -
 .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf  |  68 --
 .../DxeSmmPerformanceLib/DxeSmmPerformanceLib.uni  |  24 -
 MdeModulePkg/MdeModulePkg.dsc  |   1 -
 4 files changed, 959 deletions(-)
 delete mode 100644 
MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
 delete mode 100644 
MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf
 delete mode 100644 
MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.uni

diff --git a/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c 
b/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
deleted file mode 100644
index 353174724e..00
--- a/MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.c
+++ /dev/null
@@ -1,866 +0,0 @@
-/** @file
-  Performance library instance used in DXE phase to dump both PEI/DXE and SMM 
performance data.
-
-  This library instance allows a DXE driver or UEFI application to dump both 
PEI/DXE and SMM performance data.
-  StartPerformanceMeasurement(), EndPerformanceMeasurement(), 
StartPerformanceMeasurementEx()
-  and EndPerformanceMeasurementEx() are not implemented.
-
-  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD 
License
-which accompanies this distribution.  The full text of the license may be 
found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-
-#define SMM_PERFORMANCE_COMMUNICATION_BUFFER_SIZE (OFFSET_OF 
(EFI_SMM_COMMUNICATE_HEADER, Data)  + sizeof (SMM_PERF_COMMUNICATE))
-
-EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication = NULL;
-UINT8   *mSmmPerformanceBuffer;
-GAUGE_DATA_ENTRY*mGaugeData = NULL;
-UINTN   mGaugeNumberOfEntries = 0;
-GAUGE_DATA_ENTRY_EX *mGaugeDataEx = NULL;
-UINTN   mGaugeNumberOfEntriesEx = 0;
-
-BOOLEAN mNoSmmPerfHandler = FALSE;
-BOOLEAN mNoSmmPerfExHandler = FALSE;
-
-//
-// The cached Performance Protocol and PerformanceEx Protocol interface.
-//
-PERFORMANCE_PROTOCOL*mPerformance = NULL;
-PERFORMANCE_EX_PROTOCOL *mPerformanceEx = NULL;
-
-/**
-  The function caches the pointer to SMM Communication protocol.
-
-  The function locates SMM Communication protocol from protocol database.
-
-  @retval EFI_SUCCESS SMM Communication protocol is successfully located.
-  @retval Other   SMM Communication protocol is not located to log 
performance.
-
-**/
-EFI_STATUS
-GetCommunicationProtocol (
-  VOID
-  )
-{
-  EFI_STATUS  Status;
-  EFI_SMM_COMMUNICATION_PROTOCOL  *Communication;
-
-  if (mSmmCommunication != NULL) {
-return EFI_SUCCESS;
-  }
-
-  Status = gBS->LocateProtocol (, NULL, (VOID 
**) );
-  if (!EFI_ERROR (Status)) {
-ASSERT (Communication != NULL);
-//
-// Cache SMM Communication protocol.
-//
-mSmmCommunication = Communication;
-  }
-
-  return Status;
-}
-
-/**
-  The function caches the pointers to PerformanceEx protocol and Performance 
Protocol.
-
-  The function locates PerformanceEx protocol and Performance Protocol from 
protocol database.
-
-  @retval EFI_SUCCESS PerformanceEx protocol or Performance Protocol is 
successfully located.
-  @retval EFI_NOT_FOUND   Both PerformanceEx protocol and Performance Protocol 
are not located to log performance.
-
-**/
-EFI_STATUS
-GetPerformanceProtocol (
-  VOID
-  )
-{
-  EFI_STATUSStatus;
-  PERFORMANCE_PROTOCOL  *Performance;
-  PERFORMANCE_EX_PROTOCOL   *PerformanceEx;
-
-  if (mPerformanceEx != NULL || mPerformance != NULL) {
-return EFI_SUCCESS;
-  }
-
-  Status = gBS->LocateProtocol (, NULL, (VOID **) 
);
-  if (!EFI_ERROR (Status)) {
-ASSERT (PerformanceEx != NULL);
-//
-// Cache PerformanceEx Protocol.
-//
-mPerformanceEx = PerformanceEx;
-return EFI_SUCCESS;
-  }
-
-  Status = gBS->LocateProtocol (, NULL, (VOID **) 
);
-  if (!EFI_ERROR (Status)) {
-ASSERT (Performance != NULL);
-//
-// Cache