diff options
author | Bob Moore <robert.moore@intel.com> | 2012-12-19 00:37:59 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-10 06:36:18 -0500 |
commit | 0e770b3263816b4445e2c855f641b172aa26291a (patch) | |
tree | d1b6dfd0cd668003379b7dd32b0045e32c7003a5 /drivers/acpi/acpica | |
parent | 53938551c827d2016912ae5a431a7dad76c2426a (diff) |
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: 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>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/nsutils.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/utdelete.c | 26 | ||||
-rw-r--r-- | drivers/acpi/acpica/utstate.c | 40 | ||||
-rw-r--r-- | drivers/acpi/acpica/uttrack.c | 16 |
4 files changed, 43 insertions, 47 deletions
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index 7e8bd2af806d..4479654760ac 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c | |||
@@ -663,17 +663,17 @@ void acpi_ns_terminate(void) | |||
663 | 663 | ||
664 | u32 acpi_ns_opens_scope(acpi_object_type type) | 664 | u32 acpi_ns_opens_scope(acpi_object_type type) |
665 | { | 665 | { |
666 | ACPI_FUNCTION_TRACE_STR(ns_opens_scope, acpi_ut_get_type_name(type)); | 666 | ACPI_FUNCTION_ENTRY(); |
667 | 667 | ||
668 | if (!acpi_ut_valid_object_type(type)) { | 668 | if (type > ACPI_TYPE_LOCAL_MAX) { |
669 | 669 | ||
670 | /* type code out of range */ | 670 | /* type code out of range */ |
671 | 671 | ||
672 | ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type)); | 672 | ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type)); |
673 | return_UINT32(ACPI_NS_NORMAL); | 673 | return (ACPI_NS_NORMAL); |
674 | } | 674 | } |
675 | 675 | ||
676 | return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE); | 676 | return (((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE); |
677 | } | 677 | } |
678 | 678 | ||
679 | /******************************************************************************* | 679 | /******************************************************************************* |
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index e806fb02187b..53e6af801661 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c | |||
@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) | |||
340 | { | 340 | { |
341 | union acpi_operand_object **internal_obj; | 341 | union acpi_operand_object **internal_obj; |
342 | 342 | ||
343 | ACPI_FUNCTION_TRACE(ut_delete_internal_object_list); | 343 | ACPI_FUNCTION_NAME(ut_delete_internal_object_list); |
344 | 344 | ||
345 | /* Walk the null-terminated internal list */ | 345 | /* Walk the null-terminated internal list */ |
346 | 346 | ||
@@ -351,7 +351,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) | |||
351 | /* Free the combined parameter pointer list and object array */ | 351 | /* Free the combined parameter pointer list and object array */ |
352 | 352 | ||
353 | ACPI_FREE(obj_list); | 353 | ACPI_FREE(obj_list); |
354 | return_VOID; | 354 | return; |
355 | } | 355 | } |
356 | 356 | ||
357 | /******************************************************************************* | 357 | /******************************************************************************* |
@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
484 | union acpi_generic_state *state; | 484 | union acpi_generic_state *state; |
485 | u32 i; | 485 | u32 i; |
486 | 486 | ||
487 | ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object); | 487 | ACPI_FUNCTION_NAME(ut_update_object_reference); |
488 | 488 | ||
489 | while (object) { | 489 | while (object) { |
490 | 490 | ||
@@ -493,7 +493,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
493 | if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) { | 493 | if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) { |
494 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, | 494 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, |
495 | "Object %p is NS handle\n", object)); | 495 | "Object %p is NS handle\n", object)); |
496 | return_ACPI_STATUS(AE_OK); | 496 | return (AE_OK); |
497 | } | 497 | } |
498 | 498 | ||
499 | /* | 499 | /* |
@@ -643,7 +643,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
643 | } | 643 | } |
644 | } | 644 | } |
645 | 645 | ||
646 | return_ACPI_STATUS(AE_OK); | 646 | return (AE_OK); |
647 | 647 | ||
648 | error_exit: | 648 | error_exit: |
649 | 649 | ||
@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
657 | acpi_ut_delete_generic_state(state); | 657 | acpi_ut_delete_generic_state(state); |
658 | } | 658 | } |
659 | 659 | ||
660 | return_ACPI_STATUS(status); | 660 | return (status); |
661 | } | 661 | } |
662 | 662 | ||
663 | /******************************************************************************* | 663 | /******************************************************************************* |
@@ -676,12 +676,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
676 | void acpi_ut_add_reference(union acpi_operand_object *object) | 676 | void acpi_ut_add_reference(union acpi_operand_object *object) |
677 | { | 677 | { |
678 | 678 | ||
679 | ACPI_FUNCTION_TRACE_PTR(ut_add_reference, object); | 679 | ACPI_FUNCTION_NAME(ut_add_reference); |
680 | 680 | ||
681 | /* Ensure that we have a valid object */ | 681 | /* Ensure that we have a valid object */ |
682 | 682 | ||
683 | if (!acpi_ut_valid_internal_object(object)) { | 683 | if (!acpi_ut_valid_internal_object(object)) { |
684 | return_VOID; | 684 | return; |
685 | } | 685 | } |
686 | 686 | ||
687 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, | 687 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, |
@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) | |||
691 | /* Increment the reference count */ | 691 | /* Increment the reference count */ |
692 | 692 | ||
693 | (void)acpi_ut_update_object_reference(object, REF_INCREMENT); | 693 | (void)acpi_ut_update_object_reference(object, REF_INCREMENT); |
694 | return_VOID; | 694 | return; |
695 | } | 695 | } |
696 | 696 | ||
697 | /******************************************************************************* | 697 | /******************************************************************************* |
@@ -709,7 +709,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) | |||
709 | void acpi_ut_remove_reference(union acpi_operand_object *object) | 709 | void acpi_ut_remove_reference(union acpi_operand_object *object) |
710 | { | 710 | { |
711 | 711 | ||
712 | ACPI_FUNCTION_TRACE_PTR(ut_remove_reference, object); | 712 | ACPI_FUNCTION_NAME(ut_remove_reference); |
713 | 713 | ||
714 | /* | 714 | /* |
715 | * Allow a NULL pointer to be passed in, just ignore it. This saves | 715 | * 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 | */ | 718 | */ |
719 | if (!object || | 719 | if (!object || |
720 | (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) { | 720 | (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) { |
721 | return_VOID; | 721 | return; |
722 | } | 722 | } |
723 | 723 | ||
724 | /* Ensure that we have a valid object */ | 724 | /* Ensure that we have a valid object */ |
725 | 725 | ||
726 | if (!acpi_ut_valid_internal_object(object)) { | 726 | if (!acpi_ut_valid_internal_object(object)) { |
727 | return_VOID; | 727 | return; |
728 | } | 728 | } |
729 | 729 | ||
730 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, | 730 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, |
@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object) | |||
737 | * of all subobjects!) | 737 | * of all subobjects!) |
738 | */ | 738 | */ |
739 | (void)acpi_ut_update_object_reference(object, REF_DECREMENT); | 739 | (void)acpi_ut_update_object_reference(object, REF_DECREMENT); |
740 | return_VOID; | 740 | return; |
741 | } | 741 | } |
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c index cee0473ba813..26a0c23c3f4b 100644 --- a/drivers/acpi/acpica/utstate.c +++ b/drivers/acpi/acpica/utstate.c | |||
@@ -97,14 +97,13 @@ void | |||
97 | acpi_ut_push_generic_state(union acpi_generic_state **list_head, | 97 | acpi_ut_push_generic_state(union acpi_generic_state **list_head, |
98 | union acpi_generic_state *state) | 98 | union acpi_generic_state *state) |
99 | { | 99 | { |
100 | ACPI_FUNCTION_TRACE(ut_push_generic_state); | 100 | ACPI_FUNCTION_ENTRY(); |
101 | 101 | ||
102 | /* Push the state object onto the front of the list (stack) */ | 102 | /* Push the state object onto the front of the list (stack) */ |
103 | 103 | ||
104 | state->common.next = *list_head; | 104 | state->common.next = *list_head; |
105 | *list_head = state; | 105 | *list_head = state; |
106 | 106 | return; | |
107 | return_VOID; | ||
108 | } | 107 | } |
109 | 108 | ||
110 | /******************************************************************************* | 109 | /******************************************************************************* |
@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state | |||
124 | { | 123 | { |
125 | union acpi_generic_state *state; | 124 | union acpi_generic_state *state; |
126 | 125 | ||
127 | ACPI_FUNCTION_TRACE(ut_pop_generic_state); | 126 | ACPI_FUNCTION_ENTRY(); |
128 | 127 | ||
129 | /* Remove the state object at the head of the list (stack) */ | 128 | /* Remove the state object at the head of the list (stack) */ |
130 | 129 | ||
@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state | |||
136 | *list_head = state->common.next; | 135 | *list_head = state->common.next; |
137 | } | 136 | } |
138 | 137 | ||
139 | return_PTR(state); | 138 | return (state); |
140 | } | 139 | } |
141 | 140 | ||
142 | /******************************************************************************* | 141 | /******************************************************************************* |
@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) | |||
186 | { | 185 | { |
187 | union acpi_generic_state *state; | 186 | union acpi_generic_state *state; |
188 | 187 | ||
189 | ACPI_FUNCTION_TRACE(ut_create_thread_state); | 188 | ACPI_FUNCTION_ENTRY(); |
190 | 189 | ||
191 | /* Create the generic state object */ | 190 | /* Create the generic state object */ |
192 | 191 | ||
193 | state = acpi_ut_create_generic_state(); | 192 | state = acpi_ut_create_generic_state(); |
194 | if (!state) { | 193 | if (!state) { |
195 | return_PTR(NULL); | 194 | return (NULL); |
196 | } | 195 | } |
197 | 196 | ||
198 | /* Init fields specific to the update struct */ | 197 | /* Init fields specific to the update struct */ |
@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) | |||
207 | state->thread.thread_id = (acpi_thread_id) 1; | 206 | state->thread.thread_id = (acpi_thread_id) 1; |
208 | } | 207 | } |
209 | 208 | ||
210 | return_PTR((struct acpi_thread_state *)state); | 209 | return ((struct acpi_thread_state *)state); |
211 | } | 210 | } |
212 | 211 | ||
213 | /******************************************************************************* | 212 | /******************************************************************************* |
@@ -230,13 +229,13 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object | |||
230 | { | 229 | { |
231 | union acpi_generic_state *state; | 230 | union acpi_generic_state *state; |
232 | 231 | ||
233 | ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object); | 232 | ACPI_FUNCTION_ENTRY(); |
234 | 233 | ||
235 | /* Create the generic state object */ | 234 | /* Create the generic state object */ |
236 | 235 | ||
237 | state = acpi_ut_create_generic_state(); | 236 | state = acpi_ut_create_generic_state(); |
238 | if (!state) { | 237 | if (!state) { |
239 | return_PTR(NULL); | 238 | return (NULL); |
240 | } | 239 | } |
241 | 240 | ||
242 | /* Init fields specific to the update struct */ | 241 | /* 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 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE; | 243 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE; |
245 | state->update.object = object; | 244 | state->update.object = object; |
246 | state->update.value = action; | 245 | state->update.value = action; |
247 | 246 | return (state); | |
248 | return_PTR(state); | ||
249 | } | 247 | } |
250 | 248 | ||
251 | /******************************************************************************* | 249 | /******************************************************************************* |
@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, | |||
267 | { | 265 | { |
268 | union acpi_generic_state *state; | 266 | union acpi_generic_state *state; |
269 | 267 | ||
270 | ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object); | 268 | ACPI_FUNCTION_ENTRY(); |
271 | 269 | ||
272 | /* Create the generic state object */ | 270 | /* Create the generic state object */ |
273 | 271 | ||
274 | state = acpi_ut_create_generic_state(); | 272 | state = acpi_ut_create_generic_state(); |
275 | if (!state) { | 273 | if (!state) { |
276 | return_PTR(NULL); | 274 | return (NULL); |
277 | } | 275 | } |
278 | 276 | ||
279 | /* Init fields specific to the update struct */ | 277 | /* Init fields specific to the update struct */ |
@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, | |||
283 | state->pkg.dest_object = external_object; | 281 | state->pkg.dest_object = external_object; |
284 | state->pkg.index = index; | 282 | state->pkg.index = index; |
285 | state->pkg.num_packages = 1; | 283 | state->pkg.num_packages = 1; |
286 | 284 | return (state); | |
287 | return_PTR(state); | ||
288 | } | 285 | } |
289 | 286 | ||
290 | /******************************************************************************* | 287 | /******************************************************************************* |
@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void) | |||
304 | { | 301 | { |
305 | union acpi_generic_state *state; | 302 | union acpi_generic_state *state; |
306 | 303 | ||
307 | ACPI_FUNCTION_TRACE(ut_create_control_state); | 304 | ACPI_FUNCTION_ENTRY(); |
308 | 305 | ||
309 | /* Create the generic state object */ | 306 | /* Create the generic state object */ |
310 | 307 | ||
311 | state = acpi_ut_create_generic_state(); | 308 | state = acpi_ut_create_generic_state(); |
312 | if (!state) { | 309 | if (!state) { |
313 | return_PTR(NULL); | 310 | return (NULL); |
314 | } | 311 | } |
315 | 312 | ||
316 | /* Init fields specific to the control struct */ | 313 | /* Init fields specific to the control struct */ |
317 | 314 | ||
318 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; | 315 | state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; |
319 | state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; | 316 | state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; |
320 | 317 | return (state); | |
321 | return_PTR(state); | ||
322 | } | 318 | } |
323 | 319 | ||
324 | /******************************************************************************* | 320 | /******************************************************************************* |
@@ -336,12 +332,12 @@ union acpi_generic_state *acpi_ut_create_control_state(void) | |||
336 | 332 | ||
337 | void acpi_ut_delete_generic_state(union acpi_generic_state *state) | 333 | void acpi_ut_delete_generic_state(union acpi_generic_state *state) |
338 | { | 334 | { |
339 | ACPI_FUNCTION_TRACE(ut_delete_generic_state); | 335 | ACPI_FUNCTION_ENTRY(); |
340 | 336 | ||
341 | /* Ignore null state */ | 337 | /* Ignore null state */ |
342 | 338 | ||
343 | if (state) { | 339 | if (state) { |
344 | (void)acpi_os_release_object(acpi_gbl_state_cache, state); | 340 | (void)acpi_os_release_object(acpi_gbl_state_cache, state); |
345 | } | 341 | } |
346 | return_VOID; | 342 | return; |
347 | } | 343 | } |
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c index a424a9e3fea4..866f96e14ade 100644 --- a/drivers/acpi/acpica/uttrack.c +++ b/drivers/acpi/acpica/uttrack.c | |||
@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, | |||
436 | struct acpi_memory_list *mem_list; | 436 | struct acpi_memory_list *mem_list; |
437 | acpi_status status; | 437 | acpi_status status; |
438 | 438 | ||
439 | ACPI_FUNCTION_TRACE(ut_remove_allocation); | 439 | ACPI_FUNCTION_NAME(ut_remove_allocation); |
440 | 440 | ||
441 | if (acpi_gbl_disable_mem_tracking) { | 441 | if (acpi_gbl_disable_mem_tracking) { |
442 | return_ACPI_STATUS(AE_OK); | 442 | return (AE_OK); |
443 | } | 443 | } |
444 | 444 | ||
445 | mem_list = acpi_gbl_global_list; | 445 | mem_list = acpi_gbl_global_list; |
@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, | |||
450 | ACPI_ERROR((module, line, | 450 | ACPI_ERROR((module, line, |
451 | "Empty allocation list, nothing to free!")); | 451 | "Empty allocation list, nothing to free!")); |
452 | 452 | ||
453 | return_ACPI_STATUS(AE_OK); | 453 | return (AE_OK); |
454 | } | 454 | } |
455 | 455 | ||
456 | status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY); | 456 | status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY); |
457 | if (ACPI_FAILURE(status)) { | 457 | if (ACPI_FAILURE(status)) { |
458 | return_ACPI_STATUS(status); | 458 | return (status); |
459 | } | 459 | } |
460 | 460 | ||
461 | /* Unlink */ | 461 | /* Unlink */ |
@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, | |||
470 | (allocation->next)->previous = allocation->previous; | 470 | (allocation->next)->previous = allocation->previous; |
471 | } | 471 | } |
472 | 472 | ||
473 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n", | ||
474 | &allocation->user_space, allocation->size)); | ||
475 | |||
473 | /* Mark the segment as deleted */ | 476 | /* Mark the segment as deleted */ |
474 | 477 | ||
475 | ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size); | 478 | ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size); |
476 | 479 | ||
477 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n", | ||
478 | allocation->size)); | ||
479 | |||
480 | status = acpi_ut_release_mutex(ACPI_MTX_MEMORY); | 480 | status = acpi_ut_release_mutex(ACPI_MTX_MEMORY); |
481 | return_ACPI_STATUS(status); | 481 | return (status); |
482 | } | 482 | } |
483 | 483 | ||
484 | /******************************************************************************* | 484 | /******************************************************************************* |