]>
Commit | Line | Data |
---|---|---|
d41bc92c | 1 | /** @file\r |
2 | Measured Profiling reporting for the Dp utility.\r | |
3 | \r | |
4 | Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | **/\r | |
13 | \r | |
14 | #include <Library/BaseLib.h>\r | |
15 | #include <Library/BaseMemoryLib.h>\r | |
16 | #include <Library/MemoryAllocationLib.h>\r | |
17 | #include <Library/DebugLib.h>\r | |
18 | #include <Library/UefiBootServicesTableLib.h>\r | |
19 | #include <Library/TimerLib.h>\r | |
20 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
21 | #include <Library/PerformanceLib.h>\r | |
22 | #include <Library/PrintLib.h>\r | |
23 | #include <Library/HiiLib.h>\r | |
24 | #include <Library/PcdLib.h>\r | |
25 | \r | |
26 | #include <Guid/Performance.h>\r | |
27 | \r | |
28 | #include "Dp.h"\r | |
29 | #include "Literals.h"\r | |
30 | #include "DpInternal.h"\r | |
31 | \r | |
32 | /** \r | |
33 | Gather and print ALL Profiling Records.\r | |
34 | \r | |
35 | Displays all "interesting" Profile measurements in order.\r | |
36 | The number of records displayed is controlled by:\r | |
37 | - records with a duration less than mInterestThreshold microseconds are not displayed.\r | |
38 | - No more than Limit records are displayed. A Limit of zero will not limit the output.\r | |
39 | - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r | |
40 | displayed.\r | |
41 | \r | |
42 | @pre The mInterestThreshold global variable is set to the shortest duration to be printed.\r | |
43 | The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r | |
44 | They must not be in use by a calling function.\r | |
45 | \r | |
46 | @param[in] Limit The number of records to print. Zero is ALL.\r | |
47 | @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r | |
48 | \r | |
49 | **/\r | |
50 | VOID\r | |
51 | DumpAllProfile(\r | |
52 | IN UINTN Limit,\r | |
53 | IN BOOLEAN ExcludeFlag\r | |
54 | )\r | |
55 | {\r | |
56 | EFI_STRING StringPtr;\r | |
57 | EFI_STRING StringPtrUnknown;\r | |
58 | \r | |
59 | StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL); \r | |
60 | StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_PROFILE), NULL);\r | |
61 | \r | |
62 | ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_SECTION_HEADER), gDpHiiHandle, \r | |
63 | (StringPtr == NULL) ? StringPtrUnknown: StringPtr);\r | |
64 | FreePool (StringPtr);\r | |
65 | FreePool (StringPtrUnknown);\r | |
66 | }\r | |
67 | \r | |
68 | /** \r | |
69 | Gather and print Raw Profile Records.\r | |
70 | \r | |
71 | All Profile measurements with a duration greater than or equal to\r | |
72 | mInterestThreshold are printed without interpretation.\r | |
73 | \r | |
74 | The number of records displayed is controlled by:\r | |
75 | - records with a duration less than mInterestThreshold microseconds are not displayed.\r | |
76 | - No more than Limit records are displayed. A Limit of zero will not limit the output.\r | |
77 | - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r | |
78 | displayed.\r | |
79 | \r | |
80 | @pre The mInterestThreshold global variable is set to the shortest duration to be printed.\r | |
81 | \r | |
82 | @param[in] Limit The number of records to print. Zero is ALL.\r | |
83 | @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r | |
84 | \r | |
85 | **/\r | |
86 | VOID\r | |
87 | DumpRawProfile(\r | |
88 | IN UINTN Limit,\r | |
89 | IN BOOLEAN ExcludeFlag\r | |
90 | )\r | |
91 | {\r | |
92 | EFI_STRING StringPtr;\r | |
93 | EFI_STRING StringPtrUnknown;\r | |
94 | \r | |
95 | StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);\r | |
96 | StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWPROFILE), NULL);\r | |
97 | ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_SECTION_HEADER), gDpHiiHandle, \r | |
98 | (StringPtr == NULL) ? StringPtrUnknown: StringPtr);\r | |
99 | FreePool (StringPtr);\r | |
100 | FreePool (StringPtrUnknown);\r | |
101 | }\r |