]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Introduce new library class MemoryProfileLib
authorStar Zeng <star.zeng@intel.com>
Sat, 18 Jun 2016 01:04:31 +0000 (09:04 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 1 Jul 2016 01:39:57 +0000 (09:39 +0800)
Provides services to record memory profile of multilevel caller.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Include/Library/MemoryProfileLib.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Library/MemoryProfileLib.h b/MdeModulePkg/Include/Library/MemoryProfileLib.h
new file mode 100644 (file)
index 0000000..8543801
--- /dev/null
@@ -0,0 +1,53 @@
+/** @file\r
+  Provides services to record memory profile of multilevel caller.\r
+\r
+  Copyright (c) 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
+  http://opensource.org/licenses/bsd-license.php.                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+**/\r
+\r
+#ifndef _MEMORY_PROFILE_LIB_H_\r
+#define _MEMORY_PROFILE_LIB_H_\r
+\r
+#include <Guid/MemoryProfile.h>\r
+\r
+/**\r
+  Record memory profile of multilevel caller.\r
+\r
+  @param[in] CallerAddress      Address of caller.\r
+  @param[in] Action             Memory profile action.\r
+  @param[in] MemoryType         Memory type.\r
+                                EfiMaxMemoryType means the MemoryType is unknown.\r
+  @param[in] Buffer             Buffer address.\r
+  @param[in] Size               Buffer size.\r
+  @param[in] ActionString       String for memory profile action.\r
+                                Only needed for user defined allocate action.\r
+\r
+  @return EFI_SUCCESS           Memory profile is updated.\r
+  @return EFI_UNSUPPORTED       Memory profile is unsupported,\r
+                                or memory profile for the image is not required,\r
+                                or memory profile for the memory type is not required.\r
+  @return EFI_ACCESS_DENIED     It is during memory profile data getting.\r
+  @return EFI_ABORTED           Memory profile recording is not enabled.\r
+  @return EFI_OUT_OF_RESOURCES  No enough resource to update memory profile for allocate action.\r
+  @return EFI_NOT_FOUND         No matched allocate info found for free action.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+MemoryProfileLibRecord (\r
+  IN PHYSICAL_ADDRESS           CallerAddress,\r
+  IN MEMORY_PROFILE_ACTION      Action,\r
+  IN EFI_MEMORY_TYPE            MemoryType,\r
+  IN VOID                       *Buffer,\r
+  IN UINTN                      Size,\r
+  IN CHAR8                      *ActionString OPTIONAL\r
+  );\r
+\r
+#endif\r
index 9014635736061fd5e1198cf8feeea6a7ab7db1c5..8d90f169b26eeb186286a032b86150a4da1f89a6 100644 (file)
   #\r
   PciHostBridgeLib|Include/Library/PciHostBridgeLib.h\r
 \r
+  ## @libraryclass  Provides services to record memory profile of multilevel caller.\r
+  #\r
+  MemoryProfileLib|Include/Library/MemoryProfileLib.h\r
+\r
 [Guids]\r
   ## MdeModule package token space guid\r
   # Include/Guid/MdeModulePkgTokenSpace.h\r