Home | History | Annotate | Download | only in Library
      1 /** @file
      2   Provides services to record memory profile of multilevel caller.
      3 
      4   Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
      5   This program and the accompanying materials
      6   are licensed and made available under the terms and conditions of the BSD License
      7   which accompanies this distribution.  The full text of the license may be found at
      8   http://opensource.org/licenses/bsd-license.php.
      9 
     10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 
     13 **/
     14 
     15 #ifndef _MEMORY_PROFILE_LIB_H_
     16 #define _MEMORY_PROFILE_LIB_H_
     17 
     18 #include <Guid/MemoryProfile.h>
     19 
     20 /**
     21   Record memory profile of multilevel caller.
     22 
     23   @param[in] CallerAddress      Address of caller.
     24   @param[in] Action             Memory profile action.
     25   @param[in] MemoryType         Memory type.
     26                                 EfiMaxMemoryType means the MemoryType is unknown.
     27   @param[in] Buffer             Buffer address.
     28   @param[in] Size               Buffer size.
     29   @param[in] ActionString       String for memory profile action.
     30                                 Only needed for user defined allocate action.
     31 
     32   @return EFI_SUCCESS           Memory profile is updated.
     33   @return EFI_UNSUPPORTED       Memory profile is unsupported,
     34                                 or memory profile for the image is not required,
     35                                 or memory profile for the memory type is not required.
     36   @return EFI_ACCESS_DENIED     It is during memory profile data getting.
     37   @return EFI_ABORTED           Memory profile recording is not enabled.
     38   @return EFI_OUT_OF_RESOURCES  No enough resource to update memory profile for allocate action.
     39   @return EFI_NOT_FOUND         No matched allocate info found for free action.
     40 
     41 **/
     42 EFI_STATUS
     43 EFIAPI
     44 MemoryProfileLibRecord (
     45   IN PHYSICAL_ADDRESS           CallerAddress,
     46   IN MEMORY_PROFILE_ACTION      Action,
     47   IN EFI_MEMORY_TYPE            MemoryType,
     48   IN VOID                       *Buffer,
     49   IN UINTN                      Size,
     50   IN CHAR8                      *ActionString OPTIONAL
     51   );
     52 
     53 #endif
     54