Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Bob Moore | 88ec286 | 2013-06-08 00:57:47 +0000 | [diff] [blame] | 3 | * Module Name: utdebug - Debug print/trace routines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
Bob Moore | c8100dc | 2016-01-15 08:17:03 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2016, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Lv Zheng | 839e928 | 2013-10-29 09:29:51 +0800 | [diff] [blame] | 44 | #define EXPORT_ACPI_INTERFACES |
| 45 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #include <acpi/acpi.h> |
Len Brown | e2f7a77 | 2009-01-09 00:30:03 -0500 | [diff] [blame] | 47 | #include "accommon.h" |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 48 | #include "acinterp.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | #define _COMPONENT ACPI_UTILITIES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 51 | ACPI_MODULE_NAME("utdebug") |
Lv Zheng | 6d33b6b | 2012-10-31 02:25:05 +0000 | [diff] [blame] | 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | #ifdef ACPI_DEBUG_OUTPUT |
Lv Zheng | 6d33b6b | 2012-10-31 02:25:05 +0000 | [diff] [blame] | 54 | static acpi_thread_id acpi_gbl_prev_thread_id = (acpi_thread_id) 0xFFFFFFFF; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 55 | static char *acpi_gbl_fn_entry_str = "----Entry"; |
| 56 | static char *acpi_gbl_fn_exit_str = "----Exit-"; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 58 | /* Local prototypes */ |
| 59 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 60 | static const char *acpi_ut_trim_function_name(const char *function_name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 62 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | * |
| 64 | * FUNCTION: acpi_ut_init_stack_ptr_trace |
| 65 | * |
| 66 | * PARAMETERS: None |
| 67 | * |
| 68 | * RETURN: None |
| 69 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 70 | * DESCRIPTION: Save the current CPU stack pointer at subsystem startup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 72 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 74 | void acpi_ut_init_stack_ptr_trace(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | { |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 76 | acpi_size current_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 78 | acpi_gbl_entry_stack_pointer = ¤t_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 81 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | * |
| 83 | * FUNCTION: acpi_ut_track_stack_ptr |
| 84 | * |
| 85 | * PARAMETERS: None |
| 86 | * |
| 87 | * RETURN: None |
| 88 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 89 | * DESCRIPTION: Save the current CPU stack pointer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 91 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 93 | void acpi_ut_track_stack_ptr(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 95 | acpi_size current_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 97 | if (¤t_sp < acpi_gbl_lowest_stack_pointer) { |
| 98 | acpi_gbl_lowest_stack_pointer = ¤t_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) { |
| 102 | acpi_gbl_deepest_nesting = acpi_gbl_nesting_level; |
| 103 | } |
| 104 | } |
| 105 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 106 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | * |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 108 | * FUNCTION: acpi_ut_trim_function_name |
| 109 | * |
| 110 | * PARAMETERS: function_name - Ascii string containing a procedure name |
| 111 | * |
| 112 | * RETURN: Updated pointer to the function name |
| 113 | * |
| 114 | * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present. |
Lv Zheng | 7011bf4 | 2015-06-19 11:38:22 +0800 | [diff] [blame] | 115 | * This allows compiler macros such as __func__ to be used |
| 116 | * with no change to the debug output. |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 117 | * |
| 118 | ******************************************************************************/ |
| 119 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 120 | static const char *acpi_ut_trim_function_name(const char *function_name) |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 121 | { |
| 122 | |
| 123 | /* All Function names are longer than 4 chars, check is safe */ |
| 124 | |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 125 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 126 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 127 | /* This is the case where the original source has not been modified */ |
| 128 | |
| 129 | return (function_name + 4); |
| 130 | } |
| 131 | |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 132 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 133 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 134 | /* This is the case where the source has been 'linuxized' */ |
| 135 | |
| 136 | return (function_name + 5); |
| 137 | } |
| 138 | |
| 139 | return (function_name); |
| 140 | } |
| 141 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 142 | /******************************************************************************* |
| 143 | * |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 144 | * FUNCTION: acpi_debug_print |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 146 | * PARAMETERS: requested_debug_level - Requested debug print level |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | * line_number - Caller's line number (for error output) |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 148 | * function_name - Caller's procedure name |
| 149 | * module_name - Caller's module name |
| 150 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 151 | * format - Printf format field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | * ... - Optional printf arguments |
| 153 | * |
| 154 | * RETURN: None |
| 155 | * |
| 156 | * DESCRIPTION: Print error message with prefix consisting of the module name, |
| 157 | * line number, and component ID. |
| 158 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 159 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 161 | void ACPI_INTERNAL_VAR_XFACE |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 162 | acpi_debug_print(u32 requested_debug_level, |
| 163 | u32 line_number, |
| 164 | const char *function_name, |
| 165 | const char *module_name, |
| 166 | u32 component_id, const char *format, ...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | { |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 168 | acpi_thread_id thread_id; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 169 | va_list args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 171 | /* Check if debug output enabled */ |
| 172 | |
| 173 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | return; |
| 175 | } |
| 176 | |
| 177 | /* |
| 178 | * Thread tracking and context switch notification |
| 179 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 180 | thread_id = acpi_os_get_thread_id(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | if (thread_id != acpi_gbl_prev_thread_id) { |
| 182 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 183 | acpi_os_printf |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 184 | ("\n**** Context Switch from TID %u to TID %u ****\n\n", |
| 185 | (u32)acpi_gbl_prev_thread_id, (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | acpi_gbl_prev_thread_id = thread_id; |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 189 | acpi_gbl_nesting_level = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | /* |
| 193 | * Display the module name, current line number, thread ID (if requested), |
| 194 | * current procedure nesting level, and the current procedure name |
| 195 | */ |
Bob Moore | 2856846 | 2013-09-23 09:51:39 +0800 | [diff] [blame] | 196 | acpi_os_printf("%9s-%04ld ", module_name, line_number); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 198 | #ifdef ACPI_APPLICATION |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 199 | /* |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 200 | * For acpi_exec/iASL only, emit the thread ID and nesting level. |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 201 | * Note: nesting level is really only useful during a single-thread |
| 202 | * execution. Otherwise, multiple threads will keep resetting the |
| 203 | * level. |
| 204 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 206 | acpi_os_printf("[%u] ", (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | } |
| 208 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 209 | acpi_os_printf("[%02ld] ", acpi_gbl_nesting_level); |
| 210 | #endif |
| 211 | |
| 212 | acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 214 | va_start(args, format); |
| 215 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 216 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 218 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 219 | ACPI_EXPORT_SYMBOL(acpi_debug_print) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 221 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | * |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 223 | * FUNCTION: acpi_debug_print_raw |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | * |
| 225 | * PARAMETERS: requested_debug_level - Requested debug print level |
| 226 | * line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 227 | * function_name - Caller's procedure name |
| 228 | * module_name - Caller's module name |
| 229 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 230 | * format - Printf format field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | * ... - Optional printf arguments |
| 232 | * |
| 233 | * RETURN: None |
| 234 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 235 | * DESCRIPTION: Print message with no headers. Has same interface as |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | * debug_print so that the same macros can be used. |
| 237 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 238 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 239 | void ACPI_INTERNAL_VAR_XFACE |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 240 | acpi_debug_print_raw(u32 requested_debug_level, |
| 241 | u32 line_number, |
| 242 | const char *function_name, |
| 243 | const char *module_name, |
| 244 | u32 component_id, const char *format, ...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 246 | va_list args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 248 | /* Check if debug output enabled */ |
| 249 | |
| 250 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | return; |
| 252 | } |
| 253 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 254 | va_start(args, format); |
| 255 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 256 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 259 | ACPI_EXPORT_SYMBOL(acpi_debug_print_raw) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 261 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | * |
| 263 | * FUNCTION: acpi_ut_trace |
| 264 | * |
| 265 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 266 | * function_name - Caller's procedure name |
| 267 | * module_name - Caller's module name |
| 268 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | * |
| 270 | * RETURN: None |
| 271 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 272 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | * set in debug_level |
| 274 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 275 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 277 | acpi_ut_trace(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 278 | const char *function_name, |
| 279 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | { |
| 281 | |
| 282 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 283 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 285 | /* Check if enabled up-front for performance */ |
| 286 | |
| 287 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 288 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 289 | line_number, function_name, module_name, |
| 290 | component_id, "%s\n", acpi_gbl_fn_entry_str); |
| 291 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 294 | ACPI_EXPORT_SYMBOL(acpi_ut_trace) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 296 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | * |
| 298 | * FUNCTION: acpi_ut_trace_ptr |
| 299 | * |
| 300 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 301 | * function_name - Caller's procedure name |
| 302 | * module_name - Caller's module name |
| 303 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 304 | * pointer - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | * |
| 306 | * RETURN: None |
| 307 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 308 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | * set in debug_level |
| 310 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 311 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 313 | acpi_ut_trace_ptr(u32 line_number, |
| 314 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 315 | const char *module_name, u32 component_id, void *pointer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | { |
Bob Moore | 68aafc3 | 2012-10-31 02:26:01 +0000 | [diff] [blame] | 317 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 319 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 321 | /* Check if enabled up-front for performance */ |
| 322 | |
| 323 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 324 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 325 | line_number, function_name, module_name, |
| 326 | component_id, "%s %p\n", acpi_gbl_fn_entry_str, |
| 327 | pointer); |
| 328 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 329 | } |
| 330 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 331 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | * |
| 333 | * FUNCTION: acpi_ut_trace_str |
| 334 | * |
| 335 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 336 | * function_name - Caller's procedure name |
| 337 | * module_name - Caller's module name |
| 338 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 339 | * string - Additional string to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | * |
| 341 | * RETURN: None |
| 342 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 343 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | * set in debug_level |
| 345 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 346 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | |
| 348 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 349 | acpi_ut_trace_str(u32 line_number, |
| 350 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 351 | const char *module_name, u32 component_id, char *string) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | { |
| 353 | |
| 354 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 355 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 357 | /* Check if enabled up-front for performance */ |
| 358 | |
| 359 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 360 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 361 | line_number, function_name, module_name, |
| 362 | component_id, "%s %s\n", acpi_gbl_fn_entry_str, |
| 363 | string); |
| 364 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 365 | } |
| 366 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 367 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | * |
| 369 | * FUNCTION: acpi_ut_trace_u32 |
| 370 | * |
| 371 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 372 | * function_name - Caller's procedure name |
| 373 | * module_name - Caller's module name |
| 374 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 375 | * integer - Integer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | * |
| 377 | * RETURN: None |
| 378 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 379 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 380 | * set in debug_level |
| 381 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 382 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | |
| 384 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 385 | acpi_ut_trace_u32(u32 line_number, |
| 386 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 387 | const char *module_name, u32 component_id, u32 integer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | { |
| 389 | |
| 390 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 391 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 392 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 393 | /* Check if enabled up-front for performance */ |
| 394 | |
| 395 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 396 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 397 | line_number, function_name, module_name, |
| 398 | component_id, "%s %08X\n", |
| 399 | acpi_gbl_fn_entry_str, integer); |
| 400 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | } |
| 402 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 403 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | * |
| 405 | * FUNCTION: acpi_ut_exit |
| 406 | * |
| 407 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 408 | * function_name - Caller's procedure name |
| 409 | * module_name - Caller's module name |
| 410 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | * |
| 412 | * RETURN: None |
| 413 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 414 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 415 | * set in debug_level |
| 416 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 417 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | |
| 419 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 420 | acpi_ut_exit(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 421 | const char *function_name, |
| 422 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 423 | { |
| 424 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 425 | /* Check if enabled up-front for performance */ |
| 426 | |
| 427 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 428 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 429 | line_number, function_name, module_name, |
| 430 | component_id, "%s\n", acpi_gbl_fn_exit_str); |
| 431 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 433 | if (acpi_gbl_nesting_level) { |
| 434 | acpi_gbl_nesting_level--; |
| 435 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 437 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 438 | ACPI_EXPORT_SYMBOL(acpi_ut_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 439 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 440 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | * |
| 442 | * FUNCTION: acpi_ut_status_exit |
| 443 | * |
| 444 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 445 | * function_name - Caller's procedure name |
| 446 | * module_name - Caller's module name |
| 447 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 448 | * status - Exit status code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | * |
| 450 | * RETURN: None |
| 451 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 452 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | * set in debug_level. Prints exit status also. |
| 454 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 455 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 456 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 457 | acpi_ut_status_exit(u32 line_number, |
| 458 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 459 | const char *module_name, |
| 460 | u32 component_id, acpi_status status) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | { |
| 462 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 463 | /* Check if enabled up-front for performance */ |
| 464 | |
| 465 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 466 | if (ACPI_SUCCESS(status)) { |
| 467 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 468 | line_number, function_name, |
| 469 | module_name, component_id, "%s %s\n", |
| 470 | acpi_gbl_fn_exit_str, |
| 471 | acpi_format_exception(status)); |
| 472 | } else { |
| 473 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 474 | line_number, function_name, |
| 475 | module_name, component_id, |
| 476 | "%s ****Exception****: %s\n", |
| 477 | acpi_gbl_fn_exit_str, |
| 478 | acpi_format_exception(status)); |
| 479 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | } |
| 481 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 482 | if (acpi_gbl_nesting_level) { |
| 483 | acpi_gbl_nesting_level--; |
| 484 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 485 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 486 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 487 | ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 488 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 489 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 490 | * |
| 491 | * FUNCTION: acpi_ut_value_exit |
| 492 | * |
| 493 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 494 | * function_name - Caller's procedure name |
| 495 | * module_name - Caller's module name |
| 496 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 497 | * value - Value to be printed with exit msg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | * |
| 499 | * RETURN: None |
| 500 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 501 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | * set in debug_level. Prints exit value also. |
| 503 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 504 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 505 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 506 | acpi_ut_value_exit(u32 line_number, |
| 507 | const char *function_name, |
Bob Moore | 5df7e6c | 2010-01-21 10:06:32 +0800 | [diff] [blame] | 508 | const char *module_name, u32 component_id, u64 value) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | { |
| 510 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 511 | /* Check if enabled up-front for performance */ |
| 512 | |
| 513 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 514 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 515 | line_number, function_name, module_name, |
| 516 | component_id, "%s %8.8X%8.8X\n", |
| 517 | acpi_gbl_fn_exit_str, |
| 518 | ACPI_FORMAT_UINT64(value)); |
| 519 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 520 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 521 | if (acpi_gbl_nesting_level) { |
| 522 | acpi_gbl_nesting_level--; |
| 523 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 525 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 526 | ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 527 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 528 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 529 | * |
| 530 | * FUNCTION: acpi_ut_ptr_exit |
| 531 | * |
| 532 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 533 | * function_name - Caller's procedure name |
| 534 | * module_name - Caller's module name |
| 535 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 536 | * ptr - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 537 | * |
| 538 | * RETURN: None |
| 539 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 540 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | * set in debug_level. Prints exit value also. |
| 542 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 543 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 544 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 545 | acpi_ut_ptr_exit(u32 line_number, |
| 546 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 547 | const char *module_name, u32 component_id, u8 *ptr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | { |
| 549 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 550 | /* Check if enabled up-front for performance */ |
| 551 | |
| 552 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 553 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 554 | line_number, function_name, module_name, |
| 555 | component_id, "%s %p\n", acpi_gbl_fn_exit_str, |
| 556 | ptr); |
| 557 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 558 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 559 | if (acpi_gbl_nesting_level) { |
| 560 | acpi_gbl_nesting_level--; |
| 561 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 562 | } |
| 563 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 564 | /******************************************************************************* |
| 565 | * |
| 566 | * FUNCTION: acpi_trace_point |
| 567 | * |
| 568 | * PARAMETERS: type - Trace event type |
| 569 | * begin - TRUE if before execution |
| 570 | * aml - Executed AML address |
| 571 | * pathname - Object path |
| 572 | * pointer - Pointer to the related object |
| 573 | * |
| 574 | * RETURN: None |
| 575 | * |
| 576 | * DESCRIPTION: Interpreter execution trace. |
| 577 | * |
| 578 | ******************************************************************************/ |
Lv Zheng | 2e70da4 | 2014-07-08 10:07:06 +0800 | [diff] [blame] | 579 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 580 | void |
| 581 | acpi_trace_point(acpi_trace_event_type type, u8 begin, u8 *aml, char *pathname) |
| 582 | { |
| 583 | |
| 584 | ACPI_FUNCTION_ENTRY(); |
| 585 | |
| 586 | acpi_ex_trace_point(type, begin, aml, pathname); |
| 587 | |
| 588 | #ifdef ACPI_USE_SYSTEM_TRACER |
| 589 | acpi_os_trace_point(type, begin, aml, pathname); |
| 590 | #endif |
| 591 | } |
| 592 | |
| 593 | ACPI_EXPORT_SYMBOL(acpi_trace_point) |
| 594 | #endif |
Lv Zheng | 2e70da4 | 2014-07-08 10:07:06 +0800 | [diff] [blame] | 595 | #ifdef ACPI_APPLICATION |
| 596 | /******************************************************************************* |
| 597 | * |
| 598 | * FUNCTION: acpi_log_error |
| 599 | * |
| 600 | * PARAMETERS: format - Printf format field |
| 601 | * ... - Optional printf arguments |
| 602 | * |
| 603 | * RETURN: None |
| 604 | * |
| 605 | * DESCRIPTION: Print error message to the console, used by applications. |
| 606 | * |
| 607 | ******************************************************************************/ |
Lv Zheng | 2e70da4 | 2014-07-08 10:07:06 +0800 | [diff] [blame] | 608 | void ACPI_INTERNAL_VAR_XFACE acpi_log_error(const char *format, ...) |
| 609 | { |
| 610 | va_list args; |
| 611 | |
| 612 | va_start(args, format); |
| 613 | (void)acpi_ut_file_vprintf(ACPI_FILE_ERR, format, args); |
| 614 | va_end(args); |
| 615 | } |
| 616 | |
| 617 | ACPI_EXPORT_SYMBOL(acpi_log_error) |
| 618 | #endif |