Added option to display memory statistics upon termination.

This commit is contained in:
rmoore1 2006-12-14 22:29:21 +00:00
parent 9c61624ce5
commit dc0474fb52
4 changed files with 32 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utalloc - local memory allocation routines
* $Revision: 1.162 $
* $Revision: 1.163 $
*
*****************************************************************************/
@ -117,6 +117,7 @@
#define __UTALLOC_C__
#include "acpi.h"
#include "acdebug.h"
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utalloc")
@ -218,6 +219,15 @@ ACPI_STATUS
AcpiUtDeleteCaches (
void)
{
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char Buffer[7];
if (AcpiGbl_DisplayFinalMemStats)
{
ACPI_STRCPY (Buffer, "MEMORY");
AcpiDbDisplayStatistics (Buffer);
}
#endif
(void) AcpiOsDeleteCache (AcpiGbl_NamespaceCache);
AcpiGbl_NamespaceCache = NULL;

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
* $Revision: 1.247 $
* $Revision: 1.248 $
*
*****************************************************************************/
@ -826,6 +826,10 @@ AcpiUtInitGlobals (
AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX;
#endif
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiGbl_DisplayFinalMemStats = FALSE;
#endif
return_VOID;
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
* $Revision: 1.190 $
* $Revision: 1.191 $
*
*****************************************************************************/
@ -276,6 +276,7 @@ ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W ex
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
#endif
/* Object caches */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: aemain - Main routine for the AcpiExec utility
* $Revision: 1.109 $
* $Revision: 1.110 $
*
*****************************************************************************/
@ -151,11 +151,12 @@ usage (void)
printf (" -b <CommandLine> Batch mode command execution\n");
printf (" -e [Method] Batch mode method execution\n");
printf (" -i Do not run STA/INI methods during init\n");
printf (" -m Display final memory use statistics\n");
printf (" -o <OutputFile> Send output to this file\n");
printf (" -s Enable Interpreter Slack Mode\n");
printf (" -t Enable Interpreter Serialized Mode\n");
printf (" -x <DebugLevel> Specify debug output level\n");
printf (" -v Verbose init output\n");
printf (" -x <DebugLevel> Specify debug output level\n");
}
@ -266,7 +267,7 @@ main (
/* Get the command line options */
while ((j = AcpiGetopt (argc, argv, "?ab:de^gio:stvx:")) != EOF) switch(j)
while ((j = AcpiGetopt (argc, argv, "?ab:de^gimo:stvx:")) != EOF) switch(j)
{
case 'a':
AcpiGbl_IgnoreErrors = TRUE;
@ -310,10 +311,10 @@ main (
AcpiGbl_DbOpt_ini_methods = FALSE;
break;
case 'x':
AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0);
AcpiGbl_DbConsoleDebugLevel = AcpiDbgLevel;
printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel);
case 'm':
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiGbl_DisplayFinalMemStats = TRUE;
#endif
break;
case 'o':
@ -334,6 +335,12 @@ main (
AcpiDbgLevel |= ACPI_LV_INIT_NAMES;
break;
case 'x':
AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0);
AcpiGbl_DbConsoleDebugLevel = AcpiDbgLevel;
printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel);
break;
case '?':
default:
usage();