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; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 167 | /* Check if debug output enabled */ |
| 168 | |
| 169 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | return; |
| 171 | } |
| 172 | |
| 173 | /* |
| 174 | * Thread tracking and context switch notification |
| 175 | */ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 176 | thread_id = acpi_os_get_thread_id(); |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 177 | if (thread_id != acpi_gbl_previous_thread_id) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 179 | acpi_os_printf |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 180 | ("\n**** Context Switch from TID %u to TID %u ****\n\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 181 | (u32)acpi_gbl_previous_thread_id, (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | } |
| 183 | |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 184 | acpi_gbl_previous_thread_id = thread_id; |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 185 | acpi_gbl_nesting_level = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | /* |
| 189 | * Display the module name, current line number, thread ID (if requested), |
| 190 | * current procedure nesting level, and the current procedure name |
| 191 | */ |
Bob Moore | 2856846 | 2013-09-23 09:51:39 +0800 | [diff] [blame] | 192 | acpi_os_printf("%9s-%04ld ", module_name, line_number); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 194 | #ifdef ACPI_APPLICATION |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 195 | /* |
Bob Moore | 5076f00 | 2014-01-08 13:43:12 +0800 | [diff] [blame] | 196 | * For acpi_exec/iASL only, emit the thread ID and nesting level. |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 197 | * Note: nesting level is really only useful during a single-thread |
| 198 | * execution. Otherwise, multiple threads will keep resetting the |
| 199 | * level. |
| 200 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
Lin Ming | 28eb3fc | 2010-09-15 13:55:13 +0800 | [diff] [blame] | 202 | acpi_os_printf("[%u] ", (u32)thread_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | } |
| 204 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 205 | acpi_os_printf("[%02ld] ", acpi_gbl_nesting_level); |
| 206 | #endif |
| 207 | |
| 208 | acpi_os_printf("%-22.22s: ", acpi_ut_trim_function_name(function_name)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 210 | va_start(args, format); |
| 211 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 212 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | } |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 214 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 215 | ACPI_EXPORT_SYMBOL(acpi_debug_print) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 217 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | * |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 219 | * FUNCTION: acpi_debug_print_raw |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | * |
| 221 | * PARAMETERS: requested_debug_level - Requested debug print level |
| 222 | * line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 223 | * function_name - Caller's procedure name |
| 224 | * module_name - Caller's module name |
| 225 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 226 | * format - Printf format field |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 227 | * ... - Optional printf arguments |
| 228 | * |
| 229 | * RETURN: None |
| 230 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 231 | * DESCRIPTION: Print message with no headers. Has same interface as |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | * debug_print so that the same macros can be used. |
| 233 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 234 | ******************************************************************************/ |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 235 | void ACPI_INTERNAL_VAR_XFACE |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 236 | acpi_debug_print_raw(u32 requested_debug_level, |
| 237 | u32 line_number, |
| 238 | const char *function_name, |
| 239 | const char *module_name, |
| 240 | u32 component_id, const char *format, ...) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 242 | va_list args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 244 | /* Check if debug output enabled */ |
| 245 | |
| 246 | if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | return; |
| 248 | } |
| 249 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 250 | va_start(args, format); |
| 251 | acpi_os_vprintf(format, args); |
Bob Moore | 507f046 | 2008-04-10 19:06:42 +0400 | [diff] [blame] | 252 | va_end(args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | |
Bob Moore | 50df4d8 | 2008-12-31 03:01:23 +0800 | [diff] [blame] | 255 | ACPI_EXPORT_SYMBOL(acpi_debug_print_raw) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 257 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | * |
| 259 | * FUNCTION: acpi_ut_trace |
| 260 | * |
| 261 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 262 | * function_name - Caller's procedure name |
| 263 | * module_name - Caller's module name |
| 264 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | * |
| 266 | * RETURN: None |
| 267 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 268 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | * set in debug_level |
| 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 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 273 | acpi_ut_trace(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 274 | const char *function_name, |
| 275 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | { |
| 277 | |
| 278 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 279 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 281 | /* Check if enabled up-front for performance */ |
| 282 | |
| 283 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 284 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 285 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 286 | component_id, "%s\n", |
| 287 | acpi_gbl_function_entry_prefix); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 288 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 289 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 291 | ACPI_EXPORT_SYMBOL(acpi_ut_trace) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 293 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | * |
| 295 | * FUNCTION: acpi_ut_trace_ptr |
| 296 | * |
| 297 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 298 | * function_name - Caller's procedure name |
| 299 | * module_name - Caller's module name |
| 300 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 301 | * pointer - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | * |
| 303 | * RETURN: None |
| 304 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 305 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | * set in debug_level |
| 307 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 308 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 310 | acpi_ut_trace_ptr(u32 line_number, |
| 311 | const char *function_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 312 | const char *module_name, |
| 313 | u32 component_id, const void *pointer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | { |
Bob Moore | 68aafc3 | 2012-10-31 02:26:01 +0000 | [diff] [blame] | 315 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 317 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 319 | /* Check if enabled up-front for performance */ |
| 320 | |
| 321 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 322 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 323 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 324 | component_id, "%s %p\n", |
| 325 | acpi_gbl_function_entry_prefix, pointer); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 326 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | } |
| 328 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 329 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | * |
| 331 | * FUNCTION: acpi_ut_trace_str |
| 332 | * |
| 333 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 334 | * function_name - Caller's procedure name |
| 335 | * module_name - Caller's module name |
| 336 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 337 | * string - Additional string to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | * |
| 339 | * RETURN: None |
| 340 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 341 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 342 | * set in debug_level |
| 343 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 344 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 345 | |
| 346 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 347 | acpi_ut_trace_str(u32 line_number, |
| 348 | const char *function_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 349 | const char *module_name, u32 component_id, const char *string) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | { |
| 351 | |
| 352 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 353 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 355 | /* Check if enabled up-front for performance */ |
| 356 | |
| 357 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 358 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 359 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 360 | component_id, "%s %s\n", |
| 361 | acpi_gbl_function_entry_prefix, string); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 362 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | } |
| 364 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 365 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | * |
| 367 | * FUNCTION: acpi_ut_trace_u32 |
| 368 | * |
| 369 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 370 | * function_name - Caller's procedure name |
| 371 | * module_name - Caller's module name |
| 372 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 373 | * integer - Integer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | * |
| 375 | * RETURN: None |
| 376 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 377 | * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | * set in debug_level |
| 379 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 380 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | |
| 382 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 383 | acpi_ut_trace_u32(u32 line_number, |
| 384 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 385 | const char *module_name, u32 component_id, u32 integer) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | { |
| 387 | |
| 388 | acpi_gbl_nesting_level++; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 389 | acpi_ut_track_stack_ptr(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 390 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 391 | /* Check if enabled up-front for performance */ |
| 392 | |
| 393 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 394 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 395 | line_number, function_name, module_name, |
| 396 | component_id, "%s %08X\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 397 | acpi_gbl_function_entry_prefix, integer); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 398 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 401 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | * |
| 403 | * FUNCTION: acpi_ut_exit |
| 404 | * |
| 405 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 406 | * function_name - Caller's procedure name |
| 407 | * module_name - Caller's module name |
| 408 | * component_id - Caller's component ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 409 | * |
| 410 | * RETURN: None |
| 411 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 412 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | * set in debug_level |
| 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 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 418 | acpi_ut_exit(u32 line_number, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 419 | const char *function_name, |
| 420 | const char *module_name, u32 component_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | { |
| 422 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 423 | /* Check if enabled up-front for performance */ |
| 424 | |
| 425 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 426 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 427 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 428 | component_id, "%s\n", |
| 429 | acpi_gbl_function_exit_prefix); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 430 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 431 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 432 | if (acpi_gbl_nesting_level) { |
| 433 | acpi_gbl_nesting_level--; |
| 434 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 437 | ACPI_EXPORT_SYMBOL(acpi_ut_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 439 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 440 | * |
| 441 | * FUNCTION: acpi_ut_status_exit |
| 442 | * |
| 443 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 444 | * function_name - Caller's procedure name |
| 445 | * module_name - Caller's module name |
| 446 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 447 | * status - Exit status code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 448 | * |
| 449 | * RETURN: None |
| 450 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 451 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | * set in debug_level. Prints exit status also. |
| 453 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 454 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 456 | acpi_ut_status_exit(u32 line_number, |
| 457 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 458 | const char *module_name, |
| 459 | u32 component_id, acpi_status status) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | { |
| 461 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 462 | /* Check if enabled up-front for performance */ |
| 463 | |
| 464 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 465 | if (ACPI_SUCCESS(status)) { |
| 466 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 467 | line_number, function_name, |
| 468 | module_name, component_id, "%s %s\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 469 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 470 | acpi_format_exception(status)); |
| 471 | } else { |
| 472 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 473 | line_number, function_name, |
| 474 | module_name, component_id, |
| 475 | "%s ****Exception****: %s\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 476 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 477 | acpi_format_exception(status)); |
| 478 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | } |
| 480 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 481 | if (acpi_gbl_nesting_level) { |
| 482 | acpi_gbl_nesting_level--; |
| 483 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 484 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 485 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 486 | ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 487 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 488 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | * |
| 490 | * FUNCTION: acpi_ut_value_exit |
| 491 | * |
| 492 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 493 | * function_name - Caller's procedure name |
| 494 | * module_name - Caller's module name |
| 495 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 496 | * value - Value to be printed with exit msg |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 497 | * |
| 498 | * RETURN: None |
| 499 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 500 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 501 | * set in debug_level. Prints exit value also. |
| 502 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 503 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 504 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 505 | acpi_ut_value_exit(u32 line_number, |
| 506 | const char *function_name, |
Bob Moore | 5df7e6c | 2010-01-21 10:06:32 +0800 | [diff] [blame] | 507 | const char *module_name, u32 component_id, u64 value) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 508 | { |
| 509 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 510 | /* Check if enabled up-front for performance */ |
| 511 | |
| 512 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 513 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 514 | line_number, function_name, module_name, |
| 515 | component_id, "%s %8.8X%8.8X\n", |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 516 | acpi_gbl_function_exit_prefix, |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 517 | ACPI_FORMAT_UINT64(value)); |
| 518 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 519 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 520 | if (acpi_gbl_nesting_level) { |
| 521 | acpi_gbl_nesting_level--; |
| 522 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | |
Bob Moore | 8313524 | 2006-10-03 00:00:00 -0400 | [diff] [blame] | 525 | ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 526 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 527 | /******************************************************************************* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | * |
| 529 | * FUNCTION: acpi_ut_ptr_exit |
| 530 | * |
| 531 | * PARAMETERS: line_number - Caller's line number |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 532 | * function_name - Caller's procedure name |
| 533 | * module_name - Caller's module name |
| 534 | * component_id - Caller's component ID |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 535 | * ptr - Pointer to display |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 536 | * |
| 537 | * RETURN: None |
| 538 | * |
Bob Moore | 73a3090 | 2012-10-31 02:26:55 +0000 | [diff] [blame] | 539 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 | * set in debug_level. Prints exit value also. |
| 541 | * |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 542 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | void |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 544 | acpi_ut_ptr_exit(u32 line_number, |
| 545 | const char *function_name, |
Bob Moore | 4b8ed63 | 2008-06-10 13:55:53 +0800 | [diff] [blame] | 546 | const char *module_name, u32 component_id, u8 *ptr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 547 | { |
| 548 | |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 549 | /* Check if enabled up-front for performance */ |
| 550 | |
| 551 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 552 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 553 | line_number, function_name, module_name, |
Bob Moore | 0dfaaa3 | 2016-03-24 09:40:40 +0800 | [diff] [blame] | 554 | component_id, "%s %p\n", |
| 555 | acpi_gbl_function_exit_prefix, ptr); |
Bob Moore | db38bf5 | 2012-12-31 00:06:10 +0000 | [diff] [blame] | 556 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 557 | |
Bob Moore | bf9b448 | 2013-11-21 12:17:20 +0800 | [diff] [blame] | 558 | if (acpi_gbl_nesting_level) { |
| 559 | acpi_gbl_nesting_level--; |
| 560 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 561 | } |
| 562 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 563 | /******************************************************************************* |
| 564 | * |
Jung-uk Kim | 4857a94 | 2016-08-04 16:42:19 +0800 | [diff] [blame] | 565 | * FUNCTION: acpi_ut_str_exit |
| 566 | * |
| 567 | * PARAMETERS: line_number - Caller's line number |
| 568 | * function_name - Caller's procedure name |
| 569 | * module_name - Caller's module name |
| 570 | * component_id - Caller's component ID |
| 571 | * string - String to display |
| 572 | * |
| 573 | * RETURN: None |
| 574 | * |
| 575 | * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is |
| 576 | * set in debug_level. Prints exit value also. |
| 577 | * |
| 578 | ******************************************************************************/ |
| 579 | |
| 580 | void |
| 581 | acpi_ut_str_exit(u32 line_number, |
| 582 | const char *function_name, |
| 583 | const char *module_name, u32 component_id, const char *string) |
| 584 | { |
| 585 | |
| 586 | /* Check if enabled up-front for performance */ |
| 587 | |
| 588 | if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) { |
| 589 | acpi_debug_print(ACPI_LV_FUNCTIONS, |
| 590 | line_number, function_name, module_name, |
| 591 | component_id, "%s %s\n", |
| 592 | acpi_gbl_function_exit_prefix, string); |
| 593 | } |
| 594 | |
| 595 | if (acpi_gbl_nesting_level) { |
| 596 | acpi_gbl_nesting_level--; |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | /******************************************************************************* |
| 601 | * |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 602 | * FUNCTION: acpi_trace_point |
| 603 | * |
| 604 | * PARAMETERS: type - Trace event type |
| 605 | * begin - TRUE if before execution |
| 606 | * aml - Executed AML address |
| 607 | * pathname - Object path |
| 608 | * pointer - Pointer to the related object |
| 609 | * |
| 610 | * RETURN: None |
| 611 | * |
| 612 | * DESCRIPTION: Interpreter execution trace. |
| 613 | * |
| 614 | ******************************************************************************/ |
Lv Zheng | 2e70da4 | 2014-07-08 10:07:06 +0800 | [diff] [blame] | 615 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 616 | void |
| 617 | acpi_trace_point(acpi_trace_event_type type, u8 begin, u8 *aml, char *pathname) |
| 618 | { |
| 619 | |
| 620 | ACPI_FUNCTION_ENTRY(); |
| 621 | |
| 622 | acpi_ex_trace_point(type, begin, aml, pathname); |
| 623 | |
| 624 | #ifdef ACPI_USE_SYSTEM_TRACER |
| 625 | acpi_os_trace_point(type, begin, aml, pathname); |
| 626 | #endif |
| 627 | } |
| 628 | |
| 629 | ACPI_EXPORT_SYMBOL(acpi_trace_point) |
Bob Moore | 9cf7ade | 2017-04-28 08:53:22 +0800 | [diff] [blame] | 630 | |
Lv Zheng | bab0482 | 2015-07-23 12:53:07 +0800 | [diff] [blame] | 631 | #endif |