2 If the Variable services have PcdVariableCollectStatistics set to TRUE then
3 the EFI system table will contain statistical information about variable usage
4 an this utility will print out the information. You can use console redirection
7 Copyright (c) 2006 - 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <Library/UefiLib.h>
20 #include <Library/UefiApplicationEntryPoint.h>
21 #include <Guid/VariableInfo.h>
25 The user Entry Point for Application. The user code starts with this function
26 as the real entry point for the image goes into a library that calls this
30 @param[in] ImageHandle The firmware allocated handle for the EFI image.
31 @param[in] SystemTable A pointer to the EFI System Table.
33 @retval EFI_SUCCESS The entry point is executed successfully.
34 @retval other Some error occurs when executing this entry point.
40 IN EFI_HANDLE ImageHandle
,
41 IN EFI_SYSTEM_TABLE
*SystemTable
45 VARIABLE_INFO_ENTRY
*VariableInfo
;
46 VARIABLE_INFO_ENTRY
*Entry
;
48 Status
= EfiGetSystemConfigurationTable (&gEfiVariableInfoGuid
, (VOID
**)&Entry
);
49 if (!EFI_ERROR (Status
) && (Entry
!= NULL
)) {
50 Print (L
"Non-Volatile EFI Variables:\n");
53 if (!VariableInfo
->Volatile
) {
55 L
"%g R%03d(%03d) W%03d D%03d:%s\n",
56 &VariableInfo
->VendorGuid
,
57 VariableInfo
->ReadCount
,
58 VariableInfo
->CacheCount
,
59 VariableInfo
->WriteCount
,
60 VariableInfo
->DeleteCount
,
65 VariableInfo
= VariableInfo
->Next
;
66 } while (VariableInfo
!= NULL
);
68 Print (L
"Volatile EFI Variables:\n");
71 if (VariableInfo
->Volatile
) {
73 L
"%g R%03d(%03d) W%03d D%03d:%s\n",
74 &VariableInfo
->VendorGuid
,
75 VariableInfo
->ReadCount
,
76 VariableInfo
->CacheCount
,
77 VariableInfo
->WriteCount
,
78 VariableInfo
->DeleteCount
,
82 VariableInfo
= VariableInfo
->Next
;
83 } while (VariableInfo
!= NULL
);