iASL: Fix -ot option (display compile times/statistics).

Was not working properly for standard output; only worked for the
debug file case.
This commit is contained in:
Robert Moore 2012-05-23 13:50:37 -07:00
parent 1e39cde26c
commit 2bb2b5d75a

View File

@ -139,6 +139,10 @@ FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
static void
CmDumpAllEvents (
void);
/*******************************************************************************
*
@ -789,45 +793,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 */
Delta = (UINT32) (Event->EndTime - Event->StartTime);
USec = Delta / 10;
MSec = Delta / 10000;
/* Round milliseconds up */
if ((USec - (MSec * 1000)) >= 500)
for (i = 0; i < AslGbl_NextEvent; i++)
{
MSec++;
}
if (Event->Valid)
{
/* Delta will be in 100-nanosecond units */
DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n",
USec, MSec, Event->EventName);
Delta = (UINT32) (Event->EndTime - Event->StartTime);
USec = Delta / 10;
MSec = Delta / 10000;
/* Round milliseconds up */
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);
}
}
Event++;
}
}
@ -858,20 +882,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");