ACPICA: Added option to display memory statistics upon termination.
authorBob Moore <robert.moore@intel.com>
Fri, 2 Feb 2007 16:48:23 +0000 (19:48 +0300)
committerLen Brown <len.brown@intel.com>
Sat, 3 Feb 2007 02:14:31 +0000 (21:14 -0500)
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utglobal.c
include/acpi/acglobal.h

index f6cbc0b1bfd057f3d51257b7c1c35b12564ce708..b716797e6fc45ee9a08690f93c3597b944381f4c 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <acpi/acpi.h>
+#include <acpi/acdebug.h>
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utalloc")
@@ -142,6 +143,14 @@ acpi_status acpi_ut_create_caches(void)
 
 acpi_status acpi_ut_delete_caches(void)
 {
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+       char buffer[7];
+
+       if (acpi_gbl_display_final_mem_stats) {
+               ACPI_STRCPY(buffer, "MEMORY");
+               acpi_db_display_statistics(buffer);
+       }
+#endif
 
        (void)acpi_os_delete_cache(acpi_gbl_namespace_cache);
        acpi_gbl_namespace_cache = NULL;
index 509a85d6b01f4929e18eb5bcca65db01370088db..62929f4206bef6791633928d4d466bc9934a2972 100644 (file)
@@ -727,6 +727,10 @@ void acpi_ut_init_globals(void)
        acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX;
 #endif
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+       acpi_gbl_display_final_mem_stats = FALSE;
+#endif
+
        return_VOID;
 }
 
index d1a5363ffc405d25d7ccc970d3da22de92125798..5b5d43747b98839842ec034dd34fae937ed02f1c 100644 (file)
@@ -200,6 +200,7 @@ ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock;     /* For ACPI H/W except GPE regis
 
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
+ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
 #endif
 
 /* Object caches */