Commit 0e770b32 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

ACPICA: Performance: Remove function tracing from critical allocation functions.

Tracing is no longer needed for many of the low-level function.
Removing the trace mechanism from these functions improves
performance a small amount, also simplifies the debug trace output.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 53938551
...@@ -663,17 +663,17 @@ void acpi_ns_terminate(void) ...@@ -663,17 +663,17 @@ void acpi_ns_terminate(void)
u32 acpi_ns_opens_scope(acpi_object_type type) u32 acpi_ns_opens_scope(acpi_object_type type)
{ {
ACPI_FUNCTION_TRACE_STR(ns_opens_scope, acpi_ut_get_type_name(type)); ACPI_FUNCTION_ENTRY();
if (!acpi_ut_valid_object_type(type)) { if (type > ACPI_TYPE_LOCAL_MAX) {
/* type code out of range */ /* type code out of range */
ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type)); ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type));
return_UINT32(ACPI_NS_NORMAL); return (ACPI_NS_NORMAL);
} }
return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE); return (((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
} }
/******************************************************************************* /*******************************************************************************
......
...@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) ...@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
{ {
union acpi_operand_object **internal_obj; union acpi_operand_object **internal_obj;
ACPI_FUNCTION_TRACE(ut_delete_internal_object_list); ACPI_FUNCTION_NAME(ut_delete_internal_object_list);
/* Walk the null-terminated internal list */ /* Walk the null-terminated internal list */
...@@ -351,7 +351,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) ...@@ -351,7 +351,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
/* Free the combined parameter pointer list and object array */ /* Free the combined parameter pointer list and object array */
ACPI_FREE(obj_list); ACPI_FREE(obj_list);
return_VOID; return;
} }
/******************************************************************************* /*******************************************************************************
...@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
union acpi_generic_state *state; union acpi_generic_state *state;
u32 i; u32 i;
ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object); ACPI_FUNCTION_NAME(ut_update_object_reference);
while (object) { while (object) {
...@@ -493,7 +493,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -493,7 +493,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) { if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
"Object %p is NS handle\n", object)); "Object %p is NS handle\n", object));
return_ACPI_STATUS(AE_OK); return (AE_OK);
} }
/* /*
...@@ -643,7 +643,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -643,7 +643,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
} }
} }
return_ACPI_STATUS(AE_OK); return (AE_OK);
error_exit: error_exit:
...@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
acpi_ut_delete_generic_state(state); acpi_ut_delete_generic_state(state);
} }
return_ACPI_STATUS(status); return (status);
} }
/******************************************************************************* /*******************************************************************************
...@@ -676,12 +676,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -676,12 +676,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
void acpi_ut_add_reference(union acpi_operand_object *object) void acpi_ut_add_reference(union acpi_operand_object *object)
{ {
ACPI_FUNCTION_TRACE_PTR(ut_add_reference, object); ACPI_FUNCTION_NAME(ut_add_reference);
/* Ensure that we have a valid object */ /* Ensure that we have a valid object */
if (!acpi_ut_valid_internal_object(object)) { if (!acpi_ut_valid_internal_object(object)) {
return_VOID; return;
} }
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
...@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) ...@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
/* Increment the reference count */ /* Increment the reference count */
(void)acpi_ut_update_object_reference(object, REF_INCREMENT); (void)acpi_ut_update_object_reference(object, REF_INCREMENT);
return_VOID; return;
} }
/******************************************************************************* /*******************************************************************************
...@@ -709,7 +709,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) ...@@ -709,7 +709,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
void acpi_ut_remove_reference(union acpi_operand_object *object) void acpi_ut_remove_reference(union acpi_operand_object *object)
{ {
ACPI_FUNCTION_TRACE_PTR(ut_remove_reference, object); ACPI_FUNCTION_NAME(ut_remove_reference);
/* /*
* Allow a NULL pointer to be passed in, just ignore it. This saves * Allow a NULL pointer to be passed in, just ignore it. This saves
...@@ -718,13 +718,13 @@ void acpi_ut_remove_reference(union acpi_operand_object *object) ...@@ -718,13 +718,13 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
*/ */
if (!object || if (!object ||
(ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) { (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) {
return_VOID; return;
} }
/* Ensure that we have a valid object */ /* Ensure that we have a valid object */
if (!acpi_ut_valid_internal_object(object)) { if (!acpi_ut_valid_internal_object(object)) {
return_VOID; return;
} }
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
...@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object) ...@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
* of all subobjects!) * of all subobjects!)
*/ */
(void)acpi_ut_update_object_reference(object, REF_DECREMENT); (void)acpi_ut_update_object_reference(object, REF_DECREMENT);
return_VOID; return;
} }
...@@ -97,14 +97,13 @@ void ...@@ -97,14 +97,13 @@ void
acpi_ut_push_generic_state(union acpi_generic_state **list_head, acpi_ut_push_generic_state(union acpi_generic_state **list_head,
union acpi_generic_state *state) union acpi_generic_state *state)
{ {
ACPI_FUNCTION_TRACE(ut_push_generic_state); ACPI_FUNCTION_ENTRY();
/* Push the state object onto the front of the list (stack) */ /* Push the state object onto the front of the list (stack) */
state->common.next = *list_head; state->common.next = *list_head;
*list_head = state; *list_head = state;
return;
return_VOID;
} }
/******************************************************************************* /*******************************************************************************
...@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state ...@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
{ {
union acpi_generic_state *state; union acpi_generic_state *state;
ACPI_FUNCTION_TRACE(ut_pop_generic_state); ACPI_FUNCTION_ENTRY();
/* Remove the state object at the head of the list (stack) */ /* Remove the state object at the head of the list (stack) */
...@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state ...@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
*list_head = state->common.next; *list_head = state->common.next;
} }
return_PTR(state); return (state);
} }
/******************************************************************************* /*******************************************************************************
...@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) ...@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
{ {
union acpi_generic_state *state; union acpi_generic_state *state;
ACPI_FUNCTION_TRACE(ut_create_thread_state); ACPI_FUNCTION_ENTRY();
/* Create the generic state object */ /* Create the generic state object */
state = acpi_ut_create_generic_state(); state = acpi_ut_create_generic_state();
if (!state) { if (!state) {
return_PTR(NULL); return (NULL);
} }
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
...@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) ...@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
state->thread.thread_id = (acpi_thread_id) 1; state->thread.thread_id = (acpi_thread_id) 1;
} }
return_PTR((struct acpi_thread_state *)state); return ((struct acpi_thread_state *)state);
} }
/******************************************************************************* /*******************************************************************************
...@@ -230,13 +229,13 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object ...@@ -230,13 +229,13 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
{ {
union acpi_generic_state *state; union acpi_generic_state *state;
ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object); ACPI_FUNCTION_ENTRY();
/* Create the generic state object */ /* Create the generic state object */
state = acpi_ut_create_generic_state(); state = acpi_ut_create_generic_state();
if (!state) { if (!state) {
return_PTR(NULL); return (NULL);
} }
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
...@@ -244,8 +243,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object ...@@ -244,8 +243,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE;
state->update.object = object; state->update.object = object;
state->update.value = action; state->update.value = action;
return (state);
return_PTR(state);
} }
/******************************************************************************* /*******************************************************************************
...@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, ...@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
{ {
union acpi_generic_state *state; union acpi_generic_state *state;
ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object); ACPI_FUNCTION_ENTRY();
/* Create the generic state object */ /* Create the generic state object */
state = acpi_ut_create_generic_state(); state = acpi_ut_create_generic_state();
if (!state) { if (!state) {
return_PTR(NULL); return (NULL);
} }
/* Init fields specific to the update struct */ /* Init fields specific to the update struct */
...@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, ...@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
state->pkg.dest_object = external_object; state->pkg.dest_object = external_object;
state->pkg.index = index; state->pkg.index = index;
state->pkg.num_packages = 1; state->pkg.num_packages = 1;
return (state);
return_PTR(state);
} }
/******************************************************************************* /*******************************************************************************
...@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void) ...@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
{ {
union acpi_generic_state *state; union acpi_generic_state *state;
ACPI_FUNCTION_TRACE(ut_create_control_state); ACPI_FUNCTION_ENTRY();
/* Create the generic state object */ /* Create the generic state object */
state = acpi_ut_create_generic_state(); state = acpi_ut_create_generic_state();
if (!state) { if (!state) {
return_PTR(NULL); return (NULL);
} }
/* Init fields specific to the control struct */ /* Init fields specific to the control struct */
state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
return (state);
return_PTR(state);
} }
/******************************************************************************* /*******************************************************************************
...@@ -336,12 +332,12 @@ union acpi_generic_state *acpi_ut_create_control_state(void) ...@@ -336,12 +332,12 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
void acpi_ut_delete_generic_state(union acpi_generic_state *state) void acpi_ut_delete_generic_state(union acpi_generic_state *state)
{ {
ACPI_FUNCTION_TRACE(ut_delete_generic_state); ACPI_FUNCTION_ENTRY();
/* Ignore null state */ /* Ignore null state */
if (state) { if (state) {
(void)acpi_os_release_object(acpi_gbl_state_cache, state); (void)acpi_os_release_object(acpi_gbl_state_cache, state);
} }
return_VOID; return;
} }
...@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, ...@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
struct acpi_memory_list *mem_list; struct acpi_memory_list *mem_list;
acpi_status status; acpi_status status;
ACPI_FUNCTION_TRACE(ut_remove_allocation); ACPI_FUNCTION_NAME(ut_remove_allocation);
if (acpi_gbl_disable_mem_tracking) { if (acpi_gbl_disable_mem_tracking) {
return_ACPI_STATUS(AE_OK); return (AE_OK);
} }
mem_list = acpi_gbl_global_list; mem_list = acpi_gbl_global_list;
...@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, ...@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
ACPI_ERROR((module, line, ACPI_ERROR((module, line,
"Empty allocation list, nothing to free!")); "Empty allocation list, nothing to free!"));
return_ACPI_STATUS(AE_OK); return (AE_OK);
} }
status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY); status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return (status);
} }
/* Unlink */ /* Unlink */
...@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, ...@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
(allocation->next)->previous = allocation->previous; (allocation->next)->previous = allocation->previous;
} }
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n",
&allocation->user_space, allocation->size));
/* Mark the segment as deleted */ /* Mark the segment as deleted */
ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size); ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size);
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
allocation->size));
status = acpi_ut_release_mutex(ACPI_MTX_MEMORY); status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
return_ACPI_STATUS(status); return (status);
} }
/******************************************************************************* /*******************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment