Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^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: extrace - Support for interpreter execution tracing
^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) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include "acinterp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #define _COMPONENT          ACPI_EXECUTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ACPI_MODULE_NAME("extrace")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) static union acpi_operand_object *acpi_gbl_trace_method_object = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /* Local prototypes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #ifdef ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) static const char *acpi_ex_get_trace_event_name(acpi_trace_event_type type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * FUNCTION:    acpi_ex_interpreter_trace_enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * PARAMETERS:  name                - Whether method name should be matched,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  *                                    this should be checked before starting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  *                                    the tracer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * RETURN:      TRUE if interpreter trace is enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * DESCRIPTION: Check whether interpreter trace is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static u8 acpi_ex_interpreter_trace_enabled(char *name)
^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) 	/* Check if tracing is enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		return (FALSE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	 * Check if tracing is filtered:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	 * 1. If the tracer is started, acpi_gbl_trace_method_object should have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	 *    been filled by the trace starter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	 * 2. If the tracer is not started, acpi_gbl_trace_method_name should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	 *    matched if it is specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	 * 3. If the tracer is oneshot style, acpi_gbl_trace_method_name should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	 *    not be cleared by the trace stopper during the first match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	if (acpi_gbl_trace_method_object) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		return (TRUE);
^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 (name &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	    (acpi_gbl_trace_method_name &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	     strcmp(acpi_gbl_trace_method_name, name))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		return (FALSE);
^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) 	if ((acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	    !acpi_gbl_trace_method_name) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		return (FALSE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	return (TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  * FUNCTION:    acpi_ex_get_trace_event_name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * PARAMETERS:  type            - Trace event type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  * RETURN:      Trace event name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  * DESCRIPTION: Used to obtain the full trace event name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) #ifdef ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) static const char *acpi_ex_get_trace_event_name(acpi_trace_event_type type)
^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) 	switch (type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	case ACPI_TRACE_AML_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		return "Method";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	case ACPI_TRACE_AML_OPCODE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		return "Opcode";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	case ACPI_TRACE_AML_REGION:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		return "Region";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		return "";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * FUNCTION:    acpi_ex_trace_point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  * PARAMETERS:  type                - Trace event type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  *              begin               - TRUE if before execution
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  *              aml                 - Executed AML address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)  *              pathname            - Object path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  * DESCRIPTION: Internal interpreter execution trace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) acpi_ex_trace_point(acpi_trace_event_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		    u8 begin, u8 *aml, char *pathname)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	ACPI_FUNCTION_NAME(ex_trace_point);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	if (pathname) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 				  "%s %s [0x%p:%s] execution.\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 				  acpi_ex_get_trace_event_name(type),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 				  begin ? "Begin" : "End", aml, pathname));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 				  "%s %s [0x%p] execution.\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 				  acpi_ex_get_trace_event_name(type),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 				  begin ? "Begin" : "End", aml));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  * FUNCTION:    acpi_ex_start_trace_method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  * PARAMETERS:  method_node         - Node of the method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)  *              obj_desc            - The method object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)  *              walk_state          - current state, NULL if not yet executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)  *                                    a method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * DESCRIPTION: Start control method execution trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 			   union acpi_operand_object *obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 			   struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	char *pathname = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	u8 enabled = FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	ACPI_FUNCTION_NAME(ex_start_trace_method);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	if (method_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	enabled = acpi_ex_interpreter_trace_enabled(pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if (enabled && !acpi_gbl_trace_method_object) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		acpi_gbl_trace_method_object = obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		acpi_gbl_original_dbg_level = acpi_dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		acpi_gbl_original_dbg_layer = acpi_dbg_layer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		acpi_dbg_level = ACPI_TRACE_LEVEL_ALL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		acpi_dbg_layer = ACPI_TRACE_LAYER_ALL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		if (acpi_gbl_trace_dbg_level) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			acpi_dbg_level = acpi_gbl_trace_dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		if (acpi_gbl_trace_dbg_layer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 			acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	if (enabled) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, TRUE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 				 obj_desc ? obj_desc->method.aml_start : NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 				 pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	if (pathname) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		ACPI_FREE(pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  * FUNCTION:    acpi_ex_stop_trace_method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)  * PARAMETERS:  method_node         - Node of the method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)  *              obj_desc            - The method object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  *              walk_state          - current state, NULL if not yet executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  *                                    a method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)  * DESCRIPTION: Stop control method execution trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			  union acpi_operand_object *obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 			  struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	char *pathname = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	u8 enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	ACPI_FUNCTION_NAME(ex_stop_trace_method);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	if (method_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	enabled = acpi_ex_interpreter_trace_enabled(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	if (enabled) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		ACPI_TRACE_POINT(ACPI_TRACE_AML_METHOD, FALSE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 				 obj_desc ? obj_desc->method.aml_start : NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 				 pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	/* Check whether the tracer should be stopped */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	if (acpi_gbl_trace_method_object == obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 		/* Disable further tracing if type is one-shot */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 		if (acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 			acpi_gbl_trace_method_name = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 		acpi_dbg_level = acpi_gbl_original_dbg_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 		acpi_dbg_layer = acpi_gbl_original_dbg_layer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 		acpi_gbl_trace_method_object = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	if (pathname) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 		ACPI_FREE(pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  * FUNCTION:    acpi_ex_start_trace_opcode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  * PARAMETERS:  op                  - The parser opcode object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)  *              walk_state          - current state, NULL if not yet executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)  *                                    a method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)  * DESCRIPTION: Start opcode execution trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) acpi_ex_start_trace_opcode(union acpi_parse_object *op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 			   struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	ACPI_FUNCTION_NAME(ex_start_trace_opcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	if (acpi_ex_interpreter_trace_enabled(NULL) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	    (acpi_gbl_trace_flags & ACPI_TRACE_OPCODE)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		ACPI_TRACE_POINT(ACPI_TRACE_AML_OPCODE, TRUE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 				 op->common.aml, op->common.aml_op_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)  * FUNCTION:    acpi_ex_stop_trace_opcode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)  * PARAMETERS:  op                  - The parser opcode object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)  *              walk_state          - current state, NULL if not yet executing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)  *                                    a method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)  * DESCRIPTION: Stop opcode execution trace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) acpi_ex_stop_trace_opcode(union acpi_parse_object *op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 			  struct acpi_walk_state *walk_state)
^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) 	ACPI_FUNCTION_NAME(ex_stop_trace_opcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	if (acpi_ex_interpreter_trace_enabled(NULL) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	    (acpi_gbl_trace_flags & ACPI_TRACE_OPCODE)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 		ACPI_TRACE_POINT(ACPI_TRACE_AML_OPCODE, FALSE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 				 op->common.aml, op->common.aml_op_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) }