ACPICA: Executer: Add interpreter tracing mode for method tracing facility
authorLv Zheng <lv.zheng@intel.com>
Thu, 23 Jul 2015 04:52:59 +0000 (12:52 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 23 Jul 2015 21:09:07 +0000 (23:09 +0200)
ACPICA commit 07fffd02607685b655ed92ee15c160e6a810b60b

The acpi_debug_trace() is the mechanism known as ACPI method tracing that is
used by Linux as ACPICA debugging message reducer. This facility can be
controlled through Linux ACPI subsystem - /sys/module/acpi/parameters.
This facility requires CONFIG_ACPI_DEBUG to be enabled to see ACPICA trace
logs in the kernel dmesg output.

This patch enhances acpi_debug_trace() to make it not only a message reducer,
but a real tracer to trace AML interpreter execution. Note that in addition
to the AML tracer enabling, this patch also updates the facility with the
following enhancements:
1. Allow a full path to be specified by the acpi_debug_trace() API.
2. Allow any method rather than just the entrance of acpi_evaluate_object()
   to be traced.
3. All interpreter ACPI_LV_TRACE_POINT messages are collected for
   ACPI_EXECUTER layer.

The Makefile of drivers/acpi/acpica is also updated to include exdebug.o
and the duplicated stubs are removed after that.

Note that since this patch has enhanced the method tracing facility, Linux
need also be updated after applying this patch. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/07fffd02
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
12 files changed:
drivers/acpi/acpica/acdebug.h
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/acinterp.h
drivers/acpi/acpica/dsdebug.c
drivers/acpi/acpica/dsmethod.c
drivers/acpi/acpica/exdebug.c
drivers/acpi/acpica/psloop.c
drivers/acpi/acpica/psparse.c
drivers/acpi/acpica/psxface.c
drivers/acpi/acpica/utinit.c
include/acpi/acoutput.h
include/acpi/acpixf.h

index 43685dd36c77c78650ea174b986f1e5aa2cb7618..88482f75e94151a40c9da0b021866eb822072231 100644 (file)
@@ -102,6 +102,8 @@ void acpi_db_display_interfaces(char *action_arg, char *interface_name_arg);
 
 acpi_status acpi_db_sleep(char *object_arg);
 
+void acpi_db_trace(char *enable_arg, char *method_arg, char *once_arg);
+
 void acpi_db_display_locks(void);
 
 void acpi_db_display_resources(char *object_arg);
index 53f96a3707624416d8ae6773027a1e693a51d623..5342300719ee77b630000f3b74ab1b4b35be4eea 100644 (file)
@@ -290,8 +290,6 @@ ACPI_GLOBAL(u32, acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]);
 
 ACPI_GLOBAL(u32, acpi_gbl_original_dbg_level);
 ACPI_GLOBAL(u32, acpi_gbl_original_dbg_layer);
-ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_level);
-ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer);
 
 /*****************************************************************************
  *
index 7ac98000b46b61dd417fe260315000092b2be861..a3c6e2ab93bb4e79ebb6f71b75cb822d004a01b5 100644 (file)
@@ -131,6 +131,24 @@ void
 acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
                        u32 level, u32 index);
 
+void
+acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
+                          union acpi_operand_object *obj_desc,
+                          struct acpi_walk_state *walk_state);
+
+void
+acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
+                         union acpi_operand_object *obj_desc,
+                         struct acpi_walk_state *walk_state);
+
+void
+acpi_ex_start_trace_opcode(union acpi_parse_object *op,
+                          struct acpi_walk_state *walk_state);
+
+void
+acpi_ex_stop_trace_opcode(union acpi_parse_object *op,
+                         struct acpi_walk_state *walk_state);
+
 /*
  * exfield - ACPI AML (p-code) execution - field manipulation
  */
