void CmCleanupAndExit ( void) { UINT32 i; AePrintErrorLog (ASL_FILE_STDOUT); if (Gbl_DebugFlag) { /* Print error summary to the debug file */ AePrintErrorLog (ASL_FILE_STDERR); } DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n"); for (i = 0; i < AslGbl_NextEvent; i++) { CmDumpEvent (&AslGbl_Events[i]); } 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"); printf ("%11u : %s\n", TotalNamedObjects, "Named objects"); printf ("%11u : %s\n", TotalMethods, "Control methods"); printf ("%11u : %s\n", TotalAllocations, "Memory Allocations"); printf ("%11u : %s\n", TotalAllocated, "Total allocated memory"); printf ("%11u : %s\n", TotalFolds, "Constant subtrees folded"); printf ("\n"); } if (Gbl_NsLookupCount) { DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n"); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %u\n", "Total Namespace searches", Gbl_NsLookupCount); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %u usec\n", "Time per search", ((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime - AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) / Gbl_NsLookupCount); } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT); } UtDisplaySummary (ASL_FILE_STDOUT); /* Close all open files */ for (i = 2; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } /* Delete AML file if there are errors */ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) && Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) { if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename)) { printf ("%s: ", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); perror ("Could not delete AML file"); } } /* * Delete intermediate ("combined") source file (if -ls flag not set) * This file is created during normal ASL/AML compiles. It is not * created by the data table compiler. * * If the -ls flag is set, then the .SRC file should not be deleted. * In this case, Gbl_SourceOutputFlag is set to TRUE. * * Note: Handles are cleared by FlCloseFile above, so we look at the * filename instead, to determine if the .SRC file was actually * created. * * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename) { if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) { printf ("%s: ", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); perror ("Could not delete SRC file"); } } }
void CmCleanupAndExit ( void) { UINT32 i; AePrintErrorLog (ASL_FILE_STDOUT); if (Gbl_DebugFlag) { /* Print error summary to the debug file */ AePrintErrorLog (ASL_FILE_STDERR); } DbgPrint (ASL_DEBUG_OUTPUT, "\n\nElapsed time for major events\n\n"); for (i = 0; i < AslGbl_NextEvent; i++) { CmDumpEvent (&AslGbl_Events[i]); } 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"); printf ("%11u : %s\n", TotalNamedObjects, "Named objects"); printf ("%11u : %s\n", TotalMethods, "Control methods"); printf ("%11u : %s\n", TotalAllocations, "Memory Allocations"); printf ("%11u : %s\n", TotalAllocated, "Total allocated memory"); printf ("%11u : %s\n", TotalFolds, "Constant subtrees folded"); printf ("\n"); } if (Gbl_NsLookupCount) { DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n"); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d\n", "Total Namespace searches", Gbl_NsLookupCount); DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d usec\n", "Time per search", ((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime - AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) / Gbl_NsLookupCount); } /* Close all open files */ for (i = 2; i < ASL_MAX_FILE_TYPE; i++) { FlCloseFile (i); } /* * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag) { remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } /* Delete AML file if there are errors */ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) { remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } UtDisplaySummary (ASL_FILE_STDOUT); }