Skip to content

Commit

Permalink
MdeModulePkg: Add Standalone MM perf library support
Browse files Browse the repository at this point in the history
Adds a new library instance to support logging performance data in
Standalone MM.

- Add StandaloneMmPerformanceLib instance
- Move common MM logic to a new file `SmmPerformanceLibInternal.c`
- Since the library largely defers most logic to the performance
  measurement protocol a large degree of code can be shared between
  Standalone MM and Traditional MM.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki committed Feb 3, 2025
1 parent 48b1d46 commit e893f44
Show file tree
Hide file tree
Showing 8 changed files with 689 additions and 460 deletions.
474 changes: 16 additions & 458 deletions MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.c

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
# to log performance data. If both SMM PerformanceEx and Performance Protocol are not available,
# it does not log any performance information.
#
# This library instance currently supports Standalone MM and Traditional MM. Care should be taken
# when making modifications to ensure they are compatible with both Standalone MM and Traditional MM.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand All @@ -18,7 +22,7 @@
FILE_GUID = 1EDD13E6-D0CD-4432-A692-FF65C9B4F039
MODULE_TYPE = DXE_SMM_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = PerformanceLib|DXE_SMM_DRIVER
LIBRARY_CLASS = PerformanceLib|DXE_SMM_DRIVER MM_STANDALONE # MU_CHANGE - Standalone MM Perf Support

CONSTRUCTOR = SmmPerformanceLibConstructor
DESTRUCTOR = SmmPerformanceLibDestructor
Expand All @@ -30,6 +34,8 @@
#

[Sources]
SmmPerformanceLibInternal.h # MU_CHANGE - Standalone MM Perf Support
SmmPerformanceLibInternal.c # MU_CHANGE - Standalone MM Perf Support
SmmPerformanceLib.c


Expand All @@ -40,7 +46,7 @@

[LibraryClasses]
PcdLib
SmmServicesTableLib
MmServicesTableLib # MU_CHANGE - Standalone MM Perf Support
DebugLib
BaseMemoryLib

Expand Down
Loading

0 comments on commit e893f44

Please sign in to comment.