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