uttrack.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. /******************************************************************************
  2. *
  3. * Module Name: uttrack - Memory allocation tracking routines (debug only)
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2012, 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(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(sizeof(struct acpi_memory_list));
  88. if (!cache) {
  89. return (AE_NO_MEMORY);
  90. }
  91. ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list));
  92. cache->list_name = list_name;
  93. cache->object_size = object_size;
  94. *return_cache = cache;
  95. return (AE_OK);
  96. }
  97. /*******************************************************************************
  98. *
  99. * FUNCTION: acpi_ut_allocate_and_track
  100. *
  101. * PARAMETERS: size - Size of the allocation
  102. * component - Component type of caller
  103. * module - Source file name of caller
  104. * line - Line number of caller
  105. *
  106. * RETURN: Address of the allocated memory on success, NULL on failure.
  107. *
  108. * DESCRIPTION: The subsystem's equivalent of malloc.
  109. *
  110. ******************************************************************************/
  111. void *acpi_ut_allocate_and_track(acpi_size size,
  112. u32 component, const char *module, u32 line)
  113. {
  114. struct acpi_debug_mem_block *allocation;
  115. acpi_status status;
  116. allocation =
  117. acpi_ut_allocate(size + sizeof(struct acpi_debug_mem_header),
  118. component, module, line);
  119. if (!allocation) {
  120. return (NULL);
  121. }
  122. status = acpi_ut_track_allocation(allocation, size,
  123. ACPI_MEM_MALLOC, component, module,
  124. line);
  125. if (ACPI_FAILURE(status)) {
  126. acpi_os_free(allocation);
  127. return (NULL);
  128. }
  129. acpi_gbl_global_list->total_allocated++;
  130. acpi_gbl_global_list->total_size += (u32)size;
  131. acpi_gbl_global_list->current_total_size += (u32)size;
  132. if (acpi_gbl_global_list->current_total_size >
  133. acpi_gbl_global_list->max_occupied) {
  134. acpi_gbl_global_list->max_occupied =
  135. acpi_gbl_global_list->current_total_size;
  136. }
  137. return ((void *)&allocation->user_space);
  138. }
  139. /*******************************************************************************
  140. *
  141. * FUNCTION: acpi_ut_allocate_zeroed_and_track
  142. *
  143. * PARAMETERS: size - Size of the allocation
  144. * component - Component type of caller
  145. * module - Source file name of caller
  146. * line - Line number of caller
  147. *
  148. * RETURN: Address of the allocated memory on success, NULL on failure.
  149. *
  150. * DESCRIPTION: Subsystem equivalent of calloc.
  151. *
  152. ******************************************************************************/
  153. void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
  154. u32 component,
  155. const char *module, u32 line)
  156. {
  157. struct acpi_debug_mem_block *allocation;
  158. acpi_status status;
  159. allocation =
  160. acpi_ut_allocate_zeroed(size + sizeof(struct acpi_debug_mem_header),
  161. component, module, line);
  162. if (!allocation) {
  163. /* Report allocation error */
  164. ACPI_ERROR((module, line,
  165. "Could not allocate size %u", (u32)size));
  166. return (NULL);
  167. }
  168. status = acpi_ut_track_allocation(allocation, size,
  169. ACPI_MEM_CALLOC, component, module,
  170. line);
  171. if (ACPI_FAILURE(status)) {
  172. acpi_os_free(allocation);
  173. return (NULL);
  174. }
  175. acpi_gbl_global_list->total_allocated++;
  176. acpi_gbl_global_list->total_size += (u32)size;
  177. acpi_gbl_global_list->current_total_size += (u32)size;
  178. if (acpi_gbl_global_list->current_total_size >
  179. acpi_gbl_global_list->max_occupied) {
  180. acpi_gbl_global_list->max_occupied =
  181. acpi_gbl_global_list->current_total_size;
  182. }
  183. return ((void *)&allocation->user_space);
  184. }
  185. /*******************************************************************************
  186. *
  187. * FUNCTION: acpi_ut_free_and_track
  188. *
  189. * PARAMETERS: allocation - Address of the memory to deallocate
  190. * component - Component type of caller
  191. * module - Source file name of caller
  192. * line - Line number of caller
  193. *
  194. * RETURN: None
  195. *
  196. * DESCRIPTION: Frees the memory at Allocation
  197. *
  198. ******************************************************************************/
  199. void
  200. acpi_ut_free_and_track(void *allocation,
  201. u32 component, const char *module, u32 line)
  202. {
  203. struct acpi_debug_mem_block *debug_block;
  204. acpi_status status;
  205. ACPI_FUNCTION_TRACE_PTR(ut_free, allocation);
  206. if (NULL == allocation) {
  207. ACPI_ERROR((module, line, "Attempt to delete a NULL address"));
  208. return_VOID;
  209. }
  210. debug_block = ACPI_CAST_PTR(struct acpi_debug_mem_block,
  211. (((char *)allocation) -
  212. sizeof(struct acpi_debug_mem_header)));
  213. acpi_gbl_global_list->total_freed++;
  214. acpi_gbl_global_list->current_total_size -= debug_block->size;
  215. status = acpi_ut_remove_allocation(debug_block,
  216. component, module, line);
  217. if (ACPI_FAILURE(status)) {
  218. ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
  219. }
  220. acpi_os_free(debug_block);
  221. ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation));
  222. return_VOID;
  223. }
  224. /*******************************************************************************
  225. *
  226. * FUNCTION: acpi_ut_find_allocation
  227. *
  228. * PARAMETERS: allocation - Address of allocated memory
  229. *
  230. * RETURN: Three cases:
  231. * 1) List is empty, NULL is returned.
  232. * 2) Element was found. Returns Allocation parameter.
  233. * 3) Element was not found. Returns position where it should be
  234. * inserted into the list.
  235. *
  236. * DESCRIPTION: Searches for an element in the global allocation tracking list.
  237. * If the element is not found, returns the location within the
  238. * list where the element should be inserted.
  239. *
  240. * Note: The list is ordered by larger-to-smaller addresses.
  241. *
  242. * This global list is used to detect memory leaks in ACPICA as
  243. * well as other issues such as an attempt to release the same
  244. * internal object more than once. Although expensive as far
  245. * as cpu time, this list is much more helpful for finding these
  246. * types of issues than using memory leak detectors outside of
  247. * the ACPICA code.
  248. *
  249. ******************************************************************************/
  250. static struct acpi_debug_mem_block *acpi_ut_find_allocation(struct
  251. acpi_debug_mem_block
  252. *allocation)
  253. {
  254. struct acpi_debug_mem_block *element;
  255. element = acpi_gbl_global_list->list_head;
  256. if (!element) {
  257. return (NULL);
  258. }
  259. /*
  260. * Search for the address.
  261. *
  262. * Note: List is ordered by larger-to-smaller addresses, on the
  263. * assumption that a new allocation usually has a larger address
  264. * than previous allocations.
  265. */
  266. while (element > allocation) {
  267. /* Check for end-of-list */
  268. if (!element->next) {
  269. return (element);
  270. }
  271. element = element->next;
  272. }
  273. if (element == allocation) {
  274. return (element);
  275. }
  276. return (element->previous);
  277. }
  278. /*******************************************************************************
  279. *
  280. * FUNCTION: acpi_ut_track_allocation
  281. *
  282. * PARAMETERS: allocation - Address of allocated memory
  283. * size - Size of the allocation
  284. * alloc_type - MEM_MALLOC or MEM_CALLOC
  285. * component - Component type of caller
  286. * module - Source file name of caller
  287. * line - Line number of caller
  288. *
  289. * RETURN: Status
  290. *
  291. * DESCRIPTION: Inserts an element into the global allocation tracking list.
  292. *
  293. ******************************************************************************/
  294. static acpi_status
  295. acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
  296. acpi_size size,
  297. u8 alloc_type,
  298. u32 component, const char *module, u32 line)
  299. {
  300. struct acpi_memory_list *mem_list;
  301. struct acpi_debug_mem_block *element;
  302. acpi_status status = AE_OK;
  303. ACPI_FUNCTION_TRACE_PTR(ut_track_allocation, allocation);
  304. if (acpi_gbl_disable_mem_tracking) {
  305. return_ACPI_STATUS(AE_OK);
  306. }
  307. mem_list = acpi_gbl_global_list;
  308. status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
  309. if (ACPI_FAILURE(status)) {
  310. return_ACPI_STATUS(status);
  311. }
  312. /*
  313. * Search the global list for this address to make sure it is not
  314. * already present. This will catch several kinds of problems.
  315. */
  316. element = acpi_ut_find_allocation(allocation);
  317. if (element == allocation) {
  318. ACPI_ERROR((AE_INFO,
  319. "UtTrackAllocation: Allocation (%p) already present in global list!",
  320. allocation));
  321. goto unlock_and_exit;
  322. }
  323. /* Fill in the instance data */
  324. allocation->size = (u32)size;
  325. allocation->alloc_type = alloc_type;
  326. allocation->component = component;
  327. allocation->line = line;
  328. ACPI_STRNCPY(allocation->module, module, ACPI_MAX_MODULE_NAME);
  329. allocation->module[ACPI_MAX_MODULE_NAME - 1] = 0;
  330. if (!element) {
  331. /* Insert at list head */
  332. if (mem_list->list_head) {
  333. ((struct acpi_debug_mem_block *)(mem_list->list_head))->
  334. previous = allocation;
  335. }
  336. allocation->next = mem_list->list_head;
  337. allocation->previous = NULL;
  338. mem_list->list_head = allocation;
  339. } else {
  340. /* Insert after element */
  341. allocation->next = element->next;
  342. allocation->previous = element;
  343. if (element->next) {
  344. (element->next)->previous = allocation;
  345. }
  346. element->next = allocation;
  347. }
  348. unlock_and_exit:
  349. status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  350. return_ACPI_STATUS(status);
  351. }
  352. /*******************************************************************************
  353. *
  354. * FUNCTION: acpi_ut_remove_allocation
  355. *
  356. * PARAMETERS: allocation - Address of allocated memory
  357. * component - Component type of caller
  358. * module - Source file name of caller
  359. * line - Line number of caller
  360. *
  361. * RETURN: Status
  362. *
  363. * DESCRIPTION: Deletes an element from the global allocation tracking list.
  364. *
  365. ******************************************************************************/
  366. static acpi_status
  367. acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
  368. u32 component, const char *module, u32 line)
  369. {
  370. struct acpi_memory_list *mem_list;
  371. acpi_status status;
  372. ACPI_FUNCTION_TRACE(ut_remove_allocation);
  373. if (acpi_gbl_disable_mem_tracking) {
  374. return_ACPI_STATUS(AE_OK);
  375. }
  376. mem_list = acpi_gbl_global_list;
  377. if (NULL == mem_list->list_head) {
  378. /* No allocations! */
  379. ACPI_ERROR((module, line,
  380. "Empty allocation list, nothing to free!"));
  381. return_ACPI_STATUS(AE_OK);
  382. }
  383. status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
  384. if (ACPI_FAILURE(status)) {
  385. return_ACPI_STATUS(status);
  386. }
  387. /* Unlink */
  388. if (allocation->previous) {
  389. (allocation->previous)->next = allocation->next;
  390. } else {
  391. mem_list->list_head = allocation->next;
  392. }
  393. if (allocation->next) {
  394. (allocation->next)->previous = allocation->previous;
  395. }
  396. /* Mark the segment as deleted */
  397. ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size);
  398. ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
  399. allocation->size));
  400. status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  401. return_ACPI_STATUS(status);
  402. }
  403. /*******************************************************************************
  404. *
  405. * FUNCTION: acpi_ut_dump_allocation_info
  406. *
  407. * PARAMETERS: None
  408. *
  409. * RETURN: None
  410. *
  411. * DESCRIPTION: Print some info about the outstanding allocations.
  412. *
  413. ******************************************************************************/
  414. void acpi_ut_dump_allocation_info(void)
  415. {
  416. /*
  417. struct acpi_memory_list *mem_list;
  418. */
  419. ACPI_FUNCTION_TRACE(ut_dump_allocation_info);
  420. /*
  421. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  422. ("%30s: %4d (%3d Kb)\n", "Current allocations",
  423. mem_list->current_count,
  424. ROUND_UP_TO_1K (mem_list->current_size)));
  425. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  426. ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
  427. mem_list->max_concurrent_count,
  428. ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
  429. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  430. ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
  431. running_object_count,
  432. ROUND_UP_TO_1K (running_object_size)));
  433. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  434. ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
  435. running_alloc_count,
  436. ROUND_UP_TO_1K (running_alloc_size)));
  437. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  438. ("%30s: %4d (%3d Kb)\n", "Current Nodes",
  439. acpi_gbl_current_node_count,
  440. ROUND_UP_TO_1K (acpi_gbl_current_node_size)));
  441. ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
  442. ("%30s: %4d (%3d Kb)\n", "Max Nodes",
  443. acpi_gbl_max_concurrent_node_count,
  444. ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
  445. sizeof (struct acpi_namespace_node)))));
  446. */
  447. return_VOID;
  448. }
  449. /*******************************************************************************
  450. *
  451. * FUNCTION: acpi_ut_dump_allocations
  452. *
  453. * PARAMETERS: component - Component(s) to dump info for.
  454. * module - Module to dump info for. NULL means all.
  455. *
  456. * RETURN: None
  457. *
  458. * DESCRIPTION: Print a list of all outstanding allocations.
  459. *
  460. ******************************************************************************/
  461. void acpi_ut_dump_allocations(u32 component, const char *module)
  462. {
  463. struct acpi_debug_mem_block *element;
  464. union acpi_descriptor *descriptor;
  465. u32 num_outstanding = 0;
  466. u8 descriptor_type;
  467. ACPI_FUNCTION_TRACE(ut_dump_allocations);
  468. if (acpi_gbl_disable_mem_tracking) {
  469. return_VOID;
  470. }
  471. /*
  472. * Walk the allocation list.
  473. */
  474. if (ACPI_FAILURE(acpi_ut_acquire_mutex(ACPI_MTX_MEMORY))) {
  475. return_VOID;
  476. }
  477. element = acpi_gbl_global_list->list_head;
  478. while (element) {
  479. if ((element->component & component) &&
  480. ((module == NULL)
  481. || (0 == ACPI_STRCMP(module, element->module)))) {
  482. descriptor =
  483. ACPI_CAST_PTR(union acpi_descriptor,
  484. &element->user_space);
  485. if (element->size <
  486. sizeof(struct acpi_common_descriptor)) {
  487. acpi_os_printf("%p Length 0x%04X %9.9s-%u "
  488. "[Not a Descriptor - too small]\n",
  489. descriptor, element->size,
  490. element->module, element->line);
  491. } else {
  492. /* Ignore allocated objects that are in a cache */
  493. if (ACPI_GET_DESCRIPTOR_TYPE(descriptor) !=
  494. ACPI_DESC_TYPE_CACHED) {
  495. acpi_os_printf
  496. ("%p Length 0x%04X %9.9s-%u [%s] ",
  497. descriptor, element->size,
  498. element->module, element->line,
  499. acpi_ut_get_descriptor_name
  500. (descriptor));
  501. /* Validate the descriptor type using Type field and length */
  502. descriptor_type = 0; /* Not a valid descriptor type */
  503. switch (ACPI_GET_DESCRIPTOR_TYPE
  504. (descriptor)) {
  505. case ACPI_DESC_TYPE_OPERAND:
  506. if (element->size ==
  507. sizeof(union
  508. acpi_operand_object))
  509. {
  510. descriptor_type =
  511. ACPI_DESC_TYPE_OPERAND;
  512. }
  513. break;
  514. case ACPI_DESC_TYPE_PARSER:
  515. if (element->size ==
  516. sizeof(union
  517. acpi_parse_object)) {
  518. descriptor_type =
  519. ACPI_DESC_TYPE_PARSER;
  520. }
  521. break;
  522. case ACPI_DESC_TYPE_NAMED:
  523. if (element->size ==
  524. sizeof(struct
  525. acpi_namespace_node))
  526. {
  527. descriptor_type =
  528. ACPI_DESC_TYPE_NAMED;
  529. }
  530. break;
  531. default:
  532. break;
  533. }
  534. /* Display additional info for the major descriptor types */
  535. switch (descriptor_type) {
  536. case ACPI_DESC_TYPE_OPERAND:
  537. acpi_os_printf
  538. ("%12.12s RefCount 0x%04X\n",
  539. acpi_ut_get_type_name
  540. (descriptor->object.common.
  541. type),
  542. descriptor->object.common.
  543. reference_count);
  544. break;
  545. case ACPI_DESC_TYPE_PARSER:
  546. acpi_os_printf
  547. ("AmlOpcode 0x%04hX\n",
  548. descriptor->op.asl.
  549. aml_opcode);
  550. break;
  551. case ACPI_DESC_TYPE_NAMED:
  552. acpi_os_printf("%4.4s\n",
  553. acpi_ut_get_node_name
  554. (&descriptor->
  555. node));
  556. break;
  557. default:
  558. acpi_os_printf("\n");
  559. break;
  560. }
  561. }
  562. }
  563. num_outstanding++;
  564. }
  565. element = element->next;
  566. }
  567. (void)acpi_ut_release_mutex(ACPI_MTX_MEMORY);
  568. /* Print summary */
  569. if (!num_outstanding) {
  570. ACPI_INFO((AE_INFO, "No outstanding allocations"));
  571. } else {
  572. ACPI_ERROR((AE_INFO, "%u(0x%X) Outstanding allocations",
  573. num_outstanding, num_outstanding));
  574. }
  575. return_VOID;
  576. }
  577. #endif /* ACPI_DBG_TRACK_ALLOCATIONS */