diff options
author | Bob Moore <robert.moore@intel.com> | 2008-04-10 11:06:43 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 19:09:16 -0400 |
commit | d8846574ed4a81be319bf68728f9cca9af595afd (patch) | |
tree | 0e58d06bcda223d07528d83d5a457cb90466af46 /drivers/acpi/executer | |
parent | cd0b2248241f4146152fb04a6bf4bccb6ce0478a (diff) |
ACPICA: Updates for Debug object output
Implemented several improvements for the output of the ASL "Debug"
object to clarify and keep all data for a given object on one
output line.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/exstore.c | 76 |
1 files changed, 52 insertions, 24 deletions
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c index 36c0fccb137a..dbc5e18ee150 100644 --- a/drivers/acpi/executer/exstore.c +++ b/drivers/acpi/executer/exstore.c | |||
@@ -84,8 +84,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
84 | 84 | ||
85 | ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); | 85 | ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); |
86 | 86 | ||
87 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", | 87 | /* Print line header as long as we are not in the middle of an object display */ |
88 | level, " ")); | 88 | |
89 | if (!((level > 0) && index == 0)) { | ||
90 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", | ||
91 | level, " ")); | ||
92 | } | ||
89 | 93 | ||
90 | /* Display index for package output only */ | 94 | /* Display index for package output only */ |
91 | 95 | ||
@@ -95,12 +99,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
95 | } | 99 | } |
96 | 100 | ||
97 | if (!source_desc) { | 101 | if (!source_desc) { |
98 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "<Null Object>\n")); | 102 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[Null Object]\n")); |
99 | return_VOID; | 103 | return_VOID; |
100 | } | 104 | } |
101 | 105 | ||
102 | if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { | 106 | if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) { |
103 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: ", | 107 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s ", |
104 | acpi_ut_get_object_type_name | 108 | acpi_ut_get_object_type_name |
105 | (source_desc))); | 109 | (source_desc))); |
106 | 110 | ||
@@ -162,7 +166,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
162 | case ACPI_TYPE_PACKAGE: | 166 | case ACPI_TYPE_PACKAGE: |
163 | 167 | ||
164 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, | 168 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, |
165 | "[0x%.2X Elements]\n", | 169 | "[Contains 0x%.2X Elements]\n", |
166 | source_desc->package.count)); | 170 | source_desc->package.count)); |
167 | 171 | ||
168 | /* Output the entire contents of the package */ | 172 | /* Output the entire contents of the package */ |
@@ -194,8 +198,47 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
194 | break; | 198 | break; |
195 | } | 199 | } |
196 | 200 | ||
197 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "\n")); | 201 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, " ")); |
198 | if (source_desc->reference.object) { | 202 | |
203 | /* Check for valid node first, then valid object */ | ||
204 | |||
205 | if (source_desc->reference.node) { | ||
206 | if (ACPI_GET_DESCRIPTOR_TYPE | ||
207 | (source_desc->reference.node) != | ||
208 | ACPI_DESC_TYPE_NAMED) { | ||
209 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, | ||
210 | " %p - Not a valid namespace node\n", | ||
211 | source_desc->reference. | ||
212 | node)); | ||
213 | } else { | ||
214 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, | ||
215 | "Node %p [%4.4s] ", | ||
216 | source_desc->reference. | ||
217 | node, | ||
218 | (source_desc->reference. | ||
219 | node)->name.ascii)); | ||
220 | |||
221 | switch ((source_desc->reference.node)->type) { | ||
222 | |||
223 | /* These types have no attached object */ | ||
224 | |||
225 | case ACPI_TYPE_DEVICE: | ||
226 | acpi_os_printf("Device\n"); | ||
227 | break; | ||
228 | |||
229 | case ACPI_TYPE_THERMAL: | ||
230 | acpi_os_printf("Thermal Zone\n"); | ||
231 | break; | ||
232 | |||
233 | default: | ||
234 | acpi_ex_do_debug_object((source_desc-> | ||
235 | reference. | ||
236 | node)->object, | ||
237 | level + 4, 0); | ||
238 | break; | ||
239 | } | ||
240 | } | ||
241 | } else if (source_desc->reference.object) { | ||
199 | if (ACPI_GET_DESCRIPTOR_TYPE | 242 | if (ACPI_GET_DESCRIPTOR_TYPE |
200 | (source_desc->reference.object) == | 243 | (source_desc->reference.object) == |
201 | ACPI_DESC_TYPE_NAMED) { | 244 | ACPI_DESC_TYPE_NAMED) { |
@@ -208,28 +251,13 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
208 | acpi_ex_do_debug_object(source_desc->reference. | 251 | acpi_ex_do_debug_object(source_desc->reference. |
209 | object, level + 4, 0); | 252 | object, level + 4, 0); |
210 | } | 253 | } |
211 | } else if (source_desc->reference.node) { | ||
212 | if (ACPI_GET_DESCRIPTOR_TYPE | ||
213 | (source_desc->reference.node) != | ||
214 | ACPI_DESC_TYPE_NAMED) { | ||
215 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, | ||
216 | " %p - Not a valid namespace node\n", | ||
217 | source_desc->reference. | ||
218 | node)); | ||
219 | } else { | ||
220 | acpi_ex_do_debug_object((source_desc->reference. | ||
221 | node)->object, | ||
222 | level + 4, 0); | ||
223 | } | ||
224 | } | 254 | } |
225 | break; | 255 | break; |
226 | 256 | ||
227 | default: | 257 | default: |
228 | 258 | ||
229 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p %s\n", | 259 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p\n", |
230 | source_desc, | 260 | source_desc)); |
231 | acpi_ut_get_object_type_name | ||
232 | (source_desc))); | ||
233 | break; | 261 | break; |
234 | } | 262 | } |
235 | 263 | ||