uttrack.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /******************************************************************************
  2. *
  3. * Module Name: uttrack - Memory allocation tracking routines (debug only)
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2016, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. /*
  43. * These procedures are used for tracking memory leaks in the subsystem, and
  44. * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set.
  45. *
  46. * Each memory allocation is tracked via a doubly linked list. Each
  47. * element contains the caller's component, module name, function name, and
  48. * line number. acpi_ut_allocate and acpi_ut_allocate_zeroed call
  49. * acpi_ut_track_allocation to add an element to the list; deletion
  50. * occurs in the body of acpi_ut_free.
  51. */
  52. #include <acpi/acpi.h>
  53. #include "accommon.h"
  54. #ifdef ACPI_DBG_TRACK_ALLOCATIONS
  55. #define _COMPONENT ACPI_UTILITIES
  56. ACPI_MODULE_NAME("uttrack")
  57. /* Local prototypes */
  58. static struct acpi_debug_mem_block *acpi_ut_find_allocation(struct
  59. acpi_debug_mem_block
  60. *allocation);
  61. static acpi_status
  62. acpi_ut_track_allocation(struct acpi_debug_mem_block *address,
  63. acpi_size size,
  64. u8 alloc_type,
  65. u32 component, const char *module, u32 line);
  66. static acpi_status
  67. acpi_ut_remove_allocation(struct acpi_debug_mem_block *address,
  68. u32 component, const char *module, u32 line);
  69. /*******************************************************************************
  70. *
  71. * FUNCTION: acpi_ut_create_list
  72. *
  73. * PARAMETERS: cache_name - Ascii name for the cache
  74. * object_size - Size of each cached object
  75. * return_cache - Where the new cache object is returned
  76. *
  77. * RETURN: Status
  78. *
  79. * DESCRIPTION: Create a local memory list for tracking purposed
  80. *
  81. ******************************************************************************/
  82. acpi_status
  83. acpi_ut_create_list(const char *list_name,
  84. u16 object_size, struct acpi_memory_list **return_cache)
  85. {
  86. struct acpi_memory_list *cache;
  87. cache = acpi_os_allocate_zeroed(sizeof(struct acpi_memory_list));
  88. if (!cache) {
  89. return (AE_NO_MEMORY);
  90. }
  91. cache->list_name = list_name;
  92. cache->object_size = object_size;
  93. *return_cache = cache;
  94. return (AE_OK);
  95. }
  96. /*******************************************************************************
  97. *
  98. * FUNCTION: acpi_ut_allocate_and_track
  99. *
  100. * PARAMETERS: size - Size of the allocation
  101. * component - Component type of caller
  102. * module - Source file name of caller
  103. * line - Line number of caller
  104. *
  105. * RETURN: Address of the allocated memory on success, NULL on failure.
  106. *
  107. * DESCRIPTION: The subsystem's equivalent of malloc.
  108. *
  109. ******************************************************************************/
  110. void *acpi_ut_allocate_and_track(acpi_size size,
  111. u32 component, const char *module, u32 line)
  112. {
  113. struct acpi_debug_mem_block *allocation;
  114. acpi_status status;
  115. /* Check for an inadvertent size of zero bytes */
  116. if (!size) {
  117. ACPI_WARNING((module, line,
  118. "Attempt to allocate zero bytes, allocating 1 byte"));
  119. size = 1;
  120. }
  121. allocation =
  122. acpi_os_allocate(size + sizeof(struct acpi_debug_mem_header));
  123. if (!allocation) {
  124. /* Report allocation error */
  125. ACPI_WARNING((module, line,
  126. "Could not allocate size %u", (u32)size));
  127. return (NULL);
  128. }
  129. status =
  130. acpi_ut_track_allocation(allocation, size, ACPI_MEM_MALLOC,
  131. component, module, line);
  132. if (ACPI_FAILURE(status)) {
  133. acpi_os_free(allocation);
  134. return (NULL);
  135. }
  136. acpi_gbl_global_list->total_allocated++;
  137. acpi_gbl_global_list->total_size += (u32)size;
  138. acpi_gbl_global_list->current_total_size += (u32)size;
  139. if (acpi_gbl_global_list->current_total_size >
  140. acpi_gbl_global_list->max_occupied) {
  141. acpi_gbl_global_list->max_occupied =
  142. acpi_gbl_global_list->current_total_size;
  143. }
  144. return ((void *)&allocation->user_space);
  145. }
  146. /*******************************************************************************
  147. *
  148. * FUNCTION: acpi_ut_allocate_zeroed_and_track
  149. *
  150. * PARAMETERS: size - Size of the allocation
  151. * component - Component type of caller
  152. * module - Source file name of caller
  153. * line - Line number of caller
  154. *
  155. * RETURN: Address of the allocated memory on success, NULL on failure.
  156. *
  157. * DESCRIPTION: Subsystem equivalent of calloc.
  158. *
  159. ******************************************************************************/
  160. void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
  161. u32 component,
  162. const char *module, u32 line)
  163. {
  164. struct acpi_debug_mem_block *allocation;
  165. acpi_status status;
  166. /* Check for an inadvertent size of zero bytes */
  167. if (!size) {
  168. ACPI_WARNING((module, line,
  169. "Attempt to allocate zero bytes, allocating 1 byte"));
  170. size = 1;
  171. }
  172. allocation =
  173. acpi_os_allocate_zeroed(size +
  174. sizeof(struct acpi_debug_mem_header));
  175. if (!allocation) {
  176. /* Report allocation error */
  177. ACPI_ERROR((module, line,
  178. "Could not allocate size %u", (u32)size));
  179. return (NULL);
  180. }
  181. status = acpi_ut_track_allocation(allocation, size,
  182. ACPI_MEM_CALLOC, component, module,
  183. line);
  184. if (ACPI_FAILURE(status)) {
  185. acpi_os_free(allocation);
  186. return (NULL);
  187. }
  188. acpi_gbl_global_list->total_allocated++;
  189. acpi_gbl_global_list->total_size += (u32)size;
  190. acpi_gbl_global_list->current_total_size += (u32)size;
  191. if (acpi_gbl_global_list->current_total_size >
  192. acpi_gbl_global_list->max_occupied) {
  193. acpi_gbl_global_list->max_occupied =
  194. acpi_gbl_global_list->current_total_size;
  195. }
  196. return ((void *)&allocation->user_space);
  197. }
  198. /*******************************************************************************
  199. *
  200. * FUNCTION: acpi_ut_free_and_track
  201. *
  202. * PARAMETERS: allocation - Address of the memory to deallocate
  203. * component - Component type of caller
  204. * module - Source file name of caller
  205. * line - Line number of caller
  206. *
  207. * RETURN: None
  208. *
  209. * DESCRIPTION: Frees the memory at Allocation
  210. *
  211. ******************************************************************************/
  212. void
  213. acpi_ut_free_and_track(void *allocation,
  214. u32 component, const char *module, u32 line)
  215. {
  216. struct acpi_debug_mem_block *debug_block;
  217. acpi_status status;
  218. ACPI_FUNCTION_TRACE_PTR(ut_free, allocation);
  219. if (NULL == allocation) {
  220. ACPI_ERROR((module, line, "Attempt to delete a NULL address"));
  221. return_VOID;
  222. }
  223. debug_block = ACPI_CAST_PTR(struct acpi_debug_mem_block,
  224. (((char *)allocation) -
  225. sizeof(struct acpi_debug_mem_header)));
  226. acpi_gbl_global_list->total_freed++;
  227. acpi_gbl_global_list->current_total_size -= debug_block->size;
  228. status =
  229. acpi_ut_remove_allocation(debug_block, component, module, line);
  230. if (ACPI_FAILURE(status)) {
  231. ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
  232. }
  233. acpi_os_free(debug_block);
  234. ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n",
  235. allocation, debug_block));
  236. return_VOID;
  237. }
  238. /*******************************************************************************
  239. *
  240. * FUNCTION: acpi_ut_find_allocation
  241. *
  242. * PARAMETERS: allocation - Address of allocated memory
  243. *
  244. * RETURN: Three cases:
  245. * 1) List is empty, NULL is returned.
  246. * 2) Element was found. Returns Allocation parameter.
  247. * 3) Element was not found. Returns position where it should be
  248. * inserted into the list.
  249. *
  250. * DESCRIPTION: Searches for an element in the global allocation tracking list.
  251. * If the element is not found, returns the location within the
  252. * list where the element should be inserted.
  253. *
  254. * Note: The list is ordered by larger-to-smaller addresses.
  255. *
  256. * This global list is used to detect memory leaks in ACPICA as
  257. * well as other issues such as an attempt to release the same
  258. * internal object more than once. Although expensive as far
  259. * as cpu time, this list is much more helpful for finding these
  260. * types of issues than using memory leak detectors outside of
  261. * the ACPICA code.
  262. *
  263. ******************************************************************************/
  264. static struct acpi_debug_mem_block *acpi_ut_find_allocation(struct
  265. acpi_debug_mem_block
  266. *allocation)
  267. {
  268. struct acpi_debug_mem_block *element;
  269. element = acpi_gbl_global_list->list_head;
  270. if (!element) {
  271. return (NULL);
  272. }
  273. /*
  274. * Search for the address.
  275. *
  276. * Note: List is ordered by larger-to-smaller addresses, on the
  277. * assumption that a new allocation usually has a larger address
  278. * than previous allocations.
  279. */
  280. while (element > allocation) {
  281. /* Check for end-of-list */
  282. if (!element->next) {
  283. return (element);
  284. }
  285. element = element->next;
  286. }
  287. if (element == allocation) {
  288. return (element);
  289. }
  290. return (element->previous);
  291. }
  292. /*******************************************************************************
  293. *
  294. * FUNCTION: acpi_ut_track_allocation
  295. *
  296. * PARAMETERS: allocation - Address of allocated memory
  297. * size - Size of the allocation
  298. * alloc_type - MEM_MALLOC or MEM_CALLOC
  299. * component - Component type of caller
  300. * module - Source file name of caller
  301. * line - Line number of caller
  302. *
  303. * RETURN: Status
  304. *
  305. * DESCRIPTION: Inserts an element into the global allocation tracking list.
  306. *
  307. ******************************************************************************/
  308. static acpi_status
  309. acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
  310. acpi_size size,
  311. u8 alloc_type,
  312. u32 component, const char *module, u32 line)
  313. {
  314. struct acpi_memory_list *mem_list;
  315. struct acpi_debug_mem_block *element;
  316. acpi_status status = AE_OK;
  317. ACPI_FUNCTION_TRACE_PTR(ut_track_allocation, allocation);
  318. if (acpi_gbl_disable_mem_tracking) {
  319. return_ACPI_STATUS(AE_OK);
  320. }
  321. mem_list = acpi_gbl_global_list;
  322. status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
  323. if (ACPI_FAILURE(status)) {
  324. return_ACPI_STATUS(status);
  325. }
  326. /*
  327. * Search the global list for this address to make sure it is not
  328. * already present. This will catch several kinds of problems.
  329. */
  330. element = acpi_ut_find_allocation(allocation);
  331. if (element == allocation) {
  332. ACPI_ERROR((AE_INFO,
  333. "UtTrackAllocation: Allocation (%p) already present in global list!",
  334. allocation));
  335. goto unlock_and_exit;
  336. }
  337. /* Fill in the instance data */
  338. allocation->size = (u32)size;
  339. allocation->alloc_type = alloc_type;
  340. allocation->component = component;
  341. allocation->line = line;
  342. strncpy(allocation->module, module, ACPI_MAX_MODULE_NAME);
  343. allocation->module[ACPI_MAX_MODULE_NAME - 1] = 0;
  344. if (!element) {
  345. /* Insert at list head */
  346. if (mem_list->list_head) {
  347. ((struct acpi_debug_mem_block *)(mem_list->list_head))->
  348. previous = allocation;
  349. }
  350. allocation->next = mem_list->list_head;
  351. allocation->previous = NULL;
  352. mem_list->list_head = allocation;
  353. } else {
  354. /* Insert after element */
  355. allocation->next = element->next;
  356. allocation->previous = element;
  357. if (element->next) {
  358. (element->next)->previous = allocation;
  359. }
  360. element->next = allocation;
  361. }
  362. unlock_and_exit:
  363. status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  364. return_ACPI_STATUS(status);
  365. }
  366. /*******************************************************************************
  367. *
  368. * FUNCTION: acpi_ut_remove_allocation
  369. *
  370. * PARAMETERS: allocation - Address of allocated memory
  371. * component - Component type of caller
  372. * module - Source file name of caller
  373. * line - Line number of caller
  374. *
  375. * RETURN: Status
  376. *
  377. * DESCRIPTION: Deletes an element from the global allocation tracking list.
  378. *
  379. ******************************************************************************/
  380. static acpi_status
  381. acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
  382. u32 component, const char *module, u32 line)
  383. {
  384. struct acpi_memory_list *mem_list;
  385. acpi_status status;
  386. ACPI_FUNCTION_NAME(ut_remove_allocation);
  387. if (acpi_gbl_disable_mem_tracking) {
  388. return (AE_OK);
  389. }
  390. mem_list = acpi_gbl_global_list;
  391. if (NULL == mem_list->list_head) {
  392. /* No allocations! */
  393. ACPI_ERROR((module, line,
  394. "Empty allocation list, nothing to free!"));
  395. return (AE_OK);
  396. }
  397. status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
  398. if (ACPI_FAILURE(status)) {
  399. return (status);
  400. }
  401. /* Unlink */
  402. if (allocation->previous) {
  403. (allocation->previous)->next = allocation->next;
  404. } else {
  405. mem_list->list_head = allocation->next;
  406. }
  407. if (allocation->next) {
  408. (allocation->next)->previous = allocation->previous;
  409. }
  410. ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n",
  411. &allocation->user_space, allocation->size));
  412. /* Mark the segment as deleted */
  413. memset(&allocation->user_space, 0xEA, allocation->size);
  414. status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  415. return (status);
  416. }
  417. /*******************************************************************************
  418. *
  419. * FUNCTION: acpi_ut_dump_allocation_info
  420. *
  421. * PARAMETERS: None
  422. *
  423. * RETURN: None
  424. *
  425. * DESCRIPTION: Print some info about the outstanding allocations.
  426. *
  427. ******************************************************************************/
  428. void acpi_ut_dump_allocation_info(void)
  429. {
  430. /*
  431. struct acpi_memory_list *mem_list;
  432. */
  433. ACPI_FUNCTION_TRACE(ut_dump_allocation_info);
  434. /*
  435. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  436. ("%30s: %4d (%3d Kb)\n", "Current allocations",
  437. mem_list->current_count,
  438. ROUND_UP_TO_1K (mem_list->current_size)));
  439. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  440. ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
  441. mem_list->max_concurrent_count,
  442. ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
  443. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  444. ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
  445. running_object_count,
  446. ROUND_UP_TO_1K (running_object_size)));
  447. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  448. ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
  449. running_alloc_count,
  450. ROUND_UP_TO_1K (running_alloc_size)));
  451. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  452. ("%30s: %4d (%3d Kb)\n", "Current Nodes",
  453. acpi_gbl_current_node_count,
  454. ROUND_UP_TO_1K (acpi_gbl_current_node_size)));
  455. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  456. ("%30s: %4d (%3d Kb)\n", "Max Nodes",
  457. acpi_gbl_max_concurrent_node_count,
  458. ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
  459. sizeof (struct acpi_namespace_node)))));
  460. */
  461. return_VOID;
  462. }
  463. /*******************************************************************************
  464. *
  465. * FUNCTION: acpi_ut_dump_allocations
  466. *
  467. * PARAMETERS: component - Component(s) to dump info for.
  468. * module - Module to dump info for. NULL means all.
  469. *
  470. * RETURN: None
  471. *
  472. * DESCRIPTION: Print a list of all outstanding allocations.
  473. *
  474. ******************************************************************************/
  475. void acpi_ut_dump_allocations(u32 component, const char *module)
  476. {
  477. struct acpi_debug_mem_block *element;
  478. union acpi_descriptor *descriptor;
  479. u32 num_outstanding = 0;
  480. u8 descriptor_type;
  481. ACPI_FUNCTION_TRACE(ut_dump_allocations);
  482. if (acpi_gbl_disable_mem_tracking) {
  483. return_VOID;
  484. }
  485. /*
  486. * Walk the allocation list.
  487. */
  488. if (ACPI_FAILURE(acpi_ut_acquire_mutex(ACPI_MTX_MEMORY))) {
  489. return_VOID;
  490. }
  491. element = acpi_gbl_global_list->list_head;
  492. while (element) {
  493. if ((element->component & component) &&
  494. ((module == NULL)
  495. || (0 == strcmp(module, element->module)))) {
  496. descriptor =
  497. ACPI_CAST_PTR(union acpi_descriptor,
  498. &element->user_space);
  499. if (element->size <
  500. sizeof(struct acpi_common_descriptor)) {
  501. acpi_os_printf("%p Length 0x%04X %9.9s-%u "
  502. "[Not a Descriptor - too small]\n",
  503. descriptor, element->size,
  504. element->module, element->line);
  505. } else {
  506. /* Ignore allocated objects that are in a cache */
  507. if (ACPI_GET_DESCRIPTOR_TYPE(descriptor) !=
  508. ACPI_DESC_TYPE_CACHED) {
  509. acpi_os_printf
  510. ("%p Length 0x%04X %9.9s-%u [%s] ",
  511. descriptor, element->size,
  512. element->module, element->line,
  513. acpi_ut_get_descriptor_name
  514. (descriptor));
  515. /* Validate the descriptor type using Type field and length */
  516. descriptor_type = 0; /* Not a valid descriptor type */
  517. switch (ACPI_GET_DESCRIPTOR_TYPE
  518. (descriptor)) {
  519. case ACPI_DESC_TYPE_OPERAND:
  520. if (element->size ==
  521. sizeof(union
  522. acpi_operand_object))
  523. {
  524. descriptor_type =
  525. ACPI_DESC_TYPE_OPERAND;
  526. }
  527. break;
  528. case ACPI_DESC_TYPE_PARSER:
  529. if (element->size ==
  530. sizeof(union
  531. acpi_parse_object)) {
  532. descriptor_type =
  533. ACPI_DESC_TYPE_PARSER;
  534. }
  535. break;
  536. case ACPI_DESC_TYPE_NAMED:
  537. if (element->size ==
  538. sizeof(struct
  539. acpi_namespace_node))
  540. {
  541. descriptor_type =
  542. ACPI_DESC_TYPE_NAMED;
  543. }
  544. break;
  545. default:
  546. break;
  547. }
  548. /* Display additional info for the major descriptor types */
  549. switch (descriptor_type) {
  550. case ACPI_DESC_TYPE_OPERAND:
  551. acpi_os_printf
  552. ("%12.12s RefCount 0x%04X\n",
  553. acpi_ut_get_type_name
  554. (descriptor->object.common.
  555. type),
  556. descriptor->object.common.
  557. reference_count);
  558. break;
  559. case ACPI_DESC_TYPE_PARSER:
  560. acpi_os_printf
  561. ("AmlOpcode 0x%04hX\n",
  562. descriptor->op.asl.
  563. aml_opcode);
  564. break;
  565. case ACPI_DESC_TYPE_NAMED:
  566. acpi_os_printf("%4.4s\n",
  567. acpi_ut_get_node_name
  568. (&descriptor->
  569. node));
  570. break;
  571. default:
  572. acpi_os_printf("\n");
  573. break;
  574. }
  575. }
  576. }
  577. num_outstanding++;
  578. }
  579. element = element->next;
  580. }
  581. (void)acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  582. /* Print summary */
  583. if (!num_outstanding) {
  584. ACPI_INFO(("No outstanding allocations"));
  585. } else {
  586. ACPI_ERROR((AE_INFO, "%u(0x%X) Outstanding allocations",
  587. num_outstanding, num_outstanding));
  588. }
  589. return_VOID;
  590. }
  591. #endif /* ACPI_DBG_TRACK_ALLOCATIONS */