ACPICA: Performance: Remove function tracing from critical allocation functions.
authorBob Moore <robert.moore@intel.com>
Wed, 19 Dec 2012 05:37:59 +0000 (05:37 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Jan 2013 11:36:18 +0000 (12:36 +0100)
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: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/nsutils.c
drivers/acpi/acpica/utdelete.c
drivers/acpi/acpica/utstate.c
drivers/acpi/acpica/uttrack.c

index 7e8bd2af806df90bc7500af42a8381562b4c9421..4479654760acb941407813f6b680e8bcdfc103e8 100644 (file)
@@ -663,17 +663,17 @@ void acpi_ns_terminate(void)
 
 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  */
 
                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);
 }
 
 /*******************************************************************************
index e806fb02187b0f88794e5b3b17053355af390bff..53e6af801661785144e72759b10f9075935554b0 100644 (file)
@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
 {
        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 */
 
@@ -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 */
 
        ACPI_FREE(obj_list);
-       return_VOID;
+       return;
 }
 
 /*******************************************************************************
@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
        union acpi_generic_state *state;
        u32 i;
 
-       ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
+       ACPI_FUNCTION_NAME(ut_update_object_reference);
 
        while (object) {
 
@@ -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) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
                                          "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)
                }
        }
 
-       return_ACPI_STATUS(AE_OK);
+       return (AE_OK);
 
       error_exit:
 
@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
                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)
 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 */
 
        if (!acpi_ut_valid_internal_object(object)) {
-               return_VOID;
+               return;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
        /* Increment the reference count */
 
        (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)
 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
@@ -718,13 +718,13 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
         */
        if (!object ||
            (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) {
-               return_VOID;
+               return;
        }
 
        /* Ensure that we have a valid object */
 
        if (!acpi_ut_valid_internal_object(object)) {
-               return_VOID;
+               return;
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
         * of all subobjects!)
         */
        (void)acpi_ut_update_object_reference(object, REF_DECREMENT);
-       return_VOID;
+       return;
 }
index cee0473ba8132b3e70fa264403186ca32cc5fbf0..26a0c23c3f4b1b29143e315eec2d98888860f371 100644 (file)
@@ -97,14 +97,13 @@ void
 acpi_ut_push_generic_state(union acpi_generic_state **list_head,
                           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) */
 
        state->common.next = *list_head;
        *list_head = state;
-
-       return_VOID;
+       return;
 }
 
 /*******************************************************************************
@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_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) */
 
@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
                *list_head = state->common.next;
        }
 
-       return_PTR(state);
+       return (state);
 }
 
 /*******************************************************************************
@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
 {
        union acpi_generic_state *state;
 
-       ACPI_FUNCTION_TRACE(ut_create_thread_state);
+       ACPI_FUNCTION_ENTRY();
 
        /* Create the generic state object */
 
        state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR(NULL);
+               return (NULL);
        }
 
        /* Init fields specific to the update struct */
@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
                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
 {
        union acpi_generic_state *state;
 
-       ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object);
+       ACPI_FUNCTION_ENTRY();
 
        /* Create the generic state object */
 
        state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR(NULL);
+               return (NULL);
        }
 
        /* Init fields specific to the update struct */
@@ -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->update.object = object;
        state->update.value = action;
-
-       return_PTR(state);
+       return (state);
 }
 
 /*******************************************************************************
@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 {
        union acpi_generic_state *state;
 
-       ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object);
+       ACPI_FUNCTION_ENTRY();
 
        /* Create the generic state object */
 
        state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR(NULL);
+               return (NULL);
        }
 
        /* Init fields specific to the update struct */
@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
        state->pkg.dest_object = external_object;
        state->pkg.index = index;
        state->pkg.num_packages = 1;
-
-       return_PTR(state);
+       return (state);
 }
 
 /*******************************************************************************
@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 {
        union acpi_generic_state *state;
 
-       ACPI_FUNCTION_TRACE(ut_create_control_state);
+       ACPI_FUNCTION_ENTRY();
 
        /* Create the generic state object */
 
        state = acpi_ut_create_generic_state();
        if (!state) {
-               return_PTR(NULL);
+               return (NULL);
        }
 
        /* Init fields specific to the control struct */
 
        state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
        state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
-
-       return_PTR(state);
+       return (state);
 }
 
 /*******************************************************************************
@@ -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)
 {
-       ACPI_FUNCTION_TRACE(ut_delete_generic_state);
+       ACPI_FUNCTION_ENTRY();
 
        /* Ignore null state */
 
        if (state) {
                (void)acpi_os_release_object(acpi_gbl_state_cache, state);
        }
-       return_VOID;
+       return;
 }
index a424a9e3fea4c9fd15db96d0fabce89bf5f93ee9..866f96e14adeccfbe42163041d6b7959c15aa7e8 100644 (file)
@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
        struct acpi_memory_list *mem_list;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE(ut_remove_allocation);
+       ACPI_FUNCTION_NAME(ut_remove_allocation);
 
        if (acpi_gbl_disable_mem_tracking) {
-               return_ACPI_STATUS(AE_OK);
+               return (AE_OK);
        }
 
        mem_list = acpi_gbl_global_list;
@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
                ACPI_ERROR((module, line,
                            "Empty allocation list, nothing to free!"));
 
-               return_ACPI_STATUS(AE_OK);
+               return (AE_OK);
        }
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
        if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
+               return (status);
        }
 
        /* Unlink */
@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
                (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 */
 
        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);
-       return_ACPI_STATUS(status);
+       return (status);
 }
 
 /*******************************************************************************