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 | 7735ca0 | 2017-02-08 11:00:08 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2017, 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 |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 54 | static acpi_thread_id acpi_gbl_previous_thread_id = (acpi_thread_id) 0xFFFFFFFF; |
| 55 | static const char *acpi_gbl_function_entry_prefix = "----Entry"; |
| 56 | static const char *acpi_gbl_function_exit_prefix = "----Exit-"; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 58 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | * |
| 60 | * FUNCTION: acpi_ut_init_stack_ptr_trace |
| 61 | * |
| 62 | * PARAMETERS: None |
| 63 | * |
| 64 | * RETURN: None |
| 65 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 66 | * DESCRIPTION: Save the current CPU stack pointer at subsystem startup |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 68 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 70 | void acpi_ut_init_stack_ptr_trace(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | { |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 72 | acpi_size current_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 74 | acpi_gbl_entry_stack_pointer = ¤t_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | } |
| 76 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 77 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | * |
| 79 | * FUNCTION: acpi_ut_track_stack_ptr |
| 80 | * |
| 81 | * PARAMETERS: None |
| 82 | * |
| 83 | * RETURN: None |
| 84 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 85 | * DESCRIPTION: Save the current CPU stack pointer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 87 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 89 | void acpi_ut_track_stack_ptr(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 91 | acpi_size current_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
Bob Moore | 1d18c05 | 2008-04-10 19:06:40 +0400 | [diff] [blame] | 93 | if (¤t_sp < acpi_gbl_lowest_stack_pointer) { |
| 94 | acpi_gbl_lowest_stack_pointer = ¤t_sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) { |
| 98 | acpi_gbl_deepest_nesting = acpi_gbl_nesting_level; |
| 99 | } |
| 100 | } |
| 101 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 102 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | * |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 104 | * FUNCTION: acpi_ut_trim_function_name |
| 105 | * |
| 106 | * PARAMETERS: function_name - Ascii string containing a procedure name |
| 107 | * |
| 108 | * RETURN: Updated pointer to the function name |
| 109 | * |
| 110 | * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present. |
Lv Zheng | 7011bf4 | 2015-06-19 11:38:22 +0800 | [diff] [blame] | 111 | * This allows compiler macros such as __func__ to be used |
| 112 | * with no change to the debug output. |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 113 | * |
| 114 | ******************************************************************************/ |
| 115 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 116 | static const char *acpi_ut_trim_function_name(const char *function_name) |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 117 | { |
| 118 | |
| 119 | /* All Function names are longer than 4 chars, check is safe */ |
| 120 | |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 121 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 122 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 123 | /* This is the case where the original source has not been modified */ |
| 124 | |
| 125 | return (function_name + 4); |
| 126 | } |
| 127 | |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 128 | if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) { |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 129 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 130 | /* This is the case where the source has been 'linuxized' */ |
| 131 | |
| 132 | return (function_name + 5); |
| 133 | } |
| 134 | |
| 135 | return (function_name); |
| 136 | } |
| 137 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 138 | /******************************************************************************* |
| 139 | * |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 140 | * FUNCTION: acpi_debug_print |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 142 | * PARAMETERS: requested_debug_level - Requested debug print level |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | * line_number - Caller's line number (for error output) |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 144 | * function_name - Caller's procedure name |
| 145 | * module_name - Caller's module name |
| 146 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 147 | * format - Printf format field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | * ... - Optional printf arguments |
| 149 | * |
| 150 | * RETURN: None |
| 151 | * |
| 152 | * DESCRIPTION: Print error message with prefix consisting of the module name, |
| 153 | * line number, and component ID. |
| 154 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 155 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 157 | void ACPI_INTERNAL_VAR_XFACE |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 158 | acpi_debug_print(u32 requested_debug_level, |
| 159 | u32 line_number, |
| 160 | const char *function_name, |
| 161 | const char *module_name, |
| 162 | u32 component_id, const char *format, ...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | { |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 164 | acpi_thread_id thread_id; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 165 | va_list args; |
Bob Moore | 2cb0ba7 | 2018-01-03 15:06:24 -0800 | [diff] [blame] | 166 | #ifdef ACPI_APPLICATION |
Bob Moore | 6be2d72 | 2018-01-03 15:06:21 -0800 | [diff] [blame] | 167 | int fill_count; |
Bob Moore | 2cb0ba7 | 2018-01-03 15:06:24 -0800 | [diff] [blame] | 168 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 170 | /* Check if debug output enabled */ |
| 171 | |
| 172 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | return; |
| 174 | } |
| 175 | |
| 176 | /* |
| 177 | * Thread tracking and context switch notification |
| 178 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 179 | thread_id = acpi_os_get_thread_id(); |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 180 | if (thread_id != acpi_gbl_previous_thread_id) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 182 | acpi_os_printf |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 183 | ("\n**** Context Switch from TID %u to TID %u ****\n\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 184 | (u32)acpi_gbl_previous_thread_id, (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | } |
| 186 | |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 187 | acpi_gbl_previous_thread_id = thread_id; |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 188 | acpi_gbl_nesting_level = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | /* |
| 192 | * Display the module name, current line number, thread ID (if requested), |
| 193 | * current procedure nesting level, and the current procedure name |
| 194 | */ |
Bob Moore | 2856846 | 2013-09-23 09:51:39 +0800 | [diff] [blame] | 195 | acpi_os_printf("%9s-%04ld ", module_name, line_number); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 197 | #ifdef ACPI_APPLICATION |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 198 | /* |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 199 | * For acpi_exec/iASL only, emit the thread ID and nesting level. |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 200 | * Note: nesting level is really only useful during a single-thread |
| 201 | * execution. Otherwise, multiple threads will keep resetting the |
| 202 | * level. |
| 203 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 205 | acpi_os_printf("[%u] ", (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Bob Moore | 6be2d72 | 2018-01-03 15:06:21 -0800 | [diff] [blame] | 208 | fill_count = 48 - acpi_gbl_nesting_level - |
| 209 | strlen(acpi_ut_trim_function_name(function_name)); |
| 210 | if (fill_count < 0) { |
| 211 | fill_count = 0; |
| 212 | } |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 213 | |
Bob Moore | 6be2d72 | 2018-01-03 15:06:21 -0800 | [diff] [blame] | 214 | acpi_os_printf("[%02ld] %*s", |
Erik Schmauss | 6e875fa04 | 2018-01-03 15:06:23 -0800 | [diff] [blame] | 215 | acpi_gbl_nesting_level, acpi_gbl_nesting_level + 1, " "); |
Bob Moore | 6be2d72 | 2018-01-03 15:06:21 -0800 | [diff] [blame] | 216 | acpi_os_printf("%s%*s: ", |
| 217 | acpi_ut_trim_function_name(function_name), fill_count, |
| 218 | " "); |
| 219 | |
| 220 | #else |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 221 | acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); |
Bob Moore | 6be2d72 | 2018-01-03 15:06:21 -0800 | [diff] [blame] | 222 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 224 | va_start(args, format); |
| 225 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 226 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 228 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 229 | ACPI_EXPORT_SYMBOL(acpi_debug_print) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 231 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | * |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 233 | * FUNCTION: acpi_debug_print_raw |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | * |
| 235 | * PARAMETERS: requested_debug_level - Requested debug print level |
| 236 | * line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 237 | * function_name - Caller's procedure name |
| 238 | * module_name - Caller's module name |
| 239 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 240 | * format - Printf format field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | * ... - Optional printf arguments |
| 242 | * |
| 243 | * RETURN: None |
| 244 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 245 | * DESCRIPTION: Print message with no headers. Has same interface as |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | * debug_print so that the same macros can be used. |
| 247 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 248 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 249 | void ACPI_INTERNAL_VAR_XFACE |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 250 | acpi_debug_print_raw(u32 requested_debug_level, |
| 251 | u32 line_number, |
| 252 | const char *function_name, |
| 253 | const char *module_name, |
| 254 | u32 component_id, const char *format, ...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 256 | va_list args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 258 | /* Check if debug output enabled */ |
| 259 | |
| 260 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | return; |
| 262 | } |
| 263 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 264 | va_start(args, format); |
| 265 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 266 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 269 | ACPI_EXPORT_SYMBOL(acpi_debug_print_raw) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 271 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | * |
| 273 | * FUNCTION: acpi_ut_trace |
| 274 | * |
| 275 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 276 | * function_name - Caller's procedure name |
| 277 | * module_name - Caller's module name |
| 278 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | * |
| 280 | * RETURN: None |
| 281 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 282 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | * set in debug_level |
| 284 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 285 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 287 | acpi_ut_trace(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 288 | const char *function_name, |
| 289 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | { |
| 291 | |
| 292 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 293 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 295 | /* Check if enabled up-front for performance */ |
| 296 | |
| 297 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 298 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 299 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 300 | component_id, "%s\n", |
| 301 | acpi_gbl_function_entry_prefix); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 302 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 305 | ACPI_EXPORT_SYMBOL(acpi_ut_trace) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 307 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | * |
| 309 | * FUNCTION: acpi_ut_trace_ptr |
| 310 | * |
| 311 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 312 | * function_name - Caller's procedure name |
| 313 | * module_name - Caller's module name |
| 314 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 315 | * pointer - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | * |
| 317 | * RETURN: None |
| 318 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 319 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | * set in debug_level |
| 321 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 322 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 324 | acpi_ut_trace_ptr(u32 line_number, |
| 325 | const char *function_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 326 | const char *module_name, |
| 327 | u32 component_id, const void *pointer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | { |
Bob Moore | 68aafc3 | 2012-10-31 02:26:01 +0000 | [diff] [blame] | 329 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 331 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 333 | /* Check if enabled up-front for performance */ |
| 334 | |
| 335 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 336 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 337 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 338 | component_id, "%s %p\n", |
| 339 | acpi_gbl_function_entry_prefix, pointer); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 340 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | } |
| 342 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 343 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | * |
| 345 | * FUNCTION: acpi_ut_trace_str |
| 346 | * |
| 347 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 348 | * function_name - Caller's procedure name |
| 349 | * module_name - Caller's module name |
| 350 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 351 | * string - Additional string to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | * |
| 353 | * RETURN: None |
| 354 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 355 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | * set in debug_level |
| 357 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 358 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | |
| 360 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 361 | acpi_ut_trace_str(u32 line_number, |
| 362 | const char *function_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 363 | const char *module_name, u32 component_id, const char *string) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | { |
| 365 | |
| 366 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 367 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 369 | /* Check if enabled up-front for performance */ |
| 370 | |
| 371 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 372 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 373 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 374 | component_id, "%s %s\n", |
| 375 | acpi_gbl_function_entry_prefix, string); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 376 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | } |
| 378 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 379 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 380 | * |
| 381 | * FUNCTION: acpi_ut_trace_u32 |
| 382 | * |
| 383 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 384 | * function_name - Caller's procedure name |
| 385 | * module_name - Caller's module name |
| 386 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 387 | * integer - Integer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | * |
| 389 | * RETURN: None |
| 390 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 391 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 392 | * set in debug_level |
| 393 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 394 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | |
| 396 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 397 | acpi_ut_trace_u32(u32 line_number, |
| 398 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 399 | const char *module_name, u32 component_id, u32 integer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 400 | { |
| 401 | |
| 402 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 403 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 405 | /* Check if enabled up-front for performance */ |
| 406 | |
| 407 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 408 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 409 | line_number, function_name, module_name, |
| 410 | component_id, "%s %08X\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 411 | acpi_gbl_function_entry_prefix, integer); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 412 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | } |
| 414 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 415 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 416 | * |
| 417 | * FUNCTION: acpi_ut_exit |
| 418 | * |
| 419 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 420 | * function_name - Caller's procedure name |
| 421 | * module_name - Caller's module name |
| 422 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 423 | * |
| 424 | * RETURN: None |
| 425 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 426 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 427 | * set in debug_level |
| 428 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 429 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 430 | |
| 431 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 432 | acpi_ut_exit(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 433 | const char *function_name, |
| 434 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | { |
| 436 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 437 | /* Check if enabled up-front for performance */ |
| 438 | |
| 439 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 440 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 441 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 442 | component_id, "%s\n", |
| 443 | acpi_gbl_function_exit_prefix); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 444 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 445 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 446 | if (acpi_gbl_nesting_level) { |
| 447 | acpi_gbl_nesting_level--; |
| 448 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 451 | ACPI_EXPORT_SYMBOL(acpi_ut_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 453 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | * |
| 455 | * FUNCTION: acpi_ut_status_exit |
| 456 | * |
| 457 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 458 | * function_name - Caller's procedure name |
| 459 | * module_name - Caller's module name |
| 460 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 461 | * status - Exit status code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 462 | * |
| 463 | * RETURN: None |
| 464 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 465 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | * set in debug_level. Prints exit status also. |
| 467 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 468 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 469 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 470 | acpi_ut_status_exit(u32 line_number, |
| 471 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 472 | const char *module_name, |
| 473 | u32 component_id, acpi_status status) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 474 | { |
| 475 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 476 | /* Check if enabled up-front for performance */ |
| 477 | |
| 478 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 479 | if (ACPI_SUCCESS(status)) { |
| 480 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 481 | line_number, function_name, |
| 482 | module_name, component_id, "%s %s\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 483 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 484 | acpi_format_exception(status)); |
| 485 | } else { |
| 486 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 487 | line_number, function_name, |
| 488 | module_name, component_id, |
| 489 | "%s ****Exception****: %s\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 490 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 491 | acpi_format_exception(status)); |
| 492 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | } |
| 494 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 495 | if (acpi_gbl_nesting_level) { |
| 496 | acpi_gbl_nesting_level--; |
| 497 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 499 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 500 | ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 502 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 503 | * |
| 504 | * FUNCTION: acpi_ut_value_exit |
| 505 | * |
| 506 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 507 | * function_name - Caller's procedure name |
| 508 | * module_name - Caller's module name |
| 509 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 510 | * value - Value to be printed with exit msg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 511 | * |
| 512 | * RETURN: None |
| 513 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 514 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 515 | * set in debug_level. Prints exit value also. |
| 516 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 517 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 518 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 519 | acpi_ut_value_exit(u32 line_number, |
| 520 | const char *function_name, |
Bob Moore | 5df7e6c | 2010-01-21 10:06:32 +0800 | [diff] [blame] | 521 | const char *module_name, u32 component_id, u64 value) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 522 | { |
| 523 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 524 | /* Check if enabled up-front for performance */ |
| 525 | |
| 526 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 527 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 528 | line_number, function_name, module_name, |
| 529 | component_id, "%s %8.8X%8.8X\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 530 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 531 | ACPI_FORMAT_UINT64(value)); |
| 532 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 534 | if (acpi_gbl_nesting_level) { |
| 535 | acpi_gbl_nesting_level--; |
| 536 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 537 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 538 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 539 | ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 541 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 542 | * |
| 543 | * FUNCTION: acpi_ut_ptr_exit |
| 544 | * |
| 545 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 546 | * function_name - Caller's procedure name |
| 547 | * module_name - Caller's module name |
| 548 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 549 | * ptr - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | * |
| 551 | * RETURN: None |
| 552 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 553 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 554 | * set in debug_level. Prints exit value also. |
| 555 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 556 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 557 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 558 | acpi_ut_ptr_exit(u32 line_number, |
| 559 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 560 | const char *module_name, u32 component_id, u8 *ptr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | { |
| 562 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 563 | /* Check if enabled up-front for performance */ |
| 564 | |
| 565 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 566 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 567 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 568 | component_id, "%s %p\n", |
| 569 | acpi_gbl_function_exit_prefix, ptr); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 570 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 571 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 572 | if (acpi_gbl_nesting_level) { |
| 573 | acpi_gbl_nesting_level--; |
| 574 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | } |
| 576 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 577 | /******************************************************************************* |
| 578 | * |
Jung-uk Kim | 4857a94 | 2016-08-04 16:42:19 +0800 | [diff] [blame] | 579 | * FUNCTION: acpi_ut_str_exit |
| 580 | * |
| 581 | * PARAMETERS: line_number - Caller's line number |
| 582 | * function_name - Caller's procedure name |
| 583 | * module_name - Caller's module name |
| 584 | * component_id - Caller's component ID |
| 585 | * string - String to display |
| 586 | * |
| 587 | * RETURN: None |
| 588 | * |
| 589 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
| 590 | * set in debug_level. Prints exit value also. |
| 591 | * |
| 592 | ******************************************************************************/ |
| 593 | |
| 594 | void |
| 595 | acpi_ut_str_exit(u32 line_number, |
| 596 | const char *function_name, |
| 597 | const char *module_name, u32 component_id, const char *string) |
| 598 | { |
| 599 | |
| 600 | /* Check if enabled up-front for performance */ |
| 601 | |
| 602 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 603 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 604 | line_number, function_name, module_name, |
| 605 | component_id, "%s %s\n", |
| 606 | acpi_gbl_function_exit_prefix, string); |
| 607 | } |
| 608 | |
| 609 | if (acpi_gbl_nesting_level) { |
| 610 | acpi_gbl_nesting_level--; |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | /******************************************************************************* |
| 615 | * |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 616 | * FUNCTION: acpi_trace_point |
| 617 | * |
| 618 | * PARAMETERS: type - Trace event type |
| 619 | * begin - TRUE if before execution |
| 620 | * aml - Executed AML address |
| 621 | * pathname - Object path |
| 622 | * pointer - Pointer to the related object |
| 623 | * |
| 624 | * RETURN: None |
| 625 | * |
| 626 | * DESCRIPTION: Interpreter execution trace. |
| 627 | * |
| 628 | ******************************************************************************/ |
Lv Zheng | 2e70da4 | 2014-07-08 10:07:06 +0800 | [diff] [blame] | 629 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 630 | void |
| 631 | acpi_trace_point(acpi_trace_event_type type, u8 begin, u8 *aml, char *pathname) |
| 632 | { |
| 633 | |
| 634 | ACPI_FUNCTION_ENTRY(); |
| 635 | |
| 636 | acpi_ex_trace_point(type, begin, aml, pathname); |
| 637 | |
| 638 | #ifdef ACPI_USE_SYSTEM_TRACER |
| 639 | acpi_os_trace_point(type, begin, aml, pathname); |
| 640 | #endif |
| 641 | } |
| 642 | |
| 643 | ACPI_EXPORT_SYMBOL(acpi_trace_point) |
Bob Moore | 9cf7ade | 2017-04-28 08:53:22 +0800 | [diff] [blame] | 644 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 645 | #endif |