index 7df9b50e17a7d22cbba1d152a52cf0519a2812a1..a651d30133d030a10858bf30aa127fa2d5799b05 100644 (file)
@@ -48,6 +48,7 @@
 #ifdef ACPI_DISASSEMBLER
 #include "acdisasm.h"
 #endif
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsdebug")
@@ -128,7 +129,6 @@ acpi_ds_dump_method_stack(acpi_status status,
        struct acpi_walk_state *next_walk_state;
        struct acpi_namespace_node *previous_method = NULL;
        union acpi_operand_object *method_desc;
-       char *pathname = NULL;
 
        ACPI_FUNCTION_TRACE(ds_dump_method_stack);
 
@@ -173,25 +173,10 @@ acpi_ds_dump_method_stack(acpi_status status,
 
        while (next_walk_state) {
                method_desc = next_walk_state->method_desc;
-               if (method_desc && method_desc->method.node) {
-                       pathname = acpi_ns_get_normalized_pathname((struct
-                                                                   acpi_namespace_node
-                                                                   *)
-                                                                  method_desc->
-                                                                  method.node,
-                                                                  TRUE);
-               }
-               if (pathname) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                         "End method [0x%p:%s] execution.\n",
-                                         method_desc->method.aml_start,
-                                         pathname));
-                       ACPI_FREE(pathname);
-                       pathname = NULL;
-               } else {
-                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                         "End method [0x%p] execution.\n",
-                                         method_desc->method.aml_start));
+               if (method_desc) {
+                       acpi_ex_stop_trace_method((struct acpi_namespace_node *)
+                                                 method_desc->method.node,
+                                                 method_desc, walk_state);
                }
 
                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
index 0fa6f19aab3a866c446802d5aa24a0fbafe083de..ea2bdde1227ef65ab473fd816c8f39d559d7f135 100644 (file)
@@ -327,7 +327,6 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                               struct acpi_walk_state *walk_state)
 {
        acpi_status status = AE_OK;
-       char *pathname = NULL;
 
        ACPI_FUNCTION_TRACE_PTR(ds_begin_method_execution, method_node);
 
@@ -335,17 +334,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                return_ACPI_STATUS(AE_NULL_ENTRY);
        }
 
-       pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
-       if (pathname) {
-               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                 "Begin method [0x%p:%s] execution.\n",
-                                 obj_desc->method.aml_start, pathname));
-               ACPI_FREE(pathname);
-       } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                 "Begin method [0x%p] execution.\n",
-                                 obj_desc->method.aml_start));
-       }
+       acpi_ex_start_trace_method(method_node, obj_desc, walk_state);
 
        /* Prevent wraparound of thread count */
 
@@ -708,7 +697,6 @@ void
 acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                                 struct acpi_walk_state *walk_state)
 {
-       char *pathname = NULL;
 
        ACPI_FUNCTION_TRACE_PTR(ds_terminate_control_method, walk_state);
 
@@ -846,22 +834,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                }
        }
 
-       if (method_desc->method.node) {
-               pathname = acpi_ns_get_normalized_pathname((struct
-                                                           acpi_namespace_node
-                                                           *)method_desc->
-                                                          method.node, TRUE);
-       }
-       if (pathname) {
-               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                 "End method [0x%p:%s] execution.\n",
-                                 method_desc->method.aml_start, pathname));
-               ACPI_FREE(pathname);
-       } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                 "End method [0x%p] execution.\n",
-                                 method_desc->method.aml_start));
-       }
+       acpi_ex_stop_trace_method((struct acpi_namespace_node *)method_desc->
+                                 method.node, method_desc, walk_state);
 
        return_VOID;
 }
index 815442bbd0518e6d2ee154971966eff3a760c6d5..00ba9fc85f47347fa7d8da6df60189329433176b 100644 (file)
 
 #include <acpi/acpi.h>
 #include "accommon.h"
+#include "acnamesp.h"
 #include "acinterp.h"
+#include "acparser.h"
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exdebug")
 
+static union acpi_operand_object *acpi_gbl_trace_method_object = NULL;
+
 #ifndef ACPI_NO_ERROR_MESSAGES
 /*******************************************************************************
  *
@@ -70,6 +74,7 @@ ACPI_MODULE_NAME("exdebug")
  * enabled if necessary.
  *
  ******************************************************************************/
+
 void
 acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
                        u32 level, u32 index)
@@ -308,3 +313,269 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
        return_VOID;
 }
 #endif
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_interpreter_trace_enabled
+ *
+ * PARAMETERS:  name                - Whether method name should be matched,
+ *                                    this should be checked before starting
+ *                                    the tracer
+ *
+ * RETURN:      TRUE if interpreter trace is enabled.
+ *
+ * DESCRIPTION: Check whether interpreter trace is enabled
+ *
+ ******************************************************************************/
+
+static u8 acpi_ex_interpreter_trace_enabled(char *name)
+{
+
+       /* Check if tracing is enabled */
+
+       if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED)) {
+               return (FALSE);
+       }
+
+       /*
+        * Check if tracing is filtered:
+        *
+        * 1. If the tracer is started, acpi_gbl_trace_method_object should have
+        *    been filled by the trace starter
+        * 2. If the tracer is not started, acpi_gbl_trace_method_name should be
+        *    matched if it is specified
+        * 3. If the tracer is oneshot style, acpi_gbl_trace_method_name should
+        *    not be cleared by the trace stopper during the first match
+        */
+       if (acpi_gbl_trace_method_object) {
+               return (TRUE);
+       }
+       if (name &&
+           (acpi_gbl_trace_method_name &&
+            strcmp(acpi_gbl_trace_method_name, name))) {
+               return (FALSE);
+       }
+       if ((acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT) &&
+           !acpi_gbl_trace_method_name) {
+               return (FALSE);
+       }
+
+       return (TRUE);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_start_trace_method
+ *
+ * PARAMETERS:  method_node         - Node of the method
+ *              obj_desc            - The method object
+ *              walk_state          - current state, NULL if not yet executing
+ *                                    a method.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Start control method execution trace
+ *
+ ******************************************************************************/
+
+void
+acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
+                          union acpi_operand_object *obj_desc,
+                          struct acpi_walk_state *walk_state)
+{
+       acpi_status status;
+       char *pathname = NULL;
+       u8 enabled = FALSE;
+
+       ACPI_FUNCTION_NAME(ex_start_trace_method);
+
+       if (method_node) {
+               pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
+       }
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               goto exit;
+       }
+
+       enabled = acpi_ex_interpreter_trace_enabled(pathname);
+       if (enabled && !acpi_gbl_trace_method_object) {
+               acpi_gbl_trace_method_object = obj_desc;
+               acpi_gbl_original_dbg_level = acpi_dbg_level;
+               acpi_gbl_original_dbg_layer = acpi_dbg_layer;
+               acpi_dbg_level = ACPI_TRACE_LEVEL_ALL;
+               acpi_dbg_layer = ACPI_TRACE_LAYER_ALL;
+
+               if (acpi_gbl_trace_dbg_level) {
+                       acpi_dbg_level = acpi_gbl_trace_dbg_level;
+               }
+               if (acpi_gbl_trace_dbg_layer) {
+                       acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
+               }
+       }
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+
+exit:
+       if (enabled) {
+               if (pathname) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "Begin method [0x%p:%s] execution.\n",
+                                         obj_desc->method.aml_start,
+                                         pathname));
+               } else {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "Begin method [0x%p] execution.\n",
+                                         obj_desc->method.aml_start));
+               }
+       }
+       if (pathname) {
+               ACPI_FREE(pathname);
+       }
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_stop_trace_method
+ *
+ * PARAMETERS:  method_node         - Node of the method
+ *              obj_desc            - The method object
+ *              walk_state          - current state, NULL if not yet executing
+ *                                    a method.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Stop control method execution trace
+ *
+ ******************************************************************************/
+
+void
+acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
+                         union acpi_operand_object *obj_desc,
+                         struct acpi_walk_state *walk_state)
+{
+       acpi_status status;
+       char *pathname = NULL;
+       u8 enabled;
+
+       ACPI_FUNCTION_NAME(ex_stop_trace_method);
+
+       if (method_node) {
+               pathname = acpi_ns_get_normalized_pathname(method_node, TRUE);
+       }
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               goto exit_path;
+       }
+
+       enabled = acpi_ex_interpreter_trace_enabled(NULL);
+
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+
+       if (enabled) {
+               if (pathname) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "End method [0x%p:%s] execution.\n",
+                                         obj_desc->method.aml_start,
+                                         pathname));
+               } else {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "End method [0x%p] execution.\n",
+                                         obj_desc->method.aml_start));
+               }
+       }
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               goto exit_path;
+       }
+
+       /* Check whether the tracer should be stopped */
+
+       if (acpi_gbl_trace_method_object == obj_desc) {
+
+               /* Disable further tracing if type is one-shot */
+
+               if (acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT) {
+                       acpi_gbl_trace_method_name = NULL;
+               }
+
+               acpi_dbg_level = acpi_gbl_original_dbg_level;
+               acpi_dbg_layer = acpi_gbl_original_dbg_layer;
+               acpi_gbl_trace_method_object = NULL;
+       }
+
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+
+exit_path:
+       if (pathname) {
+               ACPI_FREE(pathname);
+       }
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_start_trace_opcode
+ *
+ * PARAMETERS:  op                  - The parser opcode object
+ *              walk_state          - current state, NULL if not yet executing
+ *                                    a method.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Start opcode execution trace
+ *
+ ******************************************************************************/
+
+void
+acpi_ex_start_trace_opcode(union acpi_parse_object *op,
+                          struct acpi_walk_state *walk_state)
+{
+
+       ACPI_FUNCTION_NAME(ex_start_trace_opcode);
+
+       if (acpi_ex_interpreter_trace_enabled(NULL)) {
+               if (walk_state->op_info) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "Begin opcode: %s[0x%p] Class=0x%02x, Type=0x%02x, Flags=0x%04x.\n",
+                                         op->common.aml_op_name,
+                                         op->common.aml,
+                                         walk_state->op_info->class,
+                                         walk_state->op_info->type,
+                                         walk_state->op_info->flags));
+               } else {
+                       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                         "Begin opcode: %s[0x%p].\n",
+                                         op->common.aml_op_name,
+                                         op->common.aml));
+               }
+       }
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_stop_trace_opcode
+ *
+ * PARAMETERS:  op                  - The parser opcode object
+ *              walk_state          - current state, NULL if not yet executing
+ *                                    a method.
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Stop opcode execution trace
+ *
+ ******************************************************************************/
+
+void
+acpi_ex_stop_trace_opcode(union acpi_parse_object *op,
+                         struct acpi_walk_state *walk_state)
+{
+
+       ACPI_FUNCTION_NAME(ex_stop_trace_opcode);
+
+       if (acpi_ex_interpreter_trace_enabled(NULL)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
+                                 "End opcode: %s[0x%p].\n",
+                                 op->common.aml_op_name, op->common.aml));
+       }
+}
index 80339ba56cad0b182221bb765db1021cd0b75b16..a7de52ee15383bf60e3ef2d333428df2dedef2fc 100644 (file)
@@ -51,6 +51,7 @@
 
 #include <acpi/acpi.h>
 #include "accommon.h"
+#include "acinterp.h"
 #include "acparser.h"
 #include "acdispat.h"
 #include "amlcode.h"
@@ -498,20 +499,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
                                                  op->common.aml));
                        }
 
-                       if (walk_state->op_info) {
-                               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                                 "Begin opcode: %s[0x%p] Class=0x%02x, Type=0x%02x, Flags=0x%04x.\n",
-                                                 op->common.aml_op_name,
-                                                 op->common.aml,
-                                                 walk_state->op_info->class,
-                                                 walk_state->op_info->type,
-                                                 walk_state->op_info->flags));
-                       } else {
-                               ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                                                 "Begin opcode: %s[0x%p].\n",
-                                                 op->common.aml_op_name,
-                                                 op->common.aml));
-                       }
+                       acpi_ex_start_trace_opcode(op, walk_state);
                }
 
                /*
index 97ea0e5360f162f76612d84a64640d838f8d4e27..98001d7f6f8035534bb4f2d700b2f47415b8a1dd 100644 (file)
@@ -147,9 +147,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
                return_ACPI_STATUS(AE_OK);      /* OK for now */
        }
 
-       ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
-                         "End opcode: %s[0x%p].\n",
-                         op->common.aml_op_name, op->common.aml));
+       acpi_ex_stop_trace_opcode(op, walk_state);
 
        /* Delete this op and the subtree below it if asked to */
 
index 1f3f46d44312ed93c6ea85f8fc2777c3b8196f83..4254805dd319ad631762fb793a7239a208898824 100644 (file)
 #include "acdispat.h"
 #include "acinterp.h"
 #include "actables.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psxface")
 
 /* Local Prototypes */
-static void acpi_ps_start_trace(struct acpi_evaluate_info *info);
-
-static void acpi_ps_stop_trace(struct acpi_evaluate_info *info);
-
 static void
 acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action);
 
@@ -76,7 +73,7 @@ acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action);
  ******************************************************************************/
 
 acpi_status
-acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags)
+acpi_debug_trace(const char *name, u32 debug_level, u32 debug_layer, u32 flags)
 {
        acpi_status status;
 
@@ -85,108 +82,14 @@ acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags)
                return (status);
        }
 
-       /* TBDs: Validate name, allow full path or just nameseg */
-
-       acpi_gbl_trace_method_name = *ACPI_CAST_PTR(u32, name);
+       acpi_gbl_trace_method_name = name;
        acpi_gbl_trace_flags = flags;
-
-       if (debug_level) {
-               acpi_gbl_trace_dbg_level = debug_level;
-       }
-       if (debug_layer) {
-               acpi_gbl_trace_dbg_layer = debug_layer;
-       }
+       acpi_gbl_trace_dbg_level = debug_level;
+       acpi_gbl_trace_dbg_layer = debug_layer;
+       status = AE_OK;
 
        (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
-       return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ps_start_trace
- *
- * PARAMETERS:  info        - Method info struct
- *
- * RETURN:      None
- *
- * DESCRIPTION: Start control method execution trace
- *
- ******************************************************************************/
-
-static void acpi_ps_start_trace(struct acpi_evaluate_info *info)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_ENTRY();
-
-       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
-       if (ACPI_FAILURE(status)) {
-               return;
-       }
-
-       if ((!acpi_gbl_trace_method_name) ||
-           (acpi_gbl_trace_method_name != info->node->name.integer)) {
-               goto exit;
-       }
-
-       acpi_gbl_original_dbg_level = acpi_dbg_level;
-       acpi_gbl_original_dbg_layer = acpi_dbg_layer;
-
-       acpi_dbg_level = 0x00FFFFFF;
-       acpi_dbg_layer = ACPI_UINT32_MAX;
-
-       if (acpi_gbl_trace_dbg_level) {
-               acpi_dbg_level = acpi_gbl_trace_dbg_level;
-       }
-       if (acpi_gbl_trace_dbg_layer) {
-               acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
-       }
-
-exit:
-       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ps_stop_trace
- *
- * PARAMETERS:  info        - Method info struct
- *
- * RETURN:      None
- *
- * DESCRIPTION: Stop control method execution trace
- *
- ******************************************************************************/
-
-static void acpi_ps_stop_trace(struct acpi_evaluate_info *info)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_ENTRY();
-
-       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
-       if (ACPI_FAILURE(status)) {
-               return;
-       }
-
-       if ((!acpi_gbl_trace_method_name) ||
-           (acpi_gbl_trace_method_name != info->node->name.integer)) {
-               goto exit;
-       }
-
-       /* Disable further tracing if type is one-shot */
-
-       if (acpi_gbl_trace_flags & 1) {
-               acpi_gbl_trace_method_name = 0;
-               acpi_gbl_trace_dbg_level = 0;
-               acpi_gbl_trace_dbg_layer = 0;
-       }
-
-       acpi_dbg_level = acpi_gbl_original_dbg_level;
-       acpi_dbg_layer = acpi_gbl_original_dbg_layer;
-
-exit:
-       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+       return (status);
 }
 
 /*******************************************************************************
@@ -212,7 +115,7 @@ exit:
  *
  ******************************************************************************/
 
-acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
+acpi_status acpi_ps_execute_method(struct acpi_evaluate_info * info)
 {
        acpi_status status;
        union acpi_parse_object *op;
@@ -243,10 +146,6 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
         */
        acpi_ps_update_parameter_list(info, REF_INCREMENT);
 
-       /* Begin tracing if requested */
-
-       acpi_ps_start_trace(info);
-
        /*
         * Execute the method. Performs parse simultaneously
         */
@@ -326,10 +225,6 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
 cleanup:
        acpi_ps_delete_parse_tree(op);
 
-       /* End optional tracing */
-
-       acpi_ps_stop_trace(info);
-
        /* Take away the extra reference that we gave the parameters above */
 
        acpi_ps_update_parameter_list(info, REF_DECREMENT);
index e402e07b4846690c38f0fec9e0621b62dcd6273f..7f897c63aa5be9481c91c8d761d1e028914cfba4 100644 (file)
@@ -204,8 +204,6 @@ acpi_status acpi_ut_init_globals(void)
        acpi_gbl_acpi_hardware_present = TRUE;
        acpi_gbl_last_owner_id_index = 0;
        acpi_gbl_next_owner_id_offset = 0;
-       acpi_gbl_trace_dbg_level = 0;
-       acpi_gbl_trace_dbg_layer = 0;
        acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
        acpi_gbl_osi_mutex = NULL;
        acpi_gbl_reg_methods_executed = FALSE;
index 8f89df9c7295b43505362add186376deb66c2783..37f46d49a74a66741715da0816ccfc7de273022d 100644 (file)
 #define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
 #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
 
+/*
+ * Global trace flags
+ */
+#define ACPI_TRACE_ENABLED          ((u32) 2)
+#define ACPI_TRACE_ONESHOT          ((u32) 1)
+
+/* Defaults for trace debugging level/layer */
+
+#define ACPI_TRACE_LEVEL_ALL        ACPI_LV_ALL
+#define ACPI_TRACE_LAYER_ALL        0x000001FF
+#define ACPI_TRACE_LEVEL_DEFAULT    ACPI_LV_TRACE_POINT
+#define ACPI_TRACE_LAYER_DEFAULT    ACPI_EXECUTER
+
 #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
 /*
  * The module name is used primarily for error and debug messages.
index e8ec18a4a634d8d5679a49757fcb616233ec5a9d..9c362cf14264170b329feaf1458fa254bd3cb390 100644 (file)
@@ -251,7 +251,9 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
  * traced each time it is executed.
  */
 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
-ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0);
+ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL);
+ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT);
+ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
 
 /*
  * Runtime configuration of debug output control masks. We want the debug
@@ -504,7 +506,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                                           acpi_object_handler handler,
                                           void **data))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
-                            acpi_debug_trace(char *name, u32 debug_level,
+                            acpi_debug_trace(const char *name, u32 debug_level,
                                              u32 debug_layer, u32 flags))
 
 /*