195b482a8SLen Brown /****************************************************************************** 295b482a8SLen Brown * 388ec2860SBob Moore * Module Name: utdebug - Debug print/trace routines 495b482a8SLen Brown * 595b482a8SLen Brown *****************************************************************************/ 695b482a8SLen Brown 795b482a8SLen Brown /* 825f044e6SBob Moore * Copyright (C) 2000 - 2013, Intel Corp. 995b482a8SLen Brown * All rights reserved. 1095b482a8SLen Brown * 1195b482a8SLen Brown * Redistribution and use in source and binary forms, with or without 1295b482a8SLen Brown * modification, are permitted provided that the following conditions 1395b482a8SLen Brown * are met: 1495b482a8SLen Brown * 1. Redistributions of source code must retain the above copyright 1595b482a8SLen Brown * notice, this list of conditions, and the following disclaimer, 1695b482a8SLen Brown * without modification. 1795b482a8SLen Brown * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1895b482a8SLen Brown * substantially similar to the "NO WARRANTY" disclaimer below 1995b482a8SLen Brown * ("Disclaimer") and any redistribution must be conditioned upon 2095b482a8SLen Brown * including a substantially similar Disclaimer requirement for further 2195b482a8SLen Brown * binary redistribution. 2295b482a8SLen Brown * 3. Neither the names of the above-listed copyright holders nor the names 2395b482a8SLen Brown * of any contributors may be used to endorse or promote products derived 2495b482a8SLen Brown * from this software without specific prior written permission. 2595b482a8SLen Brown * 2695b482a8SLen Brown * Alternatively, this software may be distributed under the terms of the 2795b482a8SLen Brown * GNU General Public License ("GPL") version 2 as published by the Free 2895b482a8SLen Brown * Software Foundation. 2995b482a8SLen Brown * 3095b482a8SLen Brown * NO WARRANTY 3195b482a8SLen Brown * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3295b482a8SLen Brown * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3395b482a8SLen Brown * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3495b482a8SLen Brown * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3595b482a8SLen Brown * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3695b482a8SLen Brown * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3795b482a8SLen Brown * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3895b482a8SLen Brown * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3995b482a8SLen Brown * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 4095b482a8SLen Brown * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4195b482a8SLen Brown * POSSIBILITY OF SUCH DAMAGES. 4295b482a8SLen Brown */ 4395b482a8SLen Brown 44839e928fSLv Zheng #define EXPORT_ACPI_INTERFACES 45839e928fSLv Zheng 4695b482a8SLen Brown #include <acpi/acpi.h> 47e2f7a777SLen Brown #include "accommon.h" 4895b482a8SLen Brown 4995b482a8SLen Brown #define _COMPONENT ACPI_UTILITIES 5095b482a8SLen Brown ACPI_MODULE_NAME("utdebug") 516d33b6beSLv Zheng 5295b482a8SLen Brown #ifdef ACPI_DEBUG_OUTPUT 536d33b6beSLv Zheng static acpi_thread_id acpi_gbl_prev_thread_id = (acpi_thread_id) 0xFFFFFFFF; 5495b482a8SLen Brown static char *acpi_gbl_fn_entry_str = "----Entry"; 5595b482a8SLen Brown static char *acpi_gbl_fn_exit_str = "----Exit-"; 5695b482a8SLen Brown 5795b482a8SLen Brown /* Local prototypes */ 5895b482a8SLen Brown 5995b482a8SLen Brown static const char *acpi_ut_trim_function_name(const char *function_name); 6095b482a8SLen Brown 6195b482a8SLen Brown /******************************************************************************* 6295b482a8SLen Brown * 6395b482a8SLen Brown * FUNCTION: acpi_ut_init_stack_ptr_trace 6495b482a8SLen Brown * 6595b482a8SLen Brown * PARAMETERS: None 6695b482a8SLen Brown * 6795b482a8SLen Brown * RETURN: None 6895b482a8SLen Brown * 6995b482a8SLen Brown * DESCRIPTION: Save the current CPU stack pointer at subsystem startup 7095b482a8SLen Brown * 7195b482a8SLen Brown ******************************************************************************/ 7295b482a8SLen Brown 7395b482a8SLen Brown void acpi_ut_init_stack_ptr_trace(void) 7495b482a8SLen Brown { 7595b482a8SLen Brown acpi_size current_sp; 7695b482a8SLen Brown 7795b482a8SLen Brown acpi_gbl_entry_stack_pointer = ¤t_sp; 7895b482a8SLen Brown } 7995b482a8SLen Brown 8095b482a8SLen Brown /******************************************************************************* 8195b482a8SLen Brown * 8295b482a8SLen Brown * FUNCTION: acpi_ut_track_stack_ptr 8395b482a8SLen Brown * 8495b482a8SLen Brown * PARAMETERS: None 8595b482a8SLen Brown * 8695b482a8SLen Brown * RETURN: None 8795b482a8SLen Brown * 8895b482a8SLen Brown * DESCRIPTION: Save the current CPU stack pointer 8995b482a8SLen Brown * 9095b482a8SLen Brown ******************************************************************************/ 9195b482a8SLen Brown 9295b482a8SLen Brown void acpi_ut_track_stack_ptr(void) 9395b482a8SLen Brown { 9495b482a8SLen Brown acpi_size current_sp; 9595b482a8SLen Brown 9695b482a8SLen Brown if (¤t_sp < acpi_gbl_lowest_stack_pointer) { 9795b482a8SLen Brown acpi_gbl_lowest_stack_pointer = ¤t_sp; 9895b482a8SLen Brown } 9995b482a8SLen Brown 10095b482a8SLen Brown if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) { 10195b482a8SLen Brown acpi_gbl_deepest_nesting = acpi_gbl_nesting_level; 10295b482a8SLen Brown } 10395b482a8SLen Brown } 10495b482a8SLen Brown 10595b482a8SLen Brown /******************************************************************************* 10695b482a8SLen Brown * 10795b482a8SLen Brown * FUNCTION: acpi_ut_trim_function_name 10895b482a8SLen Brown * 10995b482a8SLen Brown * PARAMETERS: function_name - Ascii string containing a procedure name 11095b482a8SLen Brown * 11195b482a8SLen Brown * RETURN: Updated pointer to the function name 11295b482a8SLen Brown * 11395b482a8SLen Brown * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present. 1146d33b6beSLv Zheng * This allows compiler macros such as __FUNCTION__ to be used 11595b482a8SLen Brown * with no change to the debug output. 11695b482a8SLen Brown * 11795b482a8SLen Brown ******************************************************************************/ 11895b482a8SLen Brown 11995b482a8SLen Brown static const char *acpi_ut_trim_function_name(const char *function_name) 12095b482a8SLen Brown { 12195b482a8SLen Brown 12295b482a8SLen Brown /* All Function names are longer than 4 chars, check is safe */ 12395b482a8SLen Brown 12495b482a8SLen Brown if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { 12595b482a8SLen Brown 12695b482a8SLen Brown /* This is the case where the original source has not been modified */ 12795b482a8SLen Brown 12895b482a8SLen Brown return (function_name + 4); 12995b482a8SLen Brown } 13095b482a8SLen Brown 13195b482a8SLen Brown if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { 13295b482a8SLen Brown 13395b482a8SLen Brown /* This is the case where the source has been 'linuxized' */ 13495b482a8SLen Brown 13595b482a8SLen Brown return (function_name + 5); 13695b482a8SLen Brown } 13795b482a8SLen Brown 13895b482a8SLen Brown return (function_name); 13995b482a8SLen Brown } 14095b482a8SLen Brown 14195b482a8SLen Brown /******************************************************************************* 14295b482a8SLen Brown * 14395b482a8SLen Brown * FUNCTION: acpi_debug_print 14495b482a8SLen Brown * 14595b482a8SLen Brown * PARAMETERS: requested_debug_level - Requested debug print level 14695b482a8SLen Brown * line_number - Caller's line number (for error output) 14795b482a8SLen Brown * function_name - Caller's procedure name 14895b482a8SLen Brown * module_name - Caller's module name 14995b482a8SLen Brown * component_id - Caller's component ID 150ba494beeSBob Moore * format - Printf format field 15195b482a8SLen Brown * ... - Optional printf arguments 15295b482a8SLen Brown * 15395b482a8SLen Brown * RETURN: None 15495b482a8SLen Brown * 15595b482a8SLen Brown * DESCRIPTION: Print error message with prefix consisting of the module name, 15695b482a8SLen Brown * line number, and component ID. 15795b482a8SLen Brown * 15895b482a8SLen Brown ******************************************************************************/ 15995b482a8SLen Brown 16095b482a8SLen Brown void ACPI_INTERNAL_VAR_XFACE 16195b482a8SLen Brown acpi_debug_print(u32 requested_debug_level, 16295b482a8SLen Brown u32 line_number, 16395b482a8SLen Brown const char *function_name, 16495b482a8SLen Brown const char *module_name, 16595b482a8SLen Brown u32 component_id, const char *format, ...) 16695b482a8SLen Brown { 16795b482a8SLen Brown acpi_thread_id thread_id; 16895b482a8SLen Brown va_list args; 16995b482a8SLen Brown 170db38bf5aSBob Moore /* Check if debug output enabled */ 171db38bf5aSBob Moore 172db38bf5aSBob Moore if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { 17395b482a8SLen Brown return; 17495b482a8SLen Brown } 17595b482a8SLen Brown 17695b482a8SLen Brown /* 17795b482a8SLen Brown * Thread tracking and context switch notification 17895b482a8SLen Brown */ 17995b482a8SLen Brown thread_id = acpi_os_get_thread_id(); 18095b482a8SLen Brown if (thread_id != acpi_gbl_prev_thread_id) { 18195b482a8SLen Brown if (ACPI_LV_THREADS & acpi_dbg_level) { 18295b482a8SLen Brown acpi_os_printf 18328eb3fcfSLin Ming ("\n**** Context Switch from TID %u to TID %u ****\n\n", 18428eb3fcfSLin Ming (u32)acpi_gbl_prev_thread_id, (u32)thread_id); 18595b482a8SLen Brown } 18695b482a8SLen Brown 18795b482a8SLen Brown acpi_gbl_prev_thread_id = thread_id; 188*bf9b448eSBob Moore acpi_gbl_nesting_level = 0; 18995b482a8SLen Brown } 19095b482a8SLen Brown 19195b482a8SLen Brown /* 19295b482a8SLen Brown * Display the module name, current line number, thread ID (if requested), 19395b482a8SLen Brown * current procedure nesting level, and the current procedure name 19495b482a8SLen Brown */ 1952856846eSBob Moore acpi_os_printf("%9s-%04ld ", module_name, line_number); 19695b482a8SLen Brown 197*bf9b448eSBob Moore #ifdef ACPI_EXEC_APP 198*bf9b448eSBob Moore /* 199*bf9b448eSBob Moore * For acpi_exec only, emit the thread ID and nesting level. 200*bf9b448eSBob Moore * Note: nesting level is really only useful during a single-thread 201*bf9b448eSBob Moore * execution. Otherwise, multiple threads will keep resetting the 202*bf9b448eSBob Moore * level. 203*bf9b448eSBob Moore */ 20495b482a8SLen Brown if (ACPI_LV_THREADS & acpi_dbg_level) { 20528eb3fcfSLin Ming acpi_os_printf("[%u] ", (u32)thread_id); 20695b482a8SLen Brown } 20795b482a8SLen Brown 208*bf9b448eSBob Moore acpi_os_printf("[%02ld] ", acpi_gbl_nesting_level); 209*bf9b448eSBob Moore #endif 210*bf9b448eSBob Moore 211*bf9b448eSBob Moore acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); 21295b482a8SLen Brown 21395b482a8SLen Brown va_start(args, format); 21495b482a8SLen Brown acpi_os_vprintf(format, args); 21595b482a8SLen Brown va_end(args); 21695b482a8SLen Brown } 21795b482a8SLen Brown 21895b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_debug_print) 21995b482a8SLen Brown 22095b482a8SLen Brown /******************************************************************************* 22195b482a8SLen Brown * 22295b482a8SLen Brown * FUNCTION: acpi_debug_print_raw 22395b482a8SLen Brown * 22495b482a8SLen Brown * PARAMETERS: requested_debug_level - Requested debug print level 22595b482a8SLen Brown * line_number - Caller's line number 22695b482a8SLen Brown * function_name - Caller's procedure name 22795b482a8SLen Brown * module_name - Caller's module name 22895b482a8SLen Brown * component_id - Caller's component ID 229ba494beeSBob Moore * format - Printf format field 23095b482a8SLen Brown * ... - Optional printf arguments 23195b482a8SLen Brown * 23295b482a8SLen Brown * RETURN: None 23395b482a8SLen Brown * 23495b482a8SLen Brown * DESCRIPTION: Print message with no headers. Has same interface as 23595b482a8SLen Brown * debug_print so that the same macros can be used. 23695b482a8SLen Brown * 23795b482a8SLen Brown ******************************************************************************/ 23895b482a8SLen Brown void ACPI_INTERNAL_VAR_XFACE 23995b482a8SLen Brown acpi_debug_print_raw(u32 requested_debug_level, 24095b482a8SLen Brown u32 line_number, 24195b482a8SLen Brown const char *function_name, 24295b482a8SLen Brown const char *module_name, 24395b482a8SLen Brown u32 component_id, const char *format, ...) 24495b482a8SLen Brown { 24595b482a8SLen Brown va_list args; 24695b482a8SLen Brown 247db38bf5aSBob Moore /* Check if debug output enabled */ 248db38bf5aSBob Moore 249db38bf5aSBob Moore if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { 25095b482a8SLen Brown return; 25195b482a8SLen Brown } 25295b482a8SLen Brown 25395b482a8SLen Brown va_start(args, format); 25495b482a8SLen Brown acpi_os_vprintf(format, args); 25595b482a8SLen Brown va_end(args); 25695b482a8SLen Brown } 25795b482a8SLen Brown 25895b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_debug_print_raw) 25995b482a8SLen Brown 26095b482a8SLen Brown /******************************************************************************* 26195b482a8SLen Brown * 26295b482a8SLen Brown * FUNCTION: acpi_ut_trace 26395b482a8SLen Brown * 26495b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 26595b482a8SLen Brown * function_name - Caller's procedure name 26695b482a8SLen Brown * module_name - Caller's module name 26795b482a8SLen Brown * component_id - Caller's component ID 26895b482a8SLen Brown * 26995b482a8SLen Brown * RETURN: None 27095b482a8SLen Brown * 27195b482a8SLen Brown * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 27295b482a8SLen Brown * set in debug_level 27395b482a8SLen Brown * 27495b482a8SLen Brown ******************************************************************************/ 27595b482a8SLen Brown void 27695b482a8SLen Brown acpi_ut_trace(u32 line_number, 27795b482a8SLen Brown const char *function_name, 27895b482a8SLen Brown const char *module_name, u32 component_id) 27995b482a8SLen Brown { 28095b482a8SLen Brown 28195b482a8SLen Brown acpi_gbl_nesting_level++; 28295b482a8SLen Brown acpi_ut_track_stack_ptr(); 28395b482a8SLen Brown 284db38bf5aSBob Moore /* Check if enabled up-front for performance */ 285db38bf5aSBob Moore 286db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 28795b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 288db38bf5aSBob Moore line_number, function_name, module_name, 289db38bf5aSBob Moore component_id, "%s\n", acpi_gbl_fn_entry_str); 290db38bf5aSBob Moore } 29195b482a8SLen Brown } 29295b482a8SLen Brown 29395b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_ut_trace) 29495b482a8SLen Brown 29595b482a8SLen Brown /******************************************************************************* 29695b482a8SLen Brown * 29795b482a8SLen Brown * FUNCTION: acpi_ut_trace_ptr 29895b482a8SLen Brown * 29995b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 30095b482a8SLen Brown * function_name - Caller's procedure name 30195b482a8SLen Brown * module_name - Caller's module name 30295b482a8SLen Brown * component_id - Caller's component ID 303ba494beeSBob Moore * pointer - Pointer to display 30495b482a8SLen Brown * 30595b482a8SLen Brown * RETURN: None 30695b482a8SLen Brown * 30795b482a8SLen Brown * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 30895b482a8SLen Brown * set in debug_level 30995b482a8SLen Brown * 31095b482a8SLen Brown ******************************************************************************/ 31195b482a8SLen Brown void 31295b482a8SLen Brown acpi_ut_trace_ptr(u32 line_number, 31395b482a8SLen Brown const char *function_name, 31495b482a8SLen Brown const char *module_name, u32 component_id, void *pointer) 31595b482a8SLen Brown { 31668aafc35SBob Moore 31795b482a8SLen Brown acpi_gbl_nesting_level++; 31895b482a8SLen Brown acpi_ut_track_stack_ptr(); 31995b482a8SLen Brown 320db38bf5aSBob Moore /* Check if enabled up-front for performance */ 321db38bf5aSBob Moore 322db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 32395b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 324db38bf5aSBob Moore line_number, function_name, module_name, 325db38bf5aSBob Moore component_id, "%s %p\n", acpi_gbl_fn_entry_str, 326db38bf5aSBob Moore pointer); 327db38bf5aSBob Moore } 32895b482a8SLen Brown } 32995b482a8SLen Brown 33095b482a8SLen Brown /******************************************************************************* 33195b482a8SLen Brown * 33295b482a8SLen Brown * FUNCTION: acpi_ut_trace_str 33395b482a8SLen Brown * 33495b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 33595b482a8SLen Brown * function_name - Caller's procedure name 33695b482a8SLen Brown * module_name - Caller's module name 33795b482a8SLen Brown * component_id - Caller's component ID 338ba494beeSBob Moore * string - Additional string to display 33995b482a8SLen Brown * 34095b482a8SLen Brown * RETURN: None 34195b482a8SLen Brown * 34295b482a8SLen Brown * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 34395b482a8SLen Brown * set in debug_level 34495b482a8SLen Brown * 34595b482a8SLen Brown ******************************************************************************/ 34695b482a8SLen Brown 34795b482a8SLen Brown void 34895b482a8SLen Brown acpi_ut_trace_str(u32 line_number, 34995b482a8SLen Brown const char *function_name, 35095b482a8SLen Brown const char *module_name, u32 component_id, char *string) 35195b482a8SLen Brown { 35295b482a8SLen Brown 35395b482a8SLen Brown acpi_gbl_nesting_level++; 35495b482a8SLen Brown acpi_ut_track_stack_ptr(); 35595b482a8SLen Brown 356db38bf5aSBob Moore /* Check if enabled up-front for performance */ 357db38bf5aSBob Moore 358db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 35995b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 360db38bf5aSBob Moore line_number, function_name, module_name, 361db38bf5aSBob Moore component_id, "%s %s\n", acpi_gbl_fn_entry_str, 362db38bf5aSBob Moore string); 363db38bf5aSBob Moore } 36495b482a8SLen Brown } 36595b482a8SLen Brown 36695b482a8SLen Brown /******************************************************************************* 36795b482a8SLen Brown * 36895b482a8SLen Brown * FUNCTION: acpi_ut_trace_u32 36995b482a8SLen Brown * 37095b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 37195b482a8SLen Brown * function_name - Caller's procedure name 37295b482a8SLen Brown * module_name - Caller's module name 37395b482a8SLen Brown * component_id - Caller's component ID 374ba494beeSBob Moore * integer - Integer to display 37595b482a8SLen Brown * 37695b482a8SLen Brown * RETURN: None 37795b482a8SLen Brown * 37895b482a8SLen Brown * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is 37995b482a8SLen Brown * set in debug_level 38095b482a8SLen Brown * 38195b482a8SLen Brown ******************************************************************************/ 38295b482a8SLen Brown 38395b482a8SLen Brown void 38495b482a8SLen Brown acpi_ut_trace_u32(u32 line_number, 38595b482a8SLen Brown const char *function_name, 38695b482a8SLen Brown const char *module_name, u32 component_id, u32 integer) 38795b482a8SLen Brown { 38895b482a8SLen Brown 38995b482a8SLen Brown acpi_gbl_nesting_level++; 39095b482a8SLen Brown acpi_ut_track_stack_ptr(); 39195b482a8SLen Brown 392db38bf5aSBob Moore /* Check if enabled up-front for performance */ 393db38bf5aSBob Moore 394db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 39595b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 396db38bf5aSBob Moore line_number, function_name, module_name, 397db38bf5aSBob Moore component_id, "%s %08X\n", 398db38bf5aSBob Moore acpi_gbl_fn_entry_str, integer); 399db38bf5aSBob Moore } 40095b482a8SLen Brown } 40195b482a8SLen Brown 40295b482a8SLen Brown /******************************************************************************* 40395b482a8SLen Brown * 40495b482a8SLen Brown * FUNCTION: acpi_ut_exit 40595b482a8SLen Brown * 40695b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 40795b482a8SLen Brown * function_name - Caller's procedure name 40895b482a8SLen Brown * module_name - Caller's module name 40995b482a8SLen Brown * component_id - Caller's component ID 41095b482a8SLen Brown * 41195b482a8SLen Brown * RETURN: None 41295b482a8SLen Brown * 41395b482a8SLen Brown * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 41495b482a8SLen Brown * set in debug_level 41595b482a8SLen Brown * 41695b482a8SLen Brown ******************************************************************************/ 41795b482a8SLen Brown 41895b482a8SLen Brown void 41995b482a8SLen Brown acpi_ut_exit(u32 line_number, 42095b482a8SLen Brown const char *function_name, 42195b482a8SLen Brown const char *module_name, u32 component_id) 42295b482a8SLen Brown { 42395b482a8SLen Brown 424db38bf5aSBob Moore /* Check if enabled up-front for performance */ 425db38bf5aSBob Moore 426db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 42795b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 428db38bf5aSBob Moore line_number, function_name, module_name, 429db38bf5aSBob Moore component_id, "%s\n", acpi_gbl_fn_exit_str); 430db38bf5aSBob Moore } 43195b482a8SLen Brown 432*bf9b448eSBob Moore if (acpi_gbl_nesting_level) { 43395b482a8SLen Brown acpi_gbl_nesting_level--; 43495b482a8SLen Brown } 435*bf9b448eSBob Moore } 43695b482a8SLen Brown 43795b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_ut_exit) 43895b482a8SLen Brown 43995b482a8SLen Brown /******************************************************************************* 44095b482a8SLen Brown * 44195b482a8SLen Brown * FUNCTION: acpi_ut_status_exit 44295b482a8SLen Brown * 44395b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 44495b482a8SLen Brown * function_name - Caller's procedure name 44595b482a8SLen Brown * module_name - Caller's module name 44695b482a8SLen Brown * component_id - Caller's component ID 447ba494beeSBob Moore * status - Exit status code 44895b482a8SLen Brown * 44995b482a8SLen Brown * RETURN: None 45095b482a8SLen Brown * 45195b482a8SLen Brown * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 45295b482a8SLen Brown * set in debug_level. Prints exit status also. 45395b482a8SLen Brown * 45495b482a8SLen Brown ******************************************************************************/ 45595b482a8SLen Brown void 45695b482a8SLen Brown acpi_ut_status_exit(u32 line_number, 45795b482a8SLen Brown const char *function_name, 45895b482a8SLen Brown const char *module_name, 45995b482a8SLen Brown u32 component_id, acpi_status status) 46095b482a8SLen Brown { 46195b482a8SLen Brown 462db38bf5aSBob Moore /* Check if enabled up-front for performance */ 463db38bf5aSBob Moore 464db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 46595b482a8SLen Brown if (ACPI_SUCCESS(status)) { 46695b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 467db38bf5aSBob Moore line_number, function_name, 468db38bf5aSBob Moore module_name, component_id, "%s %s\n", 469db38bf5aSBob Moore acpi_gbl_fn_exit_str, 47095b482a8SLen Brown acpi_format_exception(status)); 47195b482a8SLen Brown } else { 47295b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 473db38bf5aSBob Moore line_number, function_name, 474db38bf5aSBob Moore module_name, component_id, 475db38bf5aSBob Moore "%s ****Exception****: %s\n", 47695b482a8SLen Brown acpi_gbl_fn_exit_str, 47795b482a8SLen Brown acpi_format_exception(status)); 47895b482a8SLen Brown } 479db38bf5aSBob Moore } 48095b482a8SLen Brown 481*bf9b448eSBob Moore if (acpi_gbl_nesting_level) { 48295b482a8SLen Brown acpi_gbl_nesting_level--; 48395b482a8SLen Brown } 484*bf9b448eSBob Moore } 48595b482a8SLen Brown 48695b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) 48795b482a8SLen Brown 48895b482a8SLen Brown /******************************************************************************* 48995b482a8SLen Brown * 49095b482a8SLen Brown * FUNCTION: acpi_ut_value_exit 49195b482a8SLen Brown * 49295b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 49395b482a8SLen Brown * function_name - Caller's procedure name 49495b482a8SLen Brown * module_name - Caller's module name 49595b482a8SLen Brown * component_id - Caller's component ID 496ba494beeSBob Moore * value - Value to be printed with exit msg 49795b482a8SLen Brown * 49895b482a8SLen Brown * RETURN: None 49995b482a8SLen Brown * 50095b482a8SLen Brown * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 50195b482a8SLen Brown * set in debug_level. Prints exit value also. 50295b482a8SLen Brown * 50395b482a8SLen Brown ******************************************************************************/ 50495b482a8SLen Brown void 50595b482a8SLen Brown acpi_ut_value_exit(u32 line_number, 50695b482a8SLen Brown const char *function_name, 5075df7e6cbSBob Moore const char *module_name, u32 component_id, u64 value) 50895b482a8SLen Brown { 50995b482a8SLen Brown 510db38bf5aSBob Moore /* Check if enabled up-front for performance */ 511db38bf5aSBob Moore 512db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 51395b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 514db38bf5aSBob Moore line_number, function_name, module_name, 515db38bf5aSBob Moore component_id, "%s %8.8X%8.8X\n", 516db38bf5aSBob Moore acpi_gbl_fn_exit_str, 51795b482a8SLen Brown ACPI_FORMAT_UINT64(value)); 518db38bf5aSBob Moore } 51995b482a8SLen Brown 520*bf9b448eSBob Moore if (acpi_gbl_nesting_level) { 52195b482a8SLen Brown acpi_gbl_nesting_level--; 52295b482a8SLen Brown } 523*bf9b448eSBob Moore } 52495b482a8SLen Brown 52595b482a8SLen Brown ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) 52695b482a8SLen Brown 52795b482a8SLen Brown /******************************************************************************* 52895b482a8SLen Brown * 52995b482a8SLen Brown * FUNCTION: acpi_ut_ptr_exit 53095b482a8SLen Brown * 53195b482a8SLen Brown * PARAMETERS: line_number - Caller's line number 53295b482a8SLen Brown * function_name - Caller's procedure name 53395b482a8SLen Brown * module_name - Caller's module name 53495b482a8SLen Brown * component_id - Caller's component ID 535ba494beeSBob Moore * ptr - Pointer to display 53695b482a8SLen Brown * 53795b482a8SLen Brown * RETURN: None 53895b482a8SLen Brown * 53995b482a8SLen Brown * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is 54095b482a8SLen Brown * set in debug_level. Prints exit value also. 54195b482a8SLen Brown * 54295b482a8SLen Brown ******************************************************************************/ 54395b482a8SLen Brown void 54495b482a8SLen Brown acpi_ut_ptr_exit(u32 line_number, 54595b482a8SLen Brown const char *function_name, 54695b482a8SLen Brown const char *module_name, u32 component_id, u8 *ptr) 54795b482a8SLen Brown { 54895b482a8SLen Brown 549db38bf5aSBob Moore /* Check if enabled up-front for performance */ 550db38bf5aSBob Moore 551db38bf5aSBob Moore if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { 55295b482a8SLen Brown acpi_debug_print(ACPI_LV_FUNCTIONS, 553db38bf5aSBob Moore line_number, function_name, module_name, 554db38bf5aSBob Moore component_id, "%s %p\n", acpi_gbl_fn_exit_str, 555db38bf5aSBob Moore ptr); 556db38bf5aSBob Moore } 55795b482a8SLen Brown 558*bf9b448eSBob Moore if (acpi_gbl_nesting_level) { 55995b482a8SLen Brown acpi_gbl_nesting_level--; 56095b482a8SLen Brown } 561*bf9b448eSBob Moore } 56295b482a8SLen Brown 56395b482a8SLen Brown #endif 564