2000-10-28 05:01:06 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: dbstats - Generation and display of ACPI table statistics
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2011-01-13 16:12:34 +00:00
|
|
|
/*
|
2014-01-15 00:10:20 +00:00
|
|
|
* Copyright (C) 2000 - 2014, Intel Corp.
|
2000-12-21 06:56:46 +00:00
|
|
|
* All rights reserved.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
2011-01-13 16:12:34 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
|
|
|
* without modification.
|
|
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
|
|
* including a substantially similar Disclaimer requirement for further
|
|
|
|
* binary redistribution.
|
|
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
|
|
* of any contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
|
|
|
*
|
|
|
|
* NO WARRANTY
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
|
|
|
*/
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2009-06-01 19:24:26 +00:00
|
|
|
#include "acpi.h"
|
2009-06-01 21:02:40 +00:00
|
|
|
#include "accommon.h"
|
2009-06-01 19:24:26 +00:00
|
|
|
#include "acdebug.h"
|
|
|
|
#include "acnamesp.h"
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-08-29 01:51:24 +00:00
|
|
|
#ifdef ACPI_DEBUGGER
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-08-29 01:51:24 +00:00
|
|
|
#define _COMPONENT ACPI_CA_DEBUGGER
|
2002-02-23 05:10:40 +00:00
|
|
|
ACPI_MODULE_NAME ("dbstats")
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
/* Local prototypes */
|
|
|
|
|
|
|
|
static void
|
|
|
|
AcpiDbCountNamespaceObjects (
|
|
|
|
void);
|
|
|
|
|
|
|
|
static void
|
|
|
|
AcpiDbEnumerateObject (
|
|
|
|
ACPI_OPERAND_OBJECT *ObjDesc);
|
|
|
|
|
|
|
|
static ACPI_STATUS
|
|
|
|
AcpiDbClassifyOneObject (
|
|
|
|
ACPI_HANDLE ObjHandle,
|
|
|
|
UINT32 NestingLevel,
|
|
|
|
void *Context,
|
|
|
|
void **ReturnValue);
|
|
|
|
|
2007-03-22 17:36:29 +00:00
|
|
|
#if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
|
2005-11-01 22:11:18 +00:00
|
|
|
static void
|
|
|
|
AcpiDbListInfo (
|
|
|
|
ACPI_MEMORY_LIST *List);
|
2007-03-22 17:36:29 +00:00
|
|
|
#endif
|
2005-11-01 22:11:18 +00:00
|
|
|
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/*
|
|
|
|
* Statistics subcommands
|
|
|
|
*/
|
2012-09-14 22:53:11 +00:00
|
|
|
static ACPI_DB_ARGUMENT_INFO AcpiDbStatTypes [] =
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
{"ALLOCATIONS"},
|
|
|
|
{"OBJECTS"},
|
|
|
|
{"MEMORY"},
|
|
|
|
{"MISC"},
|
|
|
|
{"TABLES"},
|
|
|
|
{"SIZES"},
|
2001-09-07 01:22:25 +00:00
|
|
|
{"STACK"},
|
2000-10-28 05:01:06 +00:00
|
|
|
{NULL} /* Must be null terminated */
|
|
|
|
};
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
#define CMD_STAT_ALLOCATIONS 0
|
|
|
|
#define CMD_STAT_OBJECTS 1
|
|
|
|
#define CMD_STAT_MEMORY 2
|
|
|
|
#define CMD_STAT_MISC 3
|
|
|
|
#define CMD_STAT_TABLES 4
|
|
|
|
#define CMD_STAT_SIZES 5
|
|
|
|
#define CMD_STAT_STACK 6
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
#if defined ACPI_DBG_TRACK_ALLOCATIONS || defined ACPI_USE_LOCAL_CACHE
|
2005-11-01 22:11:18 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDbListInfo
|
|
|
|
*
|
|
|
|
* PARAMETERS: List - Memory list/cache to be displayed
|
|
|
|
*
|
|
|
|
* RETURN: None
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Display information about the input memory list or cache.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
AcpiDbListInfo (
|
|
|
|
ACPI_MEMORY_LIST *List)
|
|
|
|
{
|
|
|
|
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
|
|
|
UINT32 Outstanding;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n%s\n", List->ListName);
|
|
|
|
|
|
|
|
/* MaxDepth > 0 indicates a cache object */
|
|
|
|
|
|
|
|
if (List->MaxDepth > 0)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf (
|
2007-03-22 17:24:05 +00:00
|
|
|
" Cache: [Depth MaxD Avail Size] %8.2X %8.2X %8.2X %8.2X\n",
|
2005-11-01 22:11:18 +00:00
|
|
|
List->CurrentDepth,
|
|
|
|
List->MaxDepth,
|
|
|
|
List->MaxDepth - List->CurrentDepth,
|
|
|
|
(List->CurrentDepth * List->ObjectSize));
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
|
|
|
if (List->MaxDepth > 0)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf (
|
2007-03-22 17:24:05 +00:00
|
|
|
" Cache: [Requests Hits Misses ObjSize] %8.2X %8.2X %8.2X %8.2X\n",
|
2005-11-01 22:11:18 +00:00
|
|
|
List->Requests,
|
|
|
|
List->Hits,
|
|
|
|
List->Requests - List->Hits,
|
|
|
|
List->ObjectSize);
|
|
|
|
}
|
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
Outstanding = AcpiDbGetCacheInfo (List);
|
2005-11-01 22:11:18 +00:00
|
|
|
|
|
|
|
if (List->ObjectSize)
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiOsPrintf (
|
|
|
|
" Mem: [Alloc Free Max CurSize Outstanding] %8.2X %8.2X %8.2X %8.2X %8.2X\n",
|
|
|
|
List->TotalAllocated,
|
|
|
|
List->TotalFreed,
|
|
|
|
List->MaxOccupied,
|
|
|
|
Outstanding * List->ObjectSize,
|
|
|
|
Outstanding);
|
2005-11-01 22:11:18 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiOsPrintf (
|
|
|
|
" Mem: [Alloc Free Max CurSize Outstanding Total] %8.2X %8.2X %8.2X %8.2X %8.2X %8.2X\n",
|
|
|
|
List->TotalAllocated,
|
|
|
|
List->TotalFreed,
|
|
|
|
List->MaxOccupied,
|
|
|
|
List->CurrentTotalSize,
|
|
|
|
Outstanding,
|
|
|
|
List->TotalSize);
|
2005-11-01 22:11:18 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
2007-03-22 17:24:05 +00:00
|
|
|
#endif
|
2005-11-01 22:11:18 +00:00
|
|
|
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDbEnumerateObject
|
|
|
|
*
|
|
|
|
* PARAMETERS: ObjDesc - Object to be counted
|
|
|
|
*
|
|
|
|
* RETURN: None
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Add this object to the global counts, by object type.
|
2002-02-23 05:10:40 +00:00
|
|
|
* Limited recursion handles subobjects and packages, and this
|
|
|
|
* is probably acceptable within the AML debugger only.
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
static void
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiDbEnumerateObject (
|
|
|
|
ACPI_OPERAND_OBJECT *ObjDesc)
|
|
|
|
{
|
|
|
|
UINT32 i;
|
|
|
|
|
|
|
|
|
|
|
|
if (!ObjDesc)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Enumerate this object first */
|
|
|
|
|
2001-09-07 01:22:25 +00:00
|
|
|
AcpiGbl_NumObjects++;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
AcpiGbl_ObjTypeCountMisc++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiGbl_ObjTypeCount [ObjDesc->Common.Type]++;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Count the sub-objects */
|
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
switch (ObjDesc->Common.Type)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
case ACPI_TYPE_PACKAGE:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
for (i = 0; i < ObjDesc->Package.Count; i++)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
AcpiDbEnumerateObject (ObjDesc->Package.Elements[i]);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_DEVICE:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2012-04-20 23:39:48 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->Device.NotifyList[0]);
|
|
|
|
AcpiDbEnumerateObject (ObjDesc->Device.NotifyList[1]);
|
2003-12-09 02:45:16 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->Device.Handler);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2001-11-28 04:29:40 +00:00
|
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2002-02-23 05:10:40 +00:00
|
|
|
if (AcpiNsGetSecondaryObject (ObjDesc))
|
2001-11-28 04:29:40 +00:00
|
|
|
{
|
2002-02-23 05:10:40 +00:00
|
|
|
AcpiGbl_ObjTypeCount [ACPI_TYPE_BUFFER_FIELD]++;
|
2001-11-28 04:29:40 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
case ACPI_TYPE_REGION:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
|
|
|
AcpiGbl_ObjTypeCount [ACPI_TYPE_LOCAL_REGION_FIELD ]++;
|
2003-12-09 02:45:16 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->Region.Handler);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_POWER:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2012-04-20 23:39:48 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->PowerResource.NotifyList[0]);
|
|
|
|
AcpiDbEnumerateObject (ObjDesc->PowerResource.NotifyList[1]);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_PROCESSOR:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2012-04-20 23:39:48 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->Processor.NotifyList[0]);
|
|
|
|
AcpiDbEnumerateObject (ObjDesc->Processor.NotifyList[1]);
|
2003-12-09 02:45:16 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->Processor.Handler);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_TYPE_THERMAL:
|
2002-11-27 18:07:48 +00:00
|
|
|
|
2012-04-20 23:39:48 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->ThermalZone.NotifyList[0]);
|
|
|
|
AcpiDbEnumerateObject (ObjDesc->ThermalZone.NotifyList[1]);
|
2003-12-09 02:45:16 +00:00
|
|
|
AcpiDbEnumerateObject (ObjDesc->ThermalZone.Handler);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
2002-07-09 17:51:31 +00:00
|
|
|
|
|
|
|
default:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDbClassifyOneObject
|
|
|
|
*
|
|
|
|
* PARAMETERS: Callback for WalkNamespace
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Enumerate both the object descriptor (including subobjects) and
|
|
|
|
* the parent namespace node.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
static ACPI_STATUS
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiDbClassifyOneObject (
|
|
|
|
ACPI_HANDLE ObjHandle,
|
|
|
|
UINT32 NestingLevel,
|
|
|
|
void *Context,
|
|
|
|
void **ReturnValue)
|
|
|
|
{
|
|
|
|
ACPI_NAMESPACE_NODE *Node;
|
|
|
|
ACPI_OPERAND_OBJECT *ObjDesc;
|
|
|
|
UINT32 Type;
|
|
|
|
|
|
|
|
|
2001-09-07 01:22:25 +00:00
|
|
|
AcpiGbl_NumNodes++;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
2001-11-28 04:29:40 +00:00
|
|
|
ObjDesc = AcpiNsGetAttachedObject (Node);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiDbEnumerateObject (ObjDesc);
|
|
|
|
|
|
|
|
Type = Node->Type;
|
2002-11-27 18:07:48 +00:00
|
|
|
if (Type > ACPI_TYPE_NS_NODE_MAX)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
AcpiGbl_NodeTypeCountMisc++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AcpiGbl_NodeTypeCount [Type]++;
|
|
|
|
}
|
|
|
|
|
2012-10-19 18:47:57 +00:00
|
|
|
return (AE_OK);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
#ifdef ACPI_FUTURE_IMPLEMENTATION
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
/* TBD: These need to be counted during the initial parsing phase */
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
if (AcpiPsIsNamedOp (Op->Opcode))
|
|
|
|
{
|
|
|
|
NumNodes++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsMethod)
|
|
|
|
{
|
|
|
|
NumMethodElements++;
|
|
|
|
}
|
|
|
|
|
|
|
|
NumGrammarElements++;
|
|
|
|
Op = AcpiPsGetDepthNext (Root, Op);
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
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);
|
|
|
|
#endif
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDbCountNamespaceObjects
|
|
|
|
*
|
|
|
|
* PARAMETERS: None
|
|
|
|
*
|
2005-11-01 22:11:18 +00:00
|
|
|
* RETURN: None
|
2000-10-28 05:01:06 +00:00
|
|
|
*
|
|
|
|
* DESCRIPTION: Count and classify the entire namespace, including all
|
|
|
|
* namespace nodes and attached objects.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
static void
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiDbCountNamespaceObjects (
|
|
|
|
void)
|
|
|
|
{
|
|
|
|
UINT32 i;
|
|
|
|
|
|
|
|
|
2001-09-07 01:22:25 +00:00
|
|
|
AcpiGbl_NumNodes = 0;
|
|
|
|
AcpiGbl_NumObjects = 0;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiGbl_ObjTypeCountMisc = 0;
|
2002-11-27 18:07:48 +00:00
|
|
|
for (i = 0; i < (ACPI_TYPE_NS_NODE_MAX -1); i++)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
AcpiGbl_ObjTypeCount [i] = 0;
|
|
|
|
AcpiGbl_NodeTypeCount [i] = 0;
|
|
|
|
}
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
2009-11-16 18:28:41 +00:00
|
|
|
ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: AcpiDbDisplayStatistics
|
|
|
|
*
|
|
|
|
* PARAMETERS: TypeArg - Subcommand
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Display various statistics
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
ACPI_STATUS
|
|
|
|
AcpiDbDisplayStatistics (
|
2003-04-29 18:39:29 +00:00
|
|
|
char *TypeArg)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
UINT32 i;
|
2005-11-01 22:11:18 +00:00
|
|
|
UINT32 Temp;
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiUtStrupr (TypeArg);
|
|
|
|
Temp = AcpiDbMatchArgument (TypeArg, AcpiDbStatTypes);
|
2014-01-15 00:10:20 +00:00
|
|
|
if (Temp == ACPI_TYPE_NOT_FOUND)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
|
|
|
AcpiOsPrintf ("Invalid or unsupported argument\n");
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
switch (Temp)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_ALLOCATIONS:
|
2005-11-01 22:11:18 +00:00
|
|
|
|
2001-07-21 03:55:17 +00:00
|
|
|
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
2001-05-29 19:52:40 +00:00
|
|
|
AcpiUtDumpAllocationInfo ();
|
2001-07-21 03:55:17 +00:00
|
|
|
#endif
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_TABLES:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2007-03-22 17:24:05 +00:00
|
|
|
AcpiOsPrintf ("ACPI Table Information (not implemented):\n\n");
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_OBJECTS:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-09-07 01:22:25 +00:00
|
|
|
AcpiDbCountNamespaceObjects ();
|
|
|
|
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiOsPrintf ("\nObjects defined in the current namespace:\n\n");
|
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiOsPrintf ("%16.16s %10.10s %10.10s\n",
|
|
|
|
"ACPI_TYPE", "NODES", "OBJECTS");
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2002-11-27 18:07:48 +00:00
|
|
|
for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2001-05-29 19:52:40 +00:00
|
|
|
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
|
|
|
|
}
|
|
|
|
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
|
|
|
|
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);
|
|
|
|
|
|
|
|
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
|
2001-09-07 01:22:25 +00:00
|
|
|
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_MEMORY:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2001-08-26 22:28:18 +00:00
|
|
|
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
2007-03-22 17:36:29 +00:00
|
|
|
AcpiOsPrintf ("\n----Object Statistics (all in hex)---------\n");
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiDbListInfo (AcpiGbl_GlobalList);
|
|
|
|
AcpiDbListInfo (AcpiGbl_NsNodeList);
|
2007-03-22 17:36:29 +00:00
|
|
|
#endif
|
2005-11-01 22:11:18 +00:00
|
|
|
|
|
|
|
#ifdef ACPI_USE_LOCAL_CACHE
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiOsPrintf ("\n----Cache Statistics (all in hex)---------\n");
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiDbListInfo (AcpiGbl_OperandCache);
|
|
|
|
AcpiDbListInfo (AcpiGbl_PsNodeCache);
|
|
|
|
AcpiDbListInfo (AcpiGbl_PsNodeExtCache);
|
|
|
|
AcpiDbListInfo (AcpiGbl_StateCache);
|
2001-08-26 22:28:18 +00:00
|
|
|
#endif
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_MISC:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
|
|
|
|
AcpiGbl_PsFindCount);
|
|
|
|
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
|
|
|
|
AcpiGbl_NsLookupCount);
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
|
|
|
|
AcpiOsPrintf ("Mutex usage:\n\n");
|
2007-03-22 17:24:05 +00:00
|
|
|
for (i = 0; i < ACPI_NUM_MUTEX; i++)
|
2000-10-28 05:01:06 +00:00
|
|
|
{
|
2005-11-01 22:11:18 +00:00
|
|
|
AcpiOsPrintf ("%-28s: % 7ld\n",
|
|
|
|
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_SIZES:
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\nInternal object sizes:\n\n");
|
|
|
|
|
|
|
|
AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON));
|
2001-01-31 09:17:50 +00:00
|
|
|
AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_INTEGER));
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING));
|
|
|
|
AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER));
|
|
|
|
AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
|
2001-05-29 19:52:40 +00:00
|
|
|
AcpiOsPrintf ("BufferField %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD));
|
2000-10-28 05:01:06 +00:00
|
|
|
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));
|
2001-05-29 19:52:40 +00:00
|
|
|
AcpiOsPrintf ("RegionField %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD));
|
2000-10-28 05:01:06 +00:00
|
|
|
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));
|
2003-07-13 22:44:13 +00:00
|
|
|
AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
|
|
|
AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA));
|
2001-11-28 04:29:40 +00:00
|
|
|
AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON));
|
|
|
|
AcpiOsPrintf ("ParseObjectNamed %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED));
|
|
|
|
AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL));
|
2000-10-28 05:01:06 +00:00
|
|
|
AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT));
|
|
|
|
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
|
2000-10-28 05:01:06 +00:00
|
|
|
|
2012-04-20 23:39:48 +00:00
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
|
|
|
|
AcpiOsPrintf ("Generic State %3d\n", sizeof (ACPI_GENERIC_STATE));
|
|
|
|
AcpiOsPrintf ("Common State %3d\n", sizeof (ACPI_COMMON_STATE));
|
|
|
|
AcpiOsPrintf ("Control State %3d\n", sizeof (ACPI_CONTROL_STATE));
|
|
|
|
AcpiOsPrintf ("Update State %3d\n", sizeof (ACPI_UPDATE_STATE));
|
|
|
|
AcpiOsPrintf ("Scope State %3d\n", sizeof (ACPI_SCOPE_STATE));
|
|
|
|
AcpiOsPrintf ("Parse Scope %3d\n", sizeof (ACPI_PSCOPE_STATE));
|
|
|
|
AcpiOsPrintf ("Package State %3d\n", sizeof (ACPI_PKG_STATE));
|
|
|
|
AcpiOsPrintf ("Thread State %3d\n", sizeof (ACPI_THREAD_STATE));
|
|
|
|
AcpiOsPrintf ("Result Values %3d\n", sizeof (ACPI_RESULT_VALUES));
|
|
|
|
AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO));
|
2000-10-28 05:01:06 +00:00
|
|
|
break;
|
|
|
|
|
2002-07-09 17:51:31 +00:00
|
|
|
case CMD_STAT_STACK:
|
2002-08-29 01:51:24 +00:00
|
|
|
#if defined(ACPI_DEBUG_OUTPUT)
|
2001-09-07 01:22:25 +00:00
|
|
|
|
2009-06-01 21:02:40 +00:00
|
|
|
Temp = (UINT32) ACPI_PTR_DIFF (AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer);
|
2001-09-07 01:22:25 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n");
|
2009-06-01 21:02:40 +00:00
|
|
|
AcpiOsPrintf ("Entry Stack Pointer %p\n", AcpiGbl_EntryStackPointer);
|
|
|
|
AcpiOsPrintf ("Lowest Stack Pointer %p\n", AcpiGbl_LowestStackPointer);
|
|
|
|
AcpiOsPrintf ("Stack Use %X (%u)\n", Temp, Temp);
|
|
|
|
AcpiOsPrintf ("Deepest Procedure Nesting %u\n", AcpiGbl_DeepestNesting);
|
2002-07-09 17:51:31 +00:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-05-17 23:13:40 +00:00
|
|
|
|
2001-09-07 01:22:25 +00:00
|
|
|
break;
|
2000-10-28 05:01:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
2002-08-29 01:51:24 +00:00
|
|
|
#endif /* ACPI_DEBUGGER */
|