]>
Commit | Line | Data |
---|---|---|
c06ad33e | 1 | /** @file\r |
2 | * Measured Profiling reporting for the Dp utility.\r | |
3 | *\r | |
92ea1df8 | 4 | * Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r |
c06ad33e | 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 | /** Gather and print ALL Profiling Records.\r | |
33 | *\r | |
34 | * Displays all "interesting" Profile measurements in order.\r | |
35 | * The number of records displayed is controlled by:\r | |
36 | * - records with a duration less than mInterestThreshold microseconds are not displayed.\r | |
37 | * - No more than Limit records are displayed. A Limit of zero will not limit the output.\r | |
38 | * - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r | |
39 | * displayed.\r | |
40 | *\r | |
41 | * @pre The mInterestThreshold global variable is set to the shortest duration to be printed.\r | |
42 | * The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r | |
43 | * They must not be in use by a calling function.\r | |
44 | *\r | |
45 | * @param[in] Limit The number of records to print. Zero is ALL.\r | |
46 | * @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r | |
47 | *\r | |
48 | **/\r | |
49 | VOID\r | |
50 | DumpAllProfile(\r | |
51 | IN UINTN Limit,\r | |
52 | IN BOOLEAN ExcludeFlag\r | |
53 | )\r | |
54 | {\r | |
55 | EFI_STRING StringPtr;\r | |
56 | \r | |
57 | StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_PROFILE), NULL);\r | |
58 | PrintToken( STRING_TOKEN (STR_DP_SECTION_HEADER),\r | |
59 | (StringPtr == NULL) ? ALit_UNKNOWN: StringPtr);\r | |
60 | return;\r | |
61 | }\r | |
62 | \r | |
63 | /** Gather and print Raw Profile Records.\r | |
64 | *\r | |
65 | * All Profile measurements with a duration greater than or equal to\r | |
66 | * mInterestThreshold are printed without interpretation.\r | |
67 | *\r | |
68 | * The number of records displayed is controlled by:\r | |
69 | * - records with a duration less than mInterestThreshold microseconds are not displayed.\r | |
70 | * - No more than Limit records are displayed. A Limit of zero will not limit the output.\r | |
71 | * - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r | |
72 | * displayed.\r | |
73 | *\r | |
74 | * @pre The mInterestThreshold global variable is set to the shortest duration to be printed.\r | |
75 | *\r | |
76 | * @param[in] Limit The number of records to print. Zero is ALL.\r | |
77 | * @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.\r | |
78 | *\r | |
79 | **/\r | |
80 | VOID\r | |
81 | DumpRawProfile(\r | |
82 | IN UINTN Limit,\r | |
83 | IN BOOLEAN ExcludeFlag\r | |
84 | )\r | |
85 | {\r | |
86 | EFI_STRING StringPtr;\r | |
87 | \r | |
88 | StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWPROFILE), NULL);\r | |
89 | PrintToken( STRING_TOKEN (STR_DP_SECTION_HEADER),\r | |
90 | (StringPtr == NULL) ? ALit_UNKNOWN: StringPtr);\r | |
91 | return;\r | |
92 | }\r |