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