]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ACPICA: Enhance debugger statistics/memory command.
authorValery A. Podrezov <valery.a.podrezov@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)
Debugger: Enhanced the Statistics/Memory command to emit the
total (maximum) memory used during execution, as well as the
maximum memory consumed by each of the various object types.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/namespace/nsalloc.c
drivers/acpi/utilities/utcache.c
include/acpi/acdebug.h
include/acpi/aclocal.h

index 55b407aae26612372d52f61867d50226f129e673..1e6a1b02dfd7de41e2fdf07cd4270ac8db4759e3 100644 (file)
@@ -61,6 +61,9 @@ ACPI_MODULE_NAME("nsalloc")
 struct acpi_namespace_node *acpi_ns_create_node(u32 name)
 {
        struct acpi_namespace_node *node;
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+       u32 temp;
+#endif
 
        ACPI_FUNCTION_TRACE(ns_create_node);
 
@@ -71,6 +74,15 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
 
        ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++);
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+       temp =
+           acpi_gbl_ns_node_list->total_allocated -
+           acpi_gbl_ns_node_list->total_freed;
+       if (temp > acpi_gbl_ns_node_list->max_occupied) {
+               acpi_gbl_ns_node_list->max_occupied = temp;
+       }
+#endif
+
        node->name.integer = name;
        ACPI_SET_DESCRIPTOR_TYPE(node, ACPI_DESC_TYPE_NAMED);
        return_PTR(node);
index 1a1f8109159cec3d9d988d1513a75cdb1638ecf4..d796fcac33af51a99a90c8c6bd2e83c604fd3c62 100644 (file)
@@ -289,6 +289,14 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 
                ACPI_MEM_TRACKING(cache->total_allocated++);
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+               if ((cache->total_allocated - cache->total_freed) >
+                   cache->max_occupied) {
+                       cache->max_occupied =
+                           cache->total_allocated - cache->total_freed;
+               }
+#endif
+
                /* Avoid deadlock with ACPI_ALLOCATE_ZEROED */
 
                status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
index 47296ffef7dd82efd31e153cc8f96f2b468e21c9..c46a33abe457ca0da84b608f8900d1133b5e3c0c 100644 (file)
@@ -159,6 +159,10 @@ void
 acpi_db_create_execution_threads(char *num_threads_arg,
                                 char *num_loops_arg, char *method_name_arg);
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
+#endif
+
 /*
  * dbfileio - Debugger file I/O commands
  */
index 9b7e05c875953401acce014c0737abeff6f077ee..e135dab905f8433ef9e522b1a7c8b32eda4a5887 100644 (file)
@@ -954,6 +954,8 @@ struct acpi_memory_list {
 
        u32 total_allocated;
        u32 total_freed;
+       u32 max_occupied;
+       u32 total_size;
        u32 current_total_size;
        u32 requests;
        u32 hits;