mirror of
https://github.com/acpica/acpica/
synced 2025-01-17 06:49:27 +03:00
Optimized the ACPI_OPERAND_OBJECT size
date 2000.08.30.22.55.00; author rmoore1; state Exp;
This commit is contained in:
parent
b9c88e388b
commit
48b7bb02bd
@ -1,6 +1,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dbstats - Generation and display of ACPI table statistics
|
||||
* $Revision: 1.31 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -122,7 +123,7 @@
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
|
||||
#define _COMPONENT DEBUGGER
|
||||
MODULE_NAME ("dbstats");
|
||||
MODULE_NAME ("dbstats")
|
||||
|
||||
ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
{
|
||||
@ -131,14 +132,16 @@ ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
{"MEMORY"},
|
||||
{"MISC"},
|
||||
{"TABLES"},
|
||||
{"SIZES"},
|
||||
{NULL} /* Must be null terminated */
|
||||
};
|
||||
|
||||
#define CMD_OBJECTS 0
|
||||
#define CMD_ALLOCATIONS 1
|
||||
#define CMD_ALLOCATIONS 0
|
||||
#define CMD_OBJECTS 1
|
||||
#define CMD_MEMORY 2
|
||||
#define CMD_MISC 3
|
||||
#define CMD_TABLES 4
|
||||
#define CMD_SIZES 5
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
@ -152,7 +155,7 @@ UINT32 NumAliases = 0;
|
||||
UINT32 NumDevices = 0;
|
||||
UINT32 NumFieldDefs = 0;
|
||||
UINT32 NumThermalZones = 0;
|
||||
UINT32 NumNamedObjects = 0;
|
||||
UINT32 NumNodes = 0;
|
||||
UINT32 NumGrammarElements = 0;
|
||||
UINT32 NumMethodElements = 0;
|
||||
UINT32 NumMutexes = 0;
|
||||
@ -163,7 +166,7 @@ UINT32 NumEvents = 0;
|
||||
|
||||
UINT32 SizeOfParseTree;
|
||||
UINT32 SizeOfMethodTrees;
|
||||
UINT32 SizeOfNameTableEntries;
|
||||
UINT32 SizeOfNodeEntries;
|
||||
UINT32 SizeOfAcpiObjects;
|
||||
|
||||
|
||||
@ -181,7 +184,7 @@ UINT32 SizeOfAcpiObjects;
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisplayStatistics (
|
||||
INT8 *TypeArg)
|
||||
NATIVE_CHAR *TypeArg)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 Type;
|
||||
@ -194,7 +197,7 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
if (!TypeArg)
|
||||
{
|
||||
AcpiOsPrintf ("Use subcommand OBJECTS, MEMORY, MISC, or TABLES\n");
|
||||
AcpiOsPrintf ("The following subcommands are available:\n ALLOCATIONS, OBJECTS, MEMORY, MISC, SIZES, TABLES\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -240,7 +243,7 @@ AcpiDbDisplayStatistics (
|
||||
AcpiOsPrintf ("Control Methods:............% 7ld\n", NumMethods);
|
||||
AcpiOsPrintf ("Operation Regions:..........% 7ld\n", NumRegions);
|
||||
AcpiOsPrintf ("Field Definitions:..........% 7ld\n", NumFieldDefs);
|
||||
AcpiOsPrintf ("Total Named objects:........% 7ld\n", NumNamedObjects);
|
||||
AcpiOsPrintf ("Total Named objects:........% 7ld\n", NumNodes);
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
@ -255,11 +258,11 @@ AcpiDbDisplayStatistics (
|
||||
AcpiOsPrintf ("\nDynamic Memory Estimates:\n\n");
|
||||
AcpiOsPrintf ("Parse Tree without Methods:.% 7ld\n", SizeOfParseTree);
|
||||
AcpiOsPrintf ("Control Method Parse Trees:.% 7ld (If parsed simultaneously)\n", SizeOfMethodTrees);
|
||||
AcpiOsPrintf ("Named Object NTEs:..........% 7ld (%d objects)\n", SizeOfNameTableEntries, NumNamedObjects);
|
||||
AcpiOsPrintf ("Namespace Nodes:............% 7ld (%d objects)\n", SizeOfNodeEntries, NumNodes);
|
||||
AcpiOsPrintf ("Named Internal Objects......% 7ld\n", SizeOfAcpiObjects);
|
||||
AcpiOsPrintf ("State Cache size............% 7ld\n", AcpiGbl_GenericStateCacheDepth * sizeof (ACPI_GENERIC_STATE));
|
||||
AcpiOsPrintf ("Parse Cache size............% 7ld\n", AcpiGbl_ParseCacheDepth * sizeof (ACPI_GENERIC_OP));
|
||||
AcpiOsPrintf ("Object Cache size...........% 7ld\n", AcpiGbl_ObjectCacheDepth * sizeof (ACPI_OBJECT_INTERNAL));
|
||||
AcpiOsPrintf ("Parse Cache size............% 7ld\n", AcpiGbl_ParseCacheDepth * sizeof (ACPI_PARSE_OBJECT));
|
||||
AcpiOsPrintf ("Object Cache size...........% 7ld\n", AcpiGbl_ObjectCacheDepth * sizeof (ACPI_OPERAND_OBJECT));
|
||||
AcpiOsPrintf ("WalkState Cache size........% 7ld\n", AcpiGbl_WalkStateCacheDepth * sizeof (ACPI_WALK_STATE));
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -301,6 +304,42 @@ AcpiDbDisplayStatistics (
|
||||
AcpiOsPrintf ("%-20s: % 7ld\n", AcpiCmGetMutexName (i), AcpiGbl_AcpiMutexInfo[i].UseCount);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_SIZES:
|
||||
|
||||
AcpiOsPrintf ("\nInternal object sizes:\n\n");
|
||||
|
||||
AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON));
|
||||
AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_NUMBER));
|
||||
AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING));
|
||||
AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER));
|
||||
AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
|
||||
AcpiOsPrintf ("FieldUnit %3d\n", sizeof (ACPI_OBJECT_FIELD_UNIT));
|
||||
AcpiOsPrintf ("Device %3d\n", sizeof (ACPI_OBJECT_DEVICE));
|
||||
AcpiOsPrintf ("Event %3d\n", sizeof (ACPI_OBJECT_EVENT));
|
||||
AcpiOsPrintf ("Method %3d\n", sizeof (ACPI_OBJECT_METHOD));
|
||||
AcpiOsPrintf ("Mutex %3d\n", sizeof (ACPI_OBJECT_MUTEX));
|
||||
AcpiOsPrintf ("Region %3d\n", sizeof (ACPI_OBJECT_REGION));
|
||||
AcpiOsPrintf ("PowerResource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE));
|
||||
AcpiOsPrintf ("Processor %3d\n", sizeof (ACPI_OBJECT_PROCESSOR));
|
||||
AcpiOsPrintf ("ThermalZone %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE));
|
||||
AcpiOsPrintf ("Field %3d\n", sizeof (ACPI_OBJECT_FIELD));
|
||||
AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
|
||||
AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
|
||||
AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
|
||||
AcpiOsPrintf ("NotifyHandler %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
||||
AcpiOsPrintf ("AddrHandler %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJECT));
|
||||
AcpiOsPrintf ("Parse2Object %3d\n", sizeof (ACPI_PARSE2_OBJECT));
|
||||
AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT));
|
||||
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
@ -322,10 +361,10 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
void
|
||||
AcpiDbGenerateStatistics (
|
||||
ACPI_GENERIC_OP *Root,
|
||||
ACPI_PARSE_OBJECT *Root,
|
||||
BOOLEAN IsMethod)
|
||||
{
|
||||
ACPI_GENERIC_OP *Op;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
Op = AcpiPsGetChild (Root);
|
||||
@ -389,7 +428,7 @@ AcpiDbGenerateStatistics (
|
||||
|
||||
if (AcpiPsIsNamedOp (Op->Opcode))
|
||||
{
|
||||
NumNamedObjects++;
|
||||
NumNodes++;
|
||||
}
|
||||
|
||||
if (IsMethod)
|
||||
@ -402,10 +441,10 @@ AcpiDbGenerateStatistics (
|
||||
}
|
||||
|
||||
|
||||
SizeOfParseTree = (NumGrammarElements - NumMethodElements) * (UINT32) sizeof (ACPI_GENERIC_OP);
|
||||
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_GENERIC_OP);
|
||||
SizeOfNameTableEntries = NumNamedObjects * (UINT32) sizeof (ACPI_NAMED_OBJECT);
|
||||
SizeOfAcpiObjects = NumNamedObjects * (UINT32) sizeof (ACPI_OBJECT_INTERNAL);
|
||||
SizeOfParseTree = (NumGrammarElements - NumMethodElements) * (UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfNodeEntries = NumNodes * (UINT32) sizeof (ACPI_NAMESPACE_NODE);
|
||||
SizeOfAcpiObjects = NumNodes * (UINT32) sizeof (ACPI_OPERAND_OBJECT);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user