Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46412
b: refs/heads/master
c: afbb9e6
h: refs/heads/master
v: v3
  • Loading branch information
Valery A. Podrezov authored and Len Brown committed Feb 3, 2007
1 parent 9278151 commit aae221c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea5415785146afe37dd2d1179a6c3a34fd26b52f
refs/heads/master: afbb9e659d584bd5bf0604848c91afd5761ed7a1
12 changes: 12 additions & 0 deletions trunk/drivers/acpi/namespace/nsalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/acpi/utilities/utcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/acpi/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/acpi/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aae221c

Please sign in to comment.