diff options
author | Valery A. Podrezov <valery.a.podrezov@intel.com> | 2007-02-02 16:48:23 (GMT) |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-03 02:14:31 (GMT) |
commit | afbb9e659d584bd5bf0604848c91afd5761ed7a1 (patch) | |
tree | e7157a607189bf411ef05989dfa03a4df9bccf71 /drivers | |
parent | ea5415785146afe37dd2d1179a6c3a34fd26b52f (diff) | |
download | linux-afbb9e659d584bd5bf0604848c91afd5761ed7a1.tar.xz |
ACPICA: Enhance debugger statistics/memory command.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/namespace/nsalloc.c | 12 | ||||
-rw-r--r-- | drivers/acpi/utilities/utcache.c | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c index 55b407a..1e6a1b0 100644 --- a/drivers/acpi/namespace/nsalloc.c +++ b/drivers/acpi/namespace/nsalloc.c @@ -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); diff --git a/drivers/acpi/utilities/utcache.c b/drivers/acpi/utilities/utcache.c index 1a1f810..d796fca 100644 --- a/drivers/acpi/utilities/utcache.c +++ b/drivers/acpi/utilities/utcache.c @@ -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); |