]>
Commit | Line | Data |
---|---|---|
c06ad33e | 1 | /** @file\r |
86da563d ED |
2 | Common declarations for the Dp Performance Reporting Utility.\r |
3 | \r | |
0b84f444 | 4 | Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r |
86da563d ED |
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 | |
c06ad33e | 12 | **/\r |
13 | \r | |
14 | #ifndef _EFI_APP_DP_H_\r | |
15 | #define _EFI_APP_DP_H_\r | |
16 | \r | |
88359546 ED |
17 | #include <Library/ShellLib.h>\r |
18 | \r | |
c06ad33e | 19 | #define DP_MAJOR_VERSION 2\r |
20 | #define DP_MINOR_VERSION 3\r | |
21 | \r | |
22 | /**\r | |
23 | * The value assigned to DP_DEBUG controls which debug output\r | |
24 | * is generated. Set it to ZERO to disable.\r | |
25 | **/\r | |
26 | #define DP_DEBUG 0\r | |
27 | \r | |
28 | /**\r | |
29 | * Set to 1 once Profiling has been implemented in order to enable\r | |
30 | * profiling related options and report output.\r | |
31 | **/\r | |
32 | #define PROFILING_IMPLEMENTED 0\r | |
33 | \r | |
34 | #define DEFAULT_THRESHOLD 1000 ///< One millisecond.\r | |
35 | #define DEFAULT_DISPLAYCOUNT 50\r | |
36 | #define MAXIMUM_DISPLAYCOUNT 999999 ///< Arbitrary maximum reasonable number.\r | |
37 | \r | |
38 | #define PERF_MAXDUR 0xFFFFFFFFFFFFFFFFULL\r | |
39 | \r | |
40 | /// Determine whether 0 <= C < L. If L == 0, return true regardless of C.\r | |
41 | #define WITHIN_LIMIT( C, L) ( ((L) == 0) || ((C) < (L)) )\r | |
42 | \r | |
43 | /// Structure for storing Timer specific information.\r | |
44 | typedef struct {\r | |
45 | UINT64 StartCount; ///< Value timer is initialized with.\r | |
46 | UINT64 EndCount; ///< Value timer has just before it wraps.\r | |
47 | UINT32 Frequency; ///< Timer count frequency in KHz.\r | |
48 | BOOLEAN CountUp; ///< TRUE if the counter counts up.\r | |
49 | } TIMER_INFO;\r | |
50 | \r | |
51 | /** Initialize one PERF_CUM_DATA structure instance for token t.\r | |
52 | *\r | |
53 | * This parameterized macro takes a single argument, t, which is expected\r | |
54 | * to resolve to a pointer to an ASCII string literal. This parameter may\r | |
55 | * take any one of the following forms:\r | |
56 | * - PERF_INIT_CUM_DATA("Token") A string literal\r | |
57 | * - PERF_INIT_CUM_DATA(pointer) A pointer -- CHAR8 *pointer;\r | |
58 | * - PERF_INIT_CUM_DATA(array) Address of an array -- CHAR8 array[N];\r | |
59 | **/\r | |
60 | #define PERF_INIT_CUM_DATA(t) { 0ULL, PERF_MAXDUR, 0ULL, (t), 0U }\r | |
61 | \r | |
62 | typedef struct {\r | |
63 | UINT64 Duration; ///< Cumulative duration for this item.\r | |
64 | UINT64 MinDur; ///< Smallest duration encountered.\r | |
65 | UINT64 MaxDur; ///< Largest duration encountered.\r | |
66 | CHAR8 *Name; ///< ASCII name of this item.\r | |
67 | UINT32 Count; ///< Total number of measurements accumulated.\r | |
68 | } PERF_CUM_DATA;\r | |
69 | \r | |
70 | typedef struct {\r | |
71 | UINT32 NumTrace; ///< Number of recorded TRACE performance measurements.\r | |
72 | UINT32 NumProfile; ///< Number of recorded PROFILE performance measurements.\r | |
73 | UINT32 NumIncomplete; ///< Number of measurements with no END value.\r | |
74 | UINT32 NumSummary; ///< Number of summary section measurements.\r | |
75 | UINT32 NumHandles; ///< Number of measurements with handles.\r | |
76 | UINT32 NumPEIMs; ///< Number of measurements of PEIMs.\r | |
77 | UINT32 NumGlobal; ///< Number of measurements with END value and NULL handle.\r | |
78 | } PERF_SUMMARY_DATA;\r | |
79 | \r | |
80 | typedef struct {\r | |
16d5d168 | 81 | CONST VOID *Handle;\r |
82 | CONST CHAR8 *Token; ///< Measured token string name.\r | |
83 | CONST CHAR8 *Module; ///< Module string name.\r | |
c06ad33e | 84 | UINT64 StartTimeStamp; ///< Start time point.\r |
85 | UINT64 EndTimeStamp; ///< End time point.\r | |
0b84f444 | 86 | UINT32 Identifier; ///< Identifier.\r |
c06ad33e | 87 | } MEASUREMENT_RECORD;\r |
88 | \r | |
89 | typedef struct {\r | |
90 | CHAR8 *Name; ///< Measured token string name.\r | |
91 | UINT64 CumulativeTime; ///< Accumulated Elapsed Time.\r | |
92 | UINT64 MinTime; ///< Minimum Elapsed Time.\r | |
93 | UINT64 MaxTime; ///< Maximum Elapsed Time.\r | |
94 | UINT32 Count; ///< Number of measurements accumulated.\r | |
95 | } PROFILE_RECORD;\r | |
96 | \r | |
88359546 ED |
97 | typedef struct {\r |
98 | UINT16 Token;\r | |
99 | SHELL_PARAM_TYPE Type;\r | |
100 | } PARAM_ITEM_LIST;\r | |
c06ad33e | 101 | #endif // _EFI_APP_DP_H_\r |