Commit | Line | Data |
---|---|---|
33a5a666 A |
1 | /** @file\r |
2 | If the Variable services have PcdVariableCollectStatistics set to TRUE then \r | |
3 | the EFI system table will contain statistical information about variable usage\r | |
4 | an this utility will print out the information. You can use console redirection\r | |
5 | to capture the data.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2007, Intel Corporation \r | |
8 | All rights reserved. This program and the accompanying materials \r | |
9 | are licensed and made available under the terms and conditions of the BSD License \r | |
10 | which accompanies this distribution. The full text of the license may be found at \r | |
11 | http://opensource.org/licenses/bsd-license.php \r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
33a5a666 A |
19 | #include <Library/UefiLib.h>\r |
20 | #include <Library/UefiApplicationEntryPoint.h>\r | |
33a5a666 A |
21 | #include <Guid/VariableInfo.h>\r |
22 | \r | |
23 | \r | |
24 | /**\r | |
25 | The user Entry Point for Application. The user code starts with this function\r | |
26 | as the real entry point for the image goes into a library that calls this \r | |
27 | function.\r | |
28 | \r | |
29 | \r | |
30 | @param[in] ImageHandle The firmware allocated handle for the EFI image. \r | |
31 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
32 | \r | |
33 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
34 | @retval other Some error occurs when executing this entry point.\r | |
35 | \r | |
36 | **/\r | |
37 | EFI_STATUS\r | |
38 | EFIAPI\r | |
39 | UefiMain (\r | |
40 | IN EFI_HANDLE ImageHandle,\r | |
41 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
42 | )\r | |
43 | {\r | |
44 | EFI_STATUS Status;\r | |
45 | VARIABLE_INFO_ENTRY *VariableInfo;\r | |
46 | VARIABLE_INFO_ENTRY *Entry;\r | |
47 | \r | |
48 | Status = EfiGetSystemConfigurationTable (&gEfiVariableInfoGuid, (VOID **)&Entry);\r | |
49 | if (!EFI_ERROR (Status) && (Entry != NULL)) {\r | |
50 | Print (L"Non-Volatile EFI Variables:\n");\r | |
51 | VariableInfo = Entry;\r | |
52 | do {\r | |
53 | if (!VariableInfo->Volatile) {\r | |
54 | Print (\r | |
55 | L"%g R%03d(%03d) W%03d D%03d:%s\n", \r | |
56 | &VariableInfo->VendorGuid, \r | |
57 | VariableInfo->ReadCount,\r | |
58 | VariableInfo->CacheCount,\r | |
59 | VariableInfo->WriteCount,\r | |
60 | VariableInfo->DeleteCount,\r | |
61 | VariableInfo->Name\r | |
62 | );\r | |
63 | }\r | |
64 | \r | |
65 | VariableInfo = VariableInfo->Next;\r | |
66 | } while (VariableInfo != NULL);\r | |
67 | \r | |
68 | Print (L"Volatile EFI Variables:\n");\r | |
69 | VariableInfo = Entry;\r | |
70 | do {\r | |
71 | if (VariableInfo->Volatile) {\r | |
72 | Print (\r | |
73 | L"%g R%03d(%03d) W%03d D%03d:%s\n", \r | |
74 | &VariableInfo->VendorGuid, \r | |
75 | VariableInfo->ReadCount,\r | |
76 | VariableInfo->CacheCount,\r | |
77 | VariableInfo->WriteCount,\r | |
78 | VariableInfo->DeleteCount,\r | |
79 | VariableInfo->Name\r | |
80 | );\r | |
81 | }\r | |
82 | VariableInfo = VariableInfo->Next;\r | |
83 | } while (VariableInfo != NULL);\r | |
84 | \r | |
85 | }\r | |
86 | \r | |
133e09da | 87 | return Status;\r |
33a5a666 | 88 | }\r |