]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpInternal.h
Refine coding style.
[mirror_edk2.git] / PerformancePkg / Dp_App / DpInternal.h
index 656223020932418ca2d8b75e700b5db10a8dc319..974901203ac26f6430b3dd865a11958ea7f46d38 100644 (file)
@@ -39,48 +39,58 @@ extern UINT32 const       NumCum;
 \r
 ///@}\r
 \r
-/** Calculate an event's duration in timer ticks.\r
-  *\r
-  * Given the count direction and the event's start and end timer values,\r
-  * calculate the duration of the event in timer ticks.\r
-  *\r
-  * @pre  The global TimerInfo structure must have already been initialized\r
-  *       before this function is called.\r
-  *\r
-  * @param[in,out]    Measurement   Pointer to a structure containing data for the current measurement.\r
-  *\r
-  * @return       The 64-bit duration of the event.\r
+/** \r
+  Calculate an event's duration in timer ticks.\r
+  \r
+  Given the count direction and the event's start and end timer values,\r
+  calculate the duration of the event in timer ticks.  Information for\r
+  the current measurement is pointed to by the parameter.\r
+  \r
+  If the measurement's start time is 1, it indicates that the developer\r
+  is indicating that the measurement began at the release of reset.\r
+  The start time is adjusted to the timer's starting count before performing\r
+  the elapsed time calculation.\r
+  \r
+  The calculated duration, in ticks, is the absolute difference between\r
+  the measurement's ending and starting counts.\r
+  \r
+  @param Measurement   Pointer to a MEASUREMENT_RECORD structure containing\r
+                       data for the current measurement.\r
+  \r
+  @return              The 64-bit duration of the event.\r
 **/\r
 UINT64\r
 GetDuration (\r
   IN OUT MEASUREMENT_RECORD *Measurement\r
 );\r
 \r
-/** Determine whether the Measurement record is for an EFI Phase.\r
-  *\r
-  * The Token and Module members of the measurement record are checked.\r
-  * Module must be empty and Token must be one of SEC, PEI, DXE, or BDS.\r
-  *\r
-  * @param[in]  Measurement A pointer to the Measurement record to test.\r
-  *\r
-  * @retval     TRUE        The measurement record is for an EFI Phase.\r
-  * @retval     FALSE       The measurement record is NOT for an EFI Phase.\r
+/** \r
+  Determine whether the Measurement record is for an EFI Phase.\r
+  \r
+  The Token and Module members of the measurement record are checked.\r
+  Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL.\r
+  \r
+  @param[in]  Measurement A pointer to the Measurement record to test.\r
+  \r
+  @retval     TRUE        The measurement record is for an EFI Phase.\r
+  @retval     FALSE       The measurement record is NOT for an EFI Phase.\r
 **/\r
 BOOLEAN\r
 IsPhase(\r
   IN MEASUREMENT_RECORD *Measurement\r
 );\r
 \r
-/** Get the file name portion of the Pdb File Name.\r
-  *\r
-  * The portion of the Pdb File Name between the last backslash and\r
-  * either a following period or the end of the string is converted\r
-  * to Unicode and copied into UnicodeBuffer.  The name is truncated,\r
-  * if necessary, to ensure that UnicodeBuffer is not overrun.\r
-  *\r
-  * @param[in]  PdbFileName     Pdb file name.\r
-  * @param[out] UnicodeBuffer   The resultant Unicode File Name.\r
-  *\r
+/** \r
+  Get the file name portion of the Pdb File Name.\r
+  \r
+  The portion of the Pdb File Name between the last backslash and\r
+  either a following period or the end of the string is converted\r
+  to Unicode and copied into UnicodeBuffer.  The name is truncated,\r
+  if necessary, to ensure that UnicodeBuffer is not overrun.\r
+  \r
+  @param[in]  PdbFileName     Pdb file name.\r
+  @param[out] UnicodeBuffer   The resultant Unicode File Name.\r
+  \r
 **/\r
 VOID\r
 GetShortPdbFileName (\r
@@ -88,40 +98,46 @@ GetShortPdbFileName (
   OUT CHAR16    *UnicodeBuffer\r
 );\r
 \r
-/** Get a human readable name for an image handle.\r
-  *\r
-  * @param[in]    Handle\r
-  *\r
-  * @post   The resulting Unicode name string is stored in the\r
-  *         mGaugeString global array.\r
-  *\r
+/** \r
+  Get a human readable name for an image handle.\r
+  \r
+  @param[in]    Handle\r
+  \r
+  @post   The resulting Unicode name string is stored in the\r
+          mGaugeString global array.\r
+  \r
 **/\r
 VOID\r
 GetNameFromHandle (\r
   IN EFI_HANDLE Handle\r
 );\r
 \r
-/** Calculate the Duration in microseconds.\r
-  *\r
-  * Duration is multiplied by 1000, instead of Frequency being divided by 1000\r
-  * in order to maintain precision.  Since Duration is\r
-  * a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow.\r
-  *\r
-  * @param[in] Duration   The event duration in timer ticks.\r
-  *\r
-  * @return   A 64-bit value which is the Elapsed time in microseconds.\r
+/** \r
+  Calculate the Duration in microseconds.\r
+  \r
+  Duration is multiplied by 1000, instead of Frequency being divided by 1000 or\r
+  multiplying the result by 1000, in order to maintain precision.  Since Duration is\r
+  a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow.\r
+  \r
+  The time is calculated as (Duration * 1000) / Timer_Frequency.\r
+  \r
+  @param[in]  Duration   The event duration in timer ticks.\r
+  \r
+  @return     A 64-bit value which is the Elapsed time in microseconds.\r
 **/\r
 UINT64\r
 DurationInMicroSeconds (\r
   IN UINT64 Duration\r
 );\r
 \r
-/** Formatted Print using a Hii Token to reference the localized format string.\r
-  *\r
-  * @param[in]  Token   A HII token associated with a localized Unicode string.\r
-  *\r
-  * @return             The number of characters converted by UnicodeVSPrint().\r
-  *\r
+/** \r
+  Formatted Print using a Hii Token to reference the localized format string.\r
+  \r
+  @param[in]  Token   A HII token associated with a localized Unicode string.\r
+  @param[in]  ...     The variable argument list.\r
+  \r
+  @return             The number of characters converted by UnicodeVSPrint().\r
+  \r
 **/\r
 UINTN\r
 PrintToken (\r
@@ -129,52 +145,60 @@ PrintToken (
   ...\r
 );\r
 \r
-/** Get index of Measurement Record's match in the CumData array.\r
-  *\r
-  * @param[in]  Measurement A pointer to a Measurement Record to match against the CumData array.\r
-  *\r
-  * @retval     <0    Token is not in the CumData array.\r
-  * @retval     >=0   Return value is the index into CumData where Token is found.\r
+/** \r
+  Get index of Measurement Record's match in the CumData array.\r
+  \r
+  If the Measurement's Token value matches a Token in one of the CumData\r
+  records, the index of the matching record is returned.  The returned\r
+  index is a signed value so that negative values can indicate that\r
+  the Measurement didn't match any entry in the CumData array.\r
+  \r
+  @param[in]  Measurement A pointer to a Measurement Record to match against the CumData array.\r
+  \r
+  @retval     <0    Token is not in the CumData array.\r
+  @retval     >=0   Return value is the index into CumData where Token is found.\r
 **/\r
 INTN\r
 GetCumulativeItem(\r
   IN MEASUREMENT_RECORD *Measurement\r
 );\r
 \r
-/** Collect verbose statistics about the logged performance measurements.\r
-  *\r
-  * General Summary information for all Trace measurements is gathered and\r
-  * stored within the SummaryData structure.  This information is both\r
-  * used internally by subsequent reporting functions, and displayed\r
-  * at the end of verbose reports.\r
-  *\r
-  * @pre  The SummaryData and CumData structures must be initialized\r
-  *       prior to calling this function.\r
-  *\r
-  * @post The SummaryData and CumData structures contain statistics for the\r
-  *       current performance logs.\r
+/** \r
+  Collect verbose statistics about the logged performance measurements.\r
+  \r
+  General Summary information for all Trace measurements is gathered and\r
+  stored within the SummaryData structure.  This information is both\r
+  used internally by subsequent reporting functions, and displayed\r
+  at the end of verbose reports.\r
+  \r
+  @pre  The SummaryData and CumData structures must be initialized\r
+        prior to calling this function.\r
+  \r
+  @post The SummaryData and CumData structures contain statistics for the\r
+        current performance logs.\r
 **/\r
 VOID\r
 GatherStatistics(\r
   VOID\r
 );\r
 \r
-/** Gather and print ALL Trace Records.\r
-  *\r
-  * Displays all "interesting" Trace measurements in order.\r
-  * The number of records displayed is controlled by:\r
-  *   - records with a duration less than mInterestThreshold microseconds are not displayed.\r
-  *   - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
-  *   - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
-  *     displayed.\r
-  *\r
-  * @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
-  *         The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r
-  *         They must not be in use by a calling function.\r
-  *\r
-  * @param[in]    Limit       The number of records to print.  Zero is ALL.\r
-  * @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
-  *\r
+/** \r
+  Gather and print ALL Trace Records.\r
+  \r
+  Displays all "interesting" Trace measurements in order.<BR>\r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
+           The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r
+           They must not be in use by a calling function.\r
+  \r
+  @param[in]    Limit       The number of records to print.  Zero is ALL.\r
+  @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
+  \r
 **/\r
 VOID\r
 DumpAllTrace(\r
@@ -182,22 +206,23 @@ DumpAllTrace(
   IN BOOLEAN           ExcludeFlag\r
 );\r
 \r
-/** Gather and print Raw Trace Records.\r
-  *\r
-  * All Trace measurements with a duration greater than or equal to\r
-  * mInterestThreshold are printed without interpretation.\r
-  *\r
-  * The number of records displayed is controlled by:\r
-  *   - records with a duration less than mInterestThreshold microseconds are not displayed.\r
-  *   - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
-  *   - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
-  *     displayed.\r
-  *\r
-  * @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
-  *\r
-  * @param[in]    Limit       The number of records to print.  Zero is ALL.\r
-  * @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
-  *\r
+/** \r
+  Gather and print Raw Trace Records.\r
+  \r
+  All Trace measurements with a duration greater than or equal to\r
+  mInterestThreshold are printed without interpretation.\r
+  \r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
+  \r
+  @param[in]    Limit       The number of records to print.  Zero is ALL.\r
+  @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
+  \r
 **/\r
 VOID\r
 DumpRawTrace(\r
@@ -205,10 +230,11 @@ DumpRawTrace(
   IN BOOLEAN        ExcludeFlag\r
 );\r
 \r
-/** Gather and print Major Phase metrics.\r
-  *\r
-  * @param[in]    Ticker      The timer value for the END of Shell phase\r
-  *\r
+/** \r
+  Gather and print Major Phase metrics.\r
+  \r
+  @param[in]    Ticker      The timer value for the END of Shell phase\r
+  \r
 **/\r
 VOID\r
 ProcessPhases(\r
@@ -216,11 +242,12 @@ ProcessPhases(
 );\r
 \r
 \r
-/** Gather and print Handle data.\r
-  *\r
-  * @param[in]    ExcludeFlag   TRUE if the -x command line flag given.  Elides accumulated trace records.\r
-  *\r
-  * @return       Status from a call to gBS->LocateHandle().\r
+/** \r
+  Gather and print Handle data.\r
+  \r
+  @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
+  \r
+  @return       Status from a call to gBS->LocateHandle().\r
 **/\r
 EFI_STATUS\r
 ProcessHandles(\r
@@ -228,48 +255,62 @@ ProcessHandles(
 );\r
 \r
 \r
-/** Gather and print PEIM data.\r
-  *\r
-  * Only prints complete PEIM records\r
-  *\r
+/** \r
+  Gather and print PEIM data.\r
+  \r
+  Only prints complete PEIM records\r
+  \r
 **/\r
 VOID\r
 ProcessPeims(\r
   VOID\r
 );\r
 \r
-/** Gather and print global data.\r
-  *\r
-  * Strips out incomplete or "Execution Phase" records\r
-  * Only prints records where Handle is NULL\r
-  * Increment TIndex for every record, even skipped ones, so that we have an\r
-  * indication of every measurement record taken.\r
-  *\r
-  *\r
+/** \r
+  Gather and print global data.\r
+  \r
+  Strips out incomplete or "Execution Phase" records\r
+  Only prints records where Handle is NULL\r
+  Increment TIndex for every record, even skipped ones, so that we have an\r
+  indication of every measurement record taken.\r
+  \r
 **/\r
 VOID\r
 ProcessGlobal(\r
   VOID\r
 );\r
 \r
-/** Gather and print cumulative data.\r
-  *\r
-  * Traverse the measurement records and:\r
-  * for each record with a Token listed in the CumData array,\r
-  *   Update the instance count and the total, minimum, and maximum durations.\r
-  * Finally, print the gathered cumulative statistics.\r
-  *\r
+/** \r
+  Gather and print cumulative data.\r
+  \r
+  Traverse the measurement records and:<BR>\r
+  For each record with a Token listed in the CumData array:<BR>\r
+     - Update the instance count and the total, minimum, and maximum durations.\r
+  Finally, print the gathered cumulative statistics.\r
+  \r
 **/\r
 VOID\r
 ProcessCumulative(\r
   VOID\r
 );\r
 \r
-/** Gather and print ALL Profile Records.\r
-  *\r
-  * @param[in]    Limit       The number of records to print.  Zero is ALL.\r
-  * @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display\r
-  *\r
+/** \r
+  Gather and print ALL Profiling Records.\r
+  \r
+  Displays all "interesting" Profile measurements in order.\r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
+           The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.\r
+           They must not be in use by a calling function.\r
+  \r
+  @param[in]    Limit         The number of records to print.  Zero is ALL.\r
+  @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
+  \r
 **/\r
 VOID\r
 DumpAllProfile(\r
@@ -277,11 +318,23 @@ DumpAllProfile(
   IN BOOLEAN        ExcludeFlag\r
 );\r
 \r
-/** Gather and print Raw Profile Records.\r
-  *\r
-  * @param[in]    Limit       The number of records to print.\r
-  * @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display\r
-  *\r
+/** \r
+  Gather and print Raw Profile Records.\r
+  \r
+  All Profile measurements with a duration greater than or equal to\r
+  mInterestThreshold are printed without interpretation.\r
+  \r
+  The number of records displayed is controlled by:\r
+     - records with a duration less than mInterestThreshold microseconds are not displayed.\r
+     - No more than Limit records are displayed.  A Limit of zero will not limit the output.\r
+     - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not\r
+       displayed.\r
+  \r
+  @pre    The mInterestThreshold global variable is set to the shortest duration to be printed.\r
+  \r
+  @param[in]    Limit         The number of records to print.  Zero is ALL.\r
+  @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
+  \r
 **/\r
 VOID\r
 DumpRawProfile(\r