1 /******************************************************************************
3 * Module Name: uttrack - Memory allocation tracking routines (debug only)
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
153 * These procedures are used for tracking memory leaks in the subsystem, and
154 * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set.
156 * Each memory allocation is tracked via a doubly linked list. Each
157 * element contains the caller's component, module name, function name, and
158 * line number. AcpiUtAllocate and AcpiUtAllocateZeroed call
159 * AcpiUtTrackAllocation to add an element to the list; deletion
160 * occurs in the body of AcpiUtFree.
163 #include <contrib/dev/acpica/include/acpi.h>
164 #include <contrib/dev/acpica/include/accommon.h>
166 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
168 #define _COMPONENT ACPI_UTILITIES
169 ACPI_MODULE_NAME ("uttrack")
172 /* Local prototypes */
174 static ACPI_DEBUG_MEM_BLOCK *
175 AcpiUtFindAllocation (
176 ACPI_DEBUG_MEM_BLOCK *Allocation);
179 AcpiUtTrackAllocation (
180 ACPI_DEBUG_MEM_BLOCK *Address,
188 AcpiUtRemoveAllocation (
189 ACPI_DEBUG_MEM_BLOCK *Address,
195 /*******************************************************************************
197 * FUNCTION: AcpiUtCreateList
199 * PARAMETERS: CacheName - Ascii name for the cache
200 * ObjectSize - Size of each cached object
201 * ReturnCache - Where the new cache object is returned
205 * DESCRIPTION: Create a local memory list for tracking purposed
207 ******************************************************************************/
211 const char *ListName,
213 ACPI_MEMORY_LIST **ReturnCache)
215 ACPI_MEMORY_LIST *Cache;
218 Cache = AcpiOsAllocateZeroed (sizeof (ACPI_MEMORY_LIST));
221 return (AE_NO_MEMORY);
224 Cache->ListName = ListName;
225 Cache->ObjectSize = ObjectSize;
227 *ReturnCache = Cache;
232 /*******************************************************************************
234 * FUNCTION: AcpiUtAllocateAndTrack
236 * PARAMETERS: Size - Size of the allocation
237 * Component - Component type of caller
238 * Module - Source file name of caller
239 * Line - Line number of caller
241 * RETURN: Address of the allocated memory on success, NULL on failure.
243 * DESCRIPTION: The subsystem's equivalent of malloc.
245 ******************************************************************************/
248 AcpiUtAllocateAndTrack (
254 ACPI_DEBUG_MEM_BLOCK *Allocation;
258 /* Check for an inadvertent size of zero bytes */
262 ACPI_WARNING ((Module, Line,
263 "Attempt to allocate zero bytes, allocating 1 byte"));
267 Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
270 /* Report allocation error */
272 ACPI_WARNING ((Module, Line,
273 "Could not allocate size %u", (UINT32) Size));
278 Status = AcpiUtTrackAllocation (
279 Allocation, Size, ACPI_MEM_MALLOC, Component, Module, Line);
280 if (ACPI_FAILURE (Status))
282 AcpiOsFree (Allocation);
286 AcpiGbl_GlobalList->TotalAllocated++;
287 AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
288 AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
290 if (AcpiGbl_GlobalList->CurrentTotalSize >
291 AcpiGbl_GlobalList->MaxOccupied)
293 AcpiGbl_GlobalList->MaxOccupied =
294 AcpiGbl_GlobalList->CurrentTotalSize;
297 return ((void *) &Allocation->UserSpace);
301 /*******************************************************************************
303 * FUNCTION: AcpiUtAllocateZeroedAndTrack
305 * PARAMETERS: Size - Size of the allocation
306 * Component - Component type of caller
307 * Module - Source file name of caller
308 * Line - Line number of caller
310 * RETURN: Address of the allocated memory on success, NULL on failure.
312 * DESCRIPTION: Subsystem equivalent of calloc.
314 ******************************************************************************/
317 AcpiUtAllocateZeroedAndTrack (
323 ACPI_DEBUG_MEM_BLOCK *Allocation;
327 /* Check for an inadvertent size of zero bytes */
331 ACPI_WARNING ((Module, Line,
332 "Attempt to allocate zero bytes, allocating 1 byte"));
336 Allocation = AcpiOsAllocateZeroed (
337 Size + sizeof (ACPI_DEBUG_MEM_HEADER));
340 /* Report allocation error */
342 ACPI_ERROR ((Module, Line,
343 "Could not allocate size %u", (UINT32) Size));
347 Status = AcpiUtTrackAllocation (Allocation, Size,
348 ACPI_MEM_CALLOC, Component, Module, Line);
349 if (ACPI_FAILURE (Status))
351 AcpiOsFree (Allocation);
355 AcpiGbl_GlobalList->TotalAllocated++;
356 AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
357 AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
359 if (AcpiGbl_GlobalList->CurrentTotalSize >
360 AcpiGbl_GlobalList->MaxOccupied)
362 AcpiGbl_GlobalList->MaxOccupied =
363 AcpiGbl_GlobalList->CurrentTotalSize;
366 return ((void *) &Allocation->UserSpace);
370 /*******************************************************************************
372 * FUNCTION: AcpiUtFreeAndTrack
374 * PARAMETERS: Allocation - Address of the memory to deallocate
375 * Component - Component type of caller
376 * Module - Source file name of caller
377 * Line - Line number of caller
381 * DESCRIPTION: Frees the memory at Allocation
383 ******************************************************************************/
392 ACPI_DEBUG_MEM_BLOCK *DebugBlock;
396 ACPI_FUNCTION_TRACE_PTR (UtFree, Allocation);
399 if (NULL == Allocation)
401 ACPI_ERROR ((Module, Line,
402 "Attempt to delete a NULL address"));
407 DebugBlock = ACPI_CAST_PTR (ACPI_DEBUG_MEM_BLOCK,
408 (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
410 AcpiGbl_GlobalList->TotalFreed++;
411 AcpiGbl_GlobalList->CurrentTotalSize -= DebugBlock->Size;
413 Status = AcpiUtRemoveAllocation (DebugBlock, Component, Module, Line);
414 if (ACPI_FAILURE (Status))
416 ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory"));
419 AcpiOsFree (DebugBlock);
420 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n",
421 Allocation, DebugBlock));
426 /*******************************************************************************
428 * FUNCTION: AcpiUtFindAllocation
430 * PARAMETERS: Allocation - Address of allocated memory
432 * RETURN: Three cases:
433 * 1) List is empty, NULL is returned.
434 * 2) Element was found. Returns Allocation parameter.
435 * 3) Element was not found. Returns position where it should be
436 * inserted into the list.
438 * DESCRIPTION: Searches for an element in the global allocation tracking list.
439 * If the element is not found, returns the location within the
440 * list where the element should be inserted.
442 * Note: The list is ordered by larger-to-smaller addresses.
444 * This global list is used to detect memory leaks in ACPICA as
445 * well as other issues such as an attempt to release the same
446 * internal object more than once. Although expensive as far
447 * as cpu time, this list is much more helpful for finding these
448 * types of issues than using memory leak detectors outside of
451 ******************************************************************************/
453 static ACPI_DEBUG_MEM_BLOCK *
454 AcpiUtFindAllocation (
455 ACPI_DEBUG_MEM_BLOCK *Allocation)
457 ACPI_DEBUG_MEM_BLOCK *Element;
460 Element = AcpiGbl_GlobalList->ListHead;
467 * Search for the address.
469 * Note: List is ordered by larger-to-smaller addresses, on the
470 * assumption that a new allocation usually has a larger address
471 * than previous allocations.
473 while (Element > Allocation)
475 /* Check for end-of-list */
482 Element = Element->Next;
485 if (Element == Allocation)
490 return (Element->Previous);
494 /*******************************************************************************
496 * FUNCTION: AcpiUtTrackAllocation
498 * PARAMETERS: Allocation - Address of allocated memory
499 * Size - Size of the allocation
500 * AllocType - MEM_MALLOC or MEM_CALLOC
501 * Component - Component type of caller
502 * Module - Source file name of caller
503 * Line - Line number of caller
507 * DESCRIPTION: Inserts an element into the global allocation tracking list.
509 ******************************************************************************/
512 AcpiUtTrackAllocation (
513 ACPI_DEBUG_MEM_BLOCK *Allocation,
520 ACPI_MEMORY_LIST *MemList;
521 ACPI_DEBUG_MEM_BLOCK *Element;
522 ACPI_STATUS Status = AE_OK;
525 ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);
528 if (AcpiGbl_DisableMemTracking)
530 return_ACPI_STATUS (AE_OK);
533 MemList = AcpiGbl_GlobalList;
534 Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
535 if (ACPI_FAILURE (Status))
537 return_ACPI_STATUS (Status);
541 * Search the global list for this address to make sure it is not
542 * already present. This will catch several kinds of problems.
544 Element = AcpiUtFindAllocation (Allocation);
545 if (Element == Allocation)
547 ACPI_ERROR ((AE_INFO,
548 "UtTrackAllocation: Allocation (%p) already present in global list!",
553 /* Fill in the instance data */
555 Allocation->Size = (UINT32) Size;
556 Allocation->AllocType = AllocType;
557 Allocation->Component = Component;
558 Allocation->Line = Line;
560 AcpiUtSafeStrncpy (Allocation->Module, (char *) Module, ACPI_MAX_MODULE_NAME);
564 /* Insert at list head */
566 if (MemList->ListHead)
568 ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous =
572 Allocation->Next = MemList->ListHead;
573 Allocation->Previous = NULL;
575 MemList->ListHead = Allocation;
579 /* Insert after element */
581 Allocation->Next = Element->Next;
582 Allocation->Previous = Element;
586 (Element->Next)->Previous = Allocation;
589 Element->Next = Allocation;
594 Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
595 return_ACPI_STATUS (Status);
599 /*******************************************************************************
601 * FUNCTION: AcpiUtRemoveAllocation
603 * PARAMETERS: Allocation - Address of allocated memory
604 * Component - Component type of caller
605 * Module - Source file name of caller
606 * Line - Line number of caller
610 * DESCRIPTION: Deletes an element from the global allocation tracking list.
612 ******************************************************************************/
615 AcpiUtRemoveAllocation (
616 ACPI_DEBUG_MEM_BLOCK *Allocation,
621 ACPI_MEMORY_LIST *MemList;
625 ACPI_FUNCTION_NAME (UtRemoveAllocation);
628 if (AcpiGbl_DisableMemTracking)
633 MemList = AcpiGbl_GlobalList;
634 if (NULL == MemList->ListHead)
636 /* No allocations! */
638 ACPI_ERROR ((Module, Line,
639 "Empty allocation list, nothing to free!"));
644 Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
645 if (ACPI_FAILURE (Status))
652 if (Allocation->Previous)
654 (Allocation->Previous)->Next = Allocation->Next;
658 MemList->ListHead = Allocation->Next;
661 if (Allocation->Next)
663 (Allocation->Next)->Previous = Allocation->Previous;
666 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n",
667 &Allocation->UserSpace, Allocation->Size));
669 /* Mark the segment as deleted */
671 memset (&Allocation->UserSpace, 0xEA, Allocation->Size);
673 Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
678 /*******************************************************************************
680 * FUNCTION: AcpiUtDumpAllocationInfo
686 * DESCRIPTION: Print some info about the outstanding allocations.
688 ******************************************************************************/
691 AcpiUtDumpAllocationInfo (
695 ACPI_MEMORY_LIST *MemList;
698 ACPI_FUNCTION_TRACE (UtDumpAllocationInfo);
701 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
702 ("%30s: %4d (%3d Kb)\n", "Current allocations",
703 MemList->CurrentCount,
704 ROUND_UP_TO_1K (MemList->CurrentSize)));
706 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
707 ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
708 MemList->MaxConcurrentCount,
709 ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
712 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
713 ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
715 ROUND_UP_TO_1K (RunningObjectSize)));
717 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
718 ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
720 ROUND_UP_TO_1K (RunningAllocSize)));
723 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
724 ("%30s: %4d (%3d Kb)\n", "Current Nodes",
725 AcpiGbl_CurrentNodeCount,
726 ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
728 ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
729 ("%30s: %4d (%3d Kb)\n", "Max Nodes",
730 AcpiGbl_MaxConcurrentNodeCount,
731 ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
732 sizeof (ACPI_NAMESPACE_NODE)))));
738 /*******************************************************************************
740 * FUNCTION: AcpiUtDumpAllocations
742 * PARAMETERS: Component - Component(s) to dump info for.
743 * Module - Module to dump info for. NULL means all.
747 * DESCRIPTION: Print a list of all outstanding allocations.
749 ******************************************************************************/
752 AcpiUtDumpAllocations (
756 ACPI_DEBUG_MEM_BLOCK *Element;
757 ACPI_DESCRIPTOR *Descriptor;
758 UINT32 NumOutstanding = 0;
759 UINT8 DescriptorType;
762 ACPI_FUNCTION_TRACE (UtDumpAllocations);
765 if (AcpiGbl_DisableMemTracking)
771 * Walk the allocation list.
773 if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY)))
778 if (!AcpiGbl_GlobalList)
783 Element = AcpiGbl_GlobalList->ListHead;
786 if ((Element->Component & Component) &&
787 ((Module == NULL) || (0 == strcmp (Module, Element->Module))))
789 Descriptor = ACPI_CAST_PTR (
790 ACPI_DESCRIPTOR, &Element->UserSpace);
792 if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
794 AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u "
795 "[Not a Descriptor - too small]\n",
796 Descriptor, Element->Size, Element->Module,
801 /* Ignore allocated objects that are in a cache */
803 if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
804 ACPI_DESC_TYPE_CACHED)
806 AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u [%s] ",
807 Descriptor, Element->Size, Element->Module,
808 Element->Line, AcpiUtGetDescriptorName (Descriptor));
810 /* Optional object hex dump */
812 if (AcpiGbl_VerboseLeakDump)
815 AcpiUtDumpBuffer ((UINT8 *) Descriptor, Element->Size,
819 /* Validate the descriptor type using Type field and length */
821 DescriptorType = 0; /* Not a valid descriptor type */
823 switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor))
825 case ACPI_DESC_TYPE_OPERAND:
827 if (Element->Size == sizeof (ACPI_OPERAND_OBJECT))
829 DescriptorType = ACPI_DESC_TYPE_OPERAND;
833 case ACPI_DESC_TYPE_PARSER:
835 if (Element->Size == sizeof (ACPI_PARSE_OBJECT))
837 DescriptorType = ACPI_DESC_TYPE_PARSER;
841 case ACPI_DESC_TYPE_NAMED:
843 if (Element->Size == sizeof (ACPI_NAMESPACE_NODE))
845 DescriptorType = ACPI_DESC_TYPE_NAMED;
854 /* Display additional info for the major descriptor types */
856 switch (DescriptorType)
858 case ACPI_DESC_TYPE_OPERAND:
860 AcpiOsPrintf ("%12.12s RefCount 0x%04X\n",
861 AcpiUtGetTypeName (Descriptor->Object.Common.Type),
862 Descriptor->Object.Common.ReferenceCount);
865 case ACPI_DESC_TYPE_PARSER:
867 AcpiOsPrintf ("AmlOpcode 0x%04X\n",
868 Descriptor->Op.Asl.AmlOpcode);
871 case ACPI_DESC_TYPE_NAMED:
873 AcpiOsPrintf ("%4.4s\n",
874 AcpiUtGetNodeName (&Descriptor->Node));
879 AcpiOsPrintf ( "\n");
888 Element = Element->Next;
892 (void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
898 ACPI_INFO (("No outstanding allocations"));
902 ACPI_ERROR ((AE_INFO, "%u (0x%X) Outstanding cache allocations",
903 NumOutstanding, NumOutstanding));
909 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */