ACPICA: Debug Object: Cleanup output
ACPICA commit 05492c4a7d1e106eb871a5e1357ed564d25740e5 1) Make the timer value output optional 2) Allow empty lines via null string or simple newline 3) No need for the object type name for strings and integers 4) Miscellaneous cleanup of output Link: https://github.com/acpica/acpica/commit/05492c4a Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
7910617efb
commit
5e568304a2
|
@ -88,20 +88,39 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Null string or newline -- don't emit the line header */
|
||||||
* We will emit the current timer value (in microseconds) with each
|
|
||||||
* debug output. Only need the lower 26 bits. This allows for 67
|
if ((ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) &&
|
||||||
* million microseconds or 67 seconds before rollover.
|
(source_desc->common.type == ACPI_TYPE_STRING)) {
|
||||||
*/
|
if ((source_desc->string.length == 0) ||
|
||||||
timer = ((u32)acpi_os_get_timer() / 10); /* (100 nanoseconds to microseconds) */
|
((source_desc->string.length == 1) &&
|
||||||
timer &= 0x03FFFFFF;
|
(*source_desc->string.pointer == '\n'))) {
|
||||||
|
acpi_os_printf("\n");
|
||||||
|
return_VOID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print line header as long as we are not in the middle of an
|
* Print line header as long as we are not in the middle of an
|
||||||
* object display
|
* object display
|
||||||
*/
|
*/
|
||||||
if (!((level > 0) && index == 0)) {
|
if (!((level > 0) && index == 0)) {
|
||||||
acpi_os_printf("[ACPI Debug %.8u] %*s", timer, level, " ");
|
if (acpi_gbl_display_debug_timer) {
|
||||||
|
/*
|
||||||
|
* We will emit the current timer value (in microseconds) with each
|
||||||
|
* debug output. Only need the lower 26 bits. This allows for 67
|
||||||
|
* million microseconds or 67 seconds before rollover.
|
||||||
|
*
|
||||||
|
* Convert 100 nanosecond units to microseconds
|
||||||
|
*/
|
||||||
|
timer = ((u32)acpi_os_get_timer() / 10);
|
||||||
|
timer &= 0x03FFFFFF;
|
||||||
|
|
||||||
|
acpi_os_printf("[ACPI Debug T=0x%8.8X] %*s", timer,
|
||||||
|
level, " ");
|
||||||
|
} else {
|
||||||
|
acpi_os_printf("[ACPI Debug] %*s", level, " ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the index for package output only */
|
/* Display the index for package output only */
|
||||||
|
@ -116,8 +135,15 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
|
if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
|
||||||
acpi_os_printf("%s ",
|
|
||||||
acpi_ut_get_object_type_name(source_desc));
|
/* No object type prefix needed for integers and strings */
|
||||||
|
|
||||||
|
if ((source_desc->common.type != ACPI_TYPE_INTEGER) &&
|
||||||
|
(source_desc->common.type != ACPI_TYPE_STRING)) {
|
||||||
|
acpi_os_printf("%s ",
|
||||||
|
acpi_ut_get_object_type_name
|
||||||
|
(source_desc));
|
||||||
|
}
|
||||||
|
|
||||||
if (!acpi_ut_valid_internal_object(source_desc)) {
|
if (!acpi_ut_valid_internal_object(source_desc)) {
|
||||||
acpi_os_printf("%p, Invalid Internal Object!\n",
|
acpi_os_printf("%p, Invalid Internal Object!\n",
|
||||||
|
@ -126,7 +152,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
}
|
}
|
||||||
} else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) ==
|
} else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) ==
|
||||||
ACPI_DESC_TYPE_NAMED) {
|
ACPI_DESC_TYPE_NAMED) {
|
||||||
acpi_os_printf("%s: %p\n",
|
acpi_os_printf("%s (Node %p)\n",
|
||||||
acpi_ut_get_type_name(((struct
|
acpi_ut_get_type_name(((struct
|
||||||
acpi_namespace_node *)
|
acpi_namespace_node *)
|
||||||
source_desc)->type),
|
source_desc)->type),
|
||||||
|
@ -164,14 +190,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
|
|
||||||
case ACPI_TYPE_STRING:
|
case ACPI_TYPE_STRING:
|
||||||
|
|
||||||
acpi_os_printf("[0x%.2X] \"%s\"\n",
|
acpi_os_printf("\"%s\"\n", source_desc->string.pointer);
|
||||||
source_desc->string.length,
|
|
||||||
source_desc->string.pointer);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_TYPE_PACKAGE:
|
case ACPI_TYPE_PACKAGE:
|
||||||
|
|
||||||
acpi_os_printf("[Contains 0x%.2X Elements]\n",
|
acpi_os_printf("(Contains 0x%.2X Elements):\n",
|
||||||
source_desc->package.count);
|
source_desc->package.count);
|
||||||
|
|
||||||
/* Output the entire contents of the package */
|
/* Output the entire contents of the package */
|
||||||
|
@ -250,11 +274,14 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
if (ACPI_GET_DESCRIPTOR_TYPE
|
if (ACPI_GET_DESCRIPTOR_TYPE
|
||||||
(source_desc->reference.object) ==
|
(source_desc->reference.object) ==
|
||||||
ACPI_DESC_TYPE_NAMED) {
|
ACPI_DESC_TYPE_NAMED) {
|
||||||
acpi_ex_do_debug_object(((struct
|
|
||||||
acpi_namespace_node *)
|
/* Reference object is a namespace node */
|
||||||
|
|
||||||
|
acpi_ex_do_debug_object(ACPI_CAST_PTR
|
||||||
|
(union
|
||||||
|
acpi_operand_object,
|
||||||
source_desc->reference.
|
source_desc->reference.
|
||||||
object)->object,
|
object), level + 4, 0);
|
||||||
level + 4, 0);
|
|
||||||
} else {
|
} else {
|
||||||
object_desc = source_desc->reference.object;
|
object_desc = source_desc->reference.object;
|
||||||
value = source_desc->reference.value;
|
value = source_desc->reference.value;
|
||||||
|
@ -300,7 +327,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
acpi_os_printf("%p\n", source_desc);
|
acpi_os_printf("(Descriptor %p)\n", source_desc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,6 +263,10 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
|
||||||
ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
|
ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
|
||||||
ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
|
ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
|
||||||
|
|
||||||
|
/* Optionally enable timer output with Debug Object output */
|
||||||
|
|
||||||
|
ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugger command handshake globals. Host OSes need to access these
|
* Debugger command handshake globals. Host OSes need to access these
|
||||||
* variables to implement their own command handshake mechanism.
|
* variables to implement their own command handshake mechanism.
|
||||||
|
|
Loading…
Reference in New Issue