xref: /titanic_50/usr/src/uts/intel/io/acpica/utilities/uttrack.c (revision 67e3a03ed4a2813074d36330f062ed6e593a4937)
1 /******************************************************************************
2  *
3  * Module Name: uttrack - Memory allocation tracking routines (debug only)
4  *              $Revision: 1.3 $
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 
117 /*
118  * These procedures are used for tracking memory leaks in the subsystem, and
119  * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set.
120  *
121  * Each memory allocation is tracked via a doubly linked list.  Each
122  * element contains the caller's component, module name, function name, and
123  * line number.  AcpiUtAllocate and AcpiUtAllocateZeroed call
124  * AcpiUtTrackAllocation to add an element to the list; deletion
125  * occurs in the body of AcpiUtFree.
126  */
127 
128 #define __UTTRACK_C__
129 
130 #include "acpi.h"
131 
132 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
133 
134 #define _COMPONENT          ACPI_UTILITIES
135         ACPI_MODULE_NAME    ("uttrack")
136 
137 /* Local prototypes */
138 
139 static ACPI_DEBUG_MEM_BLOCK *
140 AcpiUtFindAllocation (
141     void                    *Allocation);
142 
143 static ACPI_STATUS
144 AcpiUtTrackAllocation (
145     ACPI_DEBUG_MEM_BLOCK    *Address,
146     ACPI_SIZE               Size,
147     UINT8                   AllocType,
148     UINT32                  Component,
149     char                    *Module,
150     UINT32                  Line);
151 
152 static ACPI_STATUS
153 AcpiUtRemoveAllocation (
154     ACPI_DEBUG_MEM_BLOCK    *Address,
155     UINT32                  Component,
156     char                    *Module,
157     UINT32                  Line);
158 
159 
160 /*******************************************************************************
161  *
162  * FUNCTION:    AcpiUtCreateList
163  *
164  * PARAMETERS:  CacheName       - Ascii name for the cache
165  *              ObjectSize      - Size of each cached object
166  *              ReturnCache     - Where the new cache object is returned
167  *
168  * RETURN:      Status
169  *
170  * DESCRIPTION: Create a local memory list for tracking purposed
171  *
172  ******************************************************************************/
173 
174 ACPI_STATUS
175 AcpiUtCreateList (
176     char                    *ListName,
177     UINT16                  ObjectSize,
178     ACPI_MEMORY_LIST        **ReturnCache)
179 {
180     ACPI_MEMORY_LIST        *Cache;
181 
182 
183     Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));
184     if (!Cache)
185     {
186         return (AE_NO_MEMORY);
187     }
188 
189     ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST));
190 
191     Cache->ListName   = ListName;
192     Cache->ObjectSize = ObjectSize;
193 
194     *ReturnCache = Cache;
195     return (AE_OK);
196 }
197 
198 
199 /*******************************************************************************
200  *
201  * FUNCTION:    AcpiUtAllocateAndTrack
202  *
203  * PARAMETERS:  Size                - Size of the allocation
204  *              Component           - Component type of caller
205  *              Module              - Source file name of caller
206  *              Line                - Line number of caller
207  *
208  * RETURN:      Address of the allocated memory on success, NULL on failure.
209  *
210  * DESCRIPTION: The subsystem's equivalent of malloc.
211  *
212  ******************************************************************************/
213 
214 void *
215 AcpiUtAllocateAndTrack (
216     ACPI_SIZE               Size,
217     UINT32                  Component,
218     char                    *Module,
219     UINT32                  Line)
220 {
221     ACPI_DEBUG_MEM_BLOCK    *Allocation;
222     ACPI_STATUS             Status;
223 
224 
225     Allocation = AcpiUtAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
226                     Component, Module, Line);
227     if (!Allocation)
228     {
229         return (NULL);
230     }
231 
232     Status = AcpiUtTrackAllocation (Allocation, Size,
233                     ACPI_MEM_MALLOC, Component, Module, Line);
234     if (ACPI_FAILURE (Status))
235     {
236         AcpiOsFree (Allocation);
237         return (NULL);
238     }
239 
240     AcpiGbl_GlobalList->TotalAllocated++;
241     AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
242 
243     return ((void *) &Allocation->UserSpace);
244 }
245 
246 
247 /*******************************************************************************
248  *
249  * FUNCTION:    AcpiUtAllocateZeroedAndTrack
250  *
251  * PARAMETERS:  Size                - Size of the allocation
252  *              Component           - Component type of caller
253  *              Module              - Source file name of caller
254  *              Line                - Line number of caller
255  *
256  * RETURN:      Address of the allocated memory on success, NULL on failure.
257  *
258  * DESCRIPTION: Subsystem equivalent of calloc.
259  *
260  ******************************************************************************/
261 
262 void *
263 AcpiUtAllocateZeroedAndTrack (
264     ACPI_SIZE               Size,
265     UINT32                  Component,
266     char                    *Module,
267     UINT32                  Line)
268 {
269     ACPI_DEBUG_MEM_BLOCK    *Allocation;
270     ACPI_STATUS             Status;
271 
272 
273     Allocation = AcpiUtAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
274                     Component, Module, Line);
275     if (!Allocation)
276     {
277         /* Report allocation error */
278 
279         ACPI_ERROR ((Module, Line,
280             "Could not allocate size %X", (UINT32) Size));
281         return (NULL);
282     }
283 
284     Status = AcpiUtTrackAllocation (Allocation, Size,
285                 ACPI_MEM_CALLOC, Component, Module, Line);
286     if (ACPI_FAILURE (Status))
287     {
288         AcpiOsFree (Allocation);
289         return (NULL);
290     }
291 
292     AcpiGbl_GlobalList->TotalAllocated++;
293     AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
294 
295     return ((void *) &Allocation->UserSpace);
296 }
297 
298 
299 /*******************************************************************************
300  *
301  * FUNCTION:    AcpiUtFreeAndTrack
302  *
303  * PARAMETERS:  Allocation          - Address of the memory to deallocate
304  *              Component           - Component type of caller
305  *              Module              - Source file name of caller
306  *              Line                - Line number of caller
307  *
308  * RETURN:      None
309  *
310  * DESCRIPTION: Frees the memory at Allocation
311  *
312  ******************************************************************************/
313 
314 void
315 AcpiUtFreeAndTrack (
316     void                    *Allocation,
317     UINT32                  Component,
318     char                    *Module,
319     UINT32                  Line)
320 {
321     ACPI_DEBUG_MEM_BLOCK    *DebugBlock;
322     ACPI_STATUS             Status;
323 
324 
325     ACPI_FUNCTION_TRACE_PTR (UtFree, Allocation);
326 
327 
328     if (NULL == Allocation)
329     {
330         ACPI_ERROR ((Module, Line,
331             "Attempt to delete a NULL address"));
332 
333         return_VOID;
334     }
335 
336     DebugBlock = ACPI_CAST_PTR (ACPI_DEBUG_MEM_BLOCK,
337                     (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
338 
339     AcpiGbl_GlobalList->TotalFreed++;
340     AcpiGbl_GlobalList->CurrentTotalSize -= DebugBlock->Size;
341 
342     Status = AcpiUtRemoveAllocation (DebugBlock,
343                     Component, Module, Line);
344     if (ACPI_FAILURE (Status))
345     {
346         ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory"));
347     }
348 
349     AcpiOsFree (DebugBlock);
350     ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Allocation));
351     return_VOID;
352 }
353 
354 
355 /*******************************************************************************
356  *
357  * FUNCTION:    AcpiUtFindAllocation
358  *
359  * PARAMETERS:  Allocation              - Address of allocated memory
360  *
361  * RETURN:      A list element if found; NULL otherwise.
362  *
363  * DESCRIPTION: Searches for an element in the global allocation tracking list.
364  *
365  ******************************************************************************/
366 
367 static ACPI_DEBUG_MEM_BLOCK *
368 AcpiUtFindAllocation (
369     void                    *Allocation)
370 {
371     ACPI_DEBUG_MEM_BLOCK    *Element;
372 
373 
374     ACPI_FUNCTION_ENTRY ();
375 
376 
377     Element = AcpiGbl_GlobalList->ListHead;
378 
379     /* Search for the address. */
380 
381     while (Element)
382     {
383         if (Element == Allocation)
384         {
385             return (Element);
386         }
387 
388         Element = Element->Next;
389     }
390 
391     return (NULL);
392 }
393 
394 
395 /*******************************************************************************
396  *
397  * FUNCTION:    AcpiUtTrackAllocation
398  *
399  * PARAMETERS:  Allocation          - Address of allocated memory
400  *              Size                - Size of the allocation
401  *              AllocType           - MEM_MALLOC or MEM_CALLOC
402  *              Component           - Component type of caller
403  *              Module              - Source file name of caller
404  *              Line                - Line number of caller
405  *
406  * RETURN:      None.
407  *
408  * DESCRIPTION: Inserts an element into the global allocation tracking list.
409  *
410  ******************************************************************************/
411 
412 static ACPI_STATUS
413 AcpiUtTrackAllocation (
414     ACPI_DEBUG_MEM_BLOCK    *Allocation,
415     ACPI_SIZE               Size,
416     UINT8                   AllocType,
417     UINT32                  Component,
418     char                    *Module,
419     UINT32                  Line)
420 {
421     ACPI_MEMORY_LIST        *MemList;
422     ACPI_DEBUG_MEM_BLOCK    *Element;
423     ACPI_STATUS             Status = AE_OK;
424 
425 
426     ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);
427 
428 
429     MemList = AcpiGbl_GlobalList;
430     Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
431     if (ACPI_FAILURE (Status))
432     {
433         return_ACPI_STATUS (Status);
434     }
435 
436     /*
437      * Search list for this address to make sure it is not already on the list.
438      * This will catch several kinds of problems.
439      */
440     Element = AcpiUtFindAllocation (Allocation);
441     if (Element)
442     {
443         ACPI_ERROR ((AE_INFO,
444             "UtTrackAllocation: Allocation already present in list! (%p)",
445             Allocation));
446 
447         ACPI_ERROR ((AE_INFO, "Element %p Address %p",
448             Element, Allocation));
449 
450         goto UnlockAndExit;
451     }
452 
453     /* Fill in the instance data. */
454 
455     Allocation->Size      = (UINT32) Size;
456     Allocation->AllocType = AllocType;
457     Allocation->Component = Component;
458     Allocation->Line      = Line;
459 
460     ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME);
461     Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0;
462 
463     /* Insert at list head */
464 
465     if (MemList->ListHead)
466     {
467         ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation;
468     }
469 
470     Allocation->Next = MemList->ListHead;
471     Allocation->Previous = NULL;
472 
473     MemList->ListHead = Allocation;
474 
475 
476 UnlockAndExit:
477     Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
478     return_ACPI_STATUS (Status);
479 }
480 
481 
482 /*******************************************************************************
483  *
484  * FUNCTION:    AcpiUtRemoveAllocation
485  *
486  * PARAMETERS:  Allocation          - Address of allocated memory
487  *              Component           - Component type of caller
488  *              Module              - Source file name of caller
489  *              Line                - Line number of caller
490  *
491  * RETURN:
492  *
493  * DESCRIPTION: Deletes an element from the global allocation tracking list.
494  *
495  ******************************************************************************/
496 
497 static ACPI_STATUS
498 AcpiUtRemoveAllocation (
499     ACPI_DEBUG_MEM_BLOCK    *Allocation,
500     UINT32                  Component,
501     char                    *Module,
502     UINT32                  Line)
503 {
504     ACPI_MEMORY_LIST        *MemList;
505     ACPI_STATUS             Status;
506 
507 
508     ACPI_FUNCTION_TRACE (UtRemoveAllocation);
509 
510 
511     MemList = AcpiGbl_GlobalList;
512     if (NULL == MemList->ListHead)
513     {
514         /* No allocations! */
515 
516         ACPI_ERROR ((Module, Line,
517             "Empty allocation list, nothing to free!"));
518 
519         return_ACPI_STATUS (AE_OK);
520     }
521 
522     Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
523     if (ACPI_FAILURE (Status))
524     {
525         return_ACPI_STATUS (Status);
526     }
527 
528     /* Unlink */
529 
530     if (Allocation->Previous)
531     {
532         (Allocation->Previous)->Next = Allocation->Next;
533     }
534     else
535     {
536         MemList->ListHead = Allocation->Next;
537     }
538 
539     if (Allocation->Next)
540     {
541         (Allocation->Next)->Previous = Allocation->Previous;
542     }
543 
544     /* Mark the segment as deleted */
545 
546     ACPI_MEMSET (&Allocation->UserSpace, 0xEA, Allocation->Size);
547 
548     ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
549         Allocation->Size));
550 
551     Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
552     return_ACPI_STATUS (Status);
553 }
554 
555 
556 /*******************************************************************************
557  *
558  * FUNCTION:    AcpiUtDumpAllocationInfo
559  *
560  * PARAMETERS:
561  *
562  * RETURN:      None
563  *
564  * DESCRIPTION: Print some info about the outstanding allocations.
565  *
566  ******************************************************************************/
567 
568 void
569 AcpiUtDumpAllocationInfo (
570     void)
571 {
572 /*
573     ACPI_MEMORY_LIST        *MemList;
574 */
575 
576     ACPI_FUNCTION_TRACE (UtDumpAllocationInfo);
577 
578 /*
579     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
580                     ("%30s: %4d (%3d Kb)\n", "Current allocations",
581                     MemList->CurrentCount,
582                     ROUND_UP_TO_1K (MemList->CurrentSize)));
583 
584     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
585                     ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
586                     MemList->MaxConcurrentCount,
587                     ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
588 
589 
590     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
591                     ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
592                     RunningObjectCount,
593                     ROUND_UP_TO_1K (RunningObjectSize)));
594 
595     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
596                     ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
597                     RunningAllocCount,
598                     ROUND_UP_TO_1K (RunningAllocSize)));
599 
600 
601     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
602                     ("%30s: %4d (%3d Kb)\n", "Current Nodes",
603                     AcpiGbl_CurrentNodeCount,
604                     ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
605 
606     ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
607                     ("%30s: %4d (%3d Kb)\n", "Max Nodes",
608                     AcpiGbl_MaxConcurrentNodeCount,
609                     ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
610                         sizeof (ACPI_NAMESPACE_NODE)))));
611 */
612     return_VOID;
613 }
614 
615 
616 /*******************************************************************************
617  *
618  * FUNCTION:    AcpiUtDumpAllocations
619  *
620  * PARAMETERS:  Component           - Component(s) to dump info for.
621  *              Module              - Module to dump info for.  NULL means all.
622  *
623  * RETURN:      None
624  *
625  * DESCRIPTION: Print a list of all outstanding allocations.
626  *
627  ******************************************************************************/
628 
629 void
630 AcpiUtDumpAllocations (
631     UINT32                  Component,
632     char                    *Module)
633 {
634     ACPI_DEBUG_MEM_BLOCK    *Element;
635     ACPI_DESCRIPTOR         *Descriptor;
636     UINT32                  NumOutstanding = 0;
637 
638 
639     ACPI_FUNCTION_TRACE (UtDumpAllocations);
640 
641 
642     /*
643      * Walk the allocation list.
644      */
645     if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY)))
646     {
647         return;
648     }
649 
650     Element = AcpiGbl_GlobalList->ListHead;
651     while (Element)
652     {
653         if ((Element->Component & Component) &&
654             ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module))))
655         {
656             /* Ignore allocated objects that are in a cache */
657 
658             Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace);
659             if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)
660             {
661                 AcpiOsPrintf ("%p Len %04X %9.9s-%d [%s] ",
662                     Descriptor, Element->Size, Element->Module,
663                     Element->Line, AcpiUtGetDescriptorName (Descriptor));
664 
665                 /* Most of the elements will be Operand objects. */
666 
667                 switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor))
668                 {
669                 case ACPI_DESC_TYPE_OPERAND:
670                     AcpiOsPrintf ("%12.12s R%hd",
671                         AcpiUtGetTypeName (Descriptor->Object.Common.Type),
672                         Descriptor->Object.Common.ReferenceCount);
673                     break;
674 
675                 case ACPI_DESC_TYPE_PARSER:
676                     AcpiOsPrintf ("AmlOpcode %04hX",
677                         Descriptor->Op.Asl.AmlOpcode);
678                     break;
679 
680                 case ACPI_DESC_TYPE_NAMED:
681                     AcpiOsPrintf ("%4.4s",
682                         AcpiUtGetNodeName (&Descriptor->Node));
683                     break;
684 
685                 default:
686                     break;
687                 }
688 
689                 AcpiOsPrintf ( "\n");
690                 NumOutstanding++;
691             }
692         }
693         Element = Element->Next;
694     }
695 
696     (void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
697 
698     /* Print summary */
699 
700     if (!NumOutstanding)
701     {
702         ACPI_INFO ((AE_INFO,
703             "No outstanding allocations"));
704     }
705     else
706     {
707         ACPI_ERROR ((AE_INFO,
708             "%d(%X) Outstanding allocations",
709             NumOutstanding, NumOutstanding));
710     }
711 
712     return_VOID;
713 }
714 
715 #endif  /* ACPI_DBG_TRACK_ALLOCATIONS */
716 
717