diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-07-23 12:52:53 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-07-23 23:09:07 +0200 |
commit | a616dc2fe50270f1fa5050fb9cd88a08531a3f25 (patch) | |
tree | 425ee0df81280c30f004497a10a103d2e857e061 | |
parent | 0bac4295526c67e87ec24b29762140c38de7c86a (diff) | |
download | linux-a616dc2fe50270f1fa5050fb9cd88a08531a3f25.tar.gz linux-a616dc2fe50270f1fa5050fb9cd88a08531a3f25.tar.bz2 linux-a616dc2fe50270f1fa5050fb9cd88a08531a3f25.zip |
ACPICA: Dispatcher: Add trace support for interpreter
ACPICA commit 71299ec8b49054daace0df50268e8e055654ca37
This patch adds trace point at the following point:
1. Begin/end of a control method execution;
2. Begin/end of an opcode execution.
The trace point feature can be enabled by defining ACPI_DEBUG_OUTPUT
and specifying a debug level that includes ACPI_LV_TRACDE_POINT and the
debug layers that include ACPI_PARSER and ACPI_DISPACTCHER.
In order to make aml_op_name of union acpi_parse_object usable for tracer, it is
enabled for ACPI_DEBUG_OUTPUT in this patch. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/71299ec8
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>
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/dsdebug.c | 24 | ||||
-rw-r--r-- | drivers/acpi/acpica/dsmethod.c | 31 | ||||
-rw-r--r-- | drivers/acpi/acpica/psloop.c | 15 | ||||
-rw-r--r-- | drivers/acpi/acpica/psparse.c | 4 | ||||
-rw-r--r-- | include/acpi/acoutput.h | 4 |
6 files changed, 78 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 607e62897aff..610d001fbb31 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h @@ -715,7 +715,7 @@ union acpi_parse_value { union acpi_parse_object *arg; /* arguments and contained ops */ }; -#ifdef ACPI_DISASSEMBLER +#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) #define ACPI_DISASM_ONLY_MEMBERS(a) a; #else #define ACPI_DISASM_ONLY_MEMBERS(a) diff --git a/drivers/acpi/acpica/dsdebug.c b/drivers/acpi/acpica/dsdebug.c index 21c6cefd267e..7df9b50e17a7 100644 --- a/drivers/acpi/acpica/dsdebug.c +++ b/drivers/acpi/acpica/dsdebug.c @@ -127,6 +127,8 @@ acpi_ds_dump_method_stack(acpi_status status, struct acpi_thread_state *thread; 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); @@ -170,6 +172,28 @@ acpi_ds_dump_method_stack(acpi_status status, /* Walk list of linked walk states */ 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)); + } + ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, " Method [%4.4s] executing: ", acpi_ut_get_node_name(next_walk_state-> diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index e0ae8f4e9b35..0fa6f19aab3a 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c @@ -327,6 +327,7 @@ 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); @@ -334,6 +335,18 @@ 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)); + } + /* Prevent wraparound of thread count */ if (obj_desc->method.thread_count == ACPI_UINT8_MAX) { @@ -695,6 +708,7 @@ 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); @@ -832,5 +846,22 @@ 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)); + } + return_VOID; } diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 49c60c2671ef..80339ba56cad 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c @@ -497,6 +497,21 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) walk_state->op_info->name, op, 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)); + } } /* diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index b857ad58022a..97ea0e5360f1 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c @@ -147,6 +147,10 @@ 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)); + /* Delete this op and the subtree below it if asked to */ if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) != diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index f56de8c5d844..8f89df9c7295 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -88,7 +88,8 @@ #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 #define ACPI_LV_REPAIR 0x00000008 -#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F +#define ACPI_LV_TRACE_POINT 0x00000010 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -147,6 +148,7 @@ #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) #define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) +#define ACPI_DB_TRACE_POINT ACPI_DEBUG_LEVEL (ACPI_LV_TRACE_POINT) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ |