summaryrefslogtreecommitdiffstats
path: root/source/compiler/aslcompile.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-06-20 17:51:04 +0000
committerjkim <jkim@FreeBSD.org>2012-06-20 17:51:04 +0000
commit2276af3c12160e6d7e3e06b506bf4ae5c9e8c420 (patch)
treef634c2ad6dfa6f49c5aaabc64f8bb79b74dda5a7 /source/compiler/aslcompile.c
parent291c27508808bb5c9ab780eb971fe958491f1468 (diff)
downloadFreeBSD-src-2276af3c12160e6d7e3e06b506bf4ae5c9e8c420.zip
FreeBSD-src-2276af3c12160e6d7e3e06b506bf4ae5c9e8c420.tar.gz
Import ACPICA 20120620.
Diffstat (limited to 'source/compiler/aslcompile.c')
-rw-r--r--source/compiler/aslcompile.c74
1 files changed, 45 insertions, 29 deletions
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c
index 2a87a01..a6ffe1e 100644
--- a/source/compiler/aslcompile.c
+++ b/source/compiler/aslcompile.c
@@ -67,6 +67,10 @@ FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
+static void
+CmDumpAllEvents (
+ void);
+
/*******************************************************************************
*
@@ -717,45 +721,65 @@ CmDoOutputFiles (
/*******************************************************************************
*
- * FUNCTION: CmDumpEvent
+ * FUNCTION: CmDumpAllEvents
*
- * PARAMETERS: Event - A compiler event struct
+ * PARAMETERS: None
*
* RETURN: None.
*
- * DESCRIPTION: Dump a compiler event struct
+ * DESCRIPTION: Dump all compiler events
*
******************************************************************************/
static void
-CmDumpEvent (
- ASL_EVENT_INFO *Event)
+CmDumpAllEvents (
+ void)
{
+ ASL_EVENT_INFO *Event;
UINT32 Delta;
UINT32 USec;
UINT32 MSec;
+ UINT32 i;
+
- if (!Event->Valid)
+ Event = AslGbl_Events;
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n");
+ if (Gbl_CompileTimesFlag)
{
- return;
+ printf ("\nElapsed time for major events\n\n");
}
- /* Delta will be in 100-nanosecond units */
+ for (i = 0; i < AslGbl_NextEvent; i++)
+ {
+ if (Event->Valid)
+ {
+ /* Delta will be in 100-nanosecond units */
- Delta = (UINT32) (Event->EndTime - Event->StartTime);
+ Delta = (UINT32) (Event->EndTime - Event->StartTime);
- USec = Delta / 10;
- MSec = Delta / 10000;
+ USec = Delta / 10;
+ MSec = Delta / 10000;
- /* Round milliseconds up */
+ /* Round milliseconds up */
- if ((USec - (MSec * 1000)) >= 500)
- {
- MSec++;
- }
+ if ((USec - (MSec * 1000)) >= 500)
+ {
+ MSec++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n",
+ USec, MSec, Event->EventName);
+
+ if (Gbl_CompileTimesFlag)
+ {
+ printf ("%8u usec %8u msec - %s\n",
+ USec, MSec, Event->EventName);
+ }
+ }
- DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n",
- USec, MSec, Event->EventName);
+ Event++;
+ }
}
@@ -786,20 +810,12 @@ CmCleanupAndExit (
AePrintErrorLog (ASL_FILE_STDOUT);
}
- DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n");
- for (i = 0; i < AslGbl_NextEvent; i++)
- {
- CmDumpEvent (&AslGbl_Events[i]);
- }
+ /* Emit compile times if enabled */
+
+ CmDumpAllEvents ();
if (Gbl_CompileTimesFlag)
{
- printf ("\nElapsed time for major events\n\n");
- for (i = 0; i < AslGbl_NextEvent; i++)
- {
- CmDumpEvent (&AslGbl_Events[i]);
- }
-
printf ("\nMiscellaneous compile statistics\n\n");
printf ("%11u : %s\n", TotalParseNodes, "Parse nodes");
printf ("%11u : %s\n", Gbl_NsLookupCount, "Namespace searches");
OpenPOWER on IntegriCloud