aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/utdebug.c')
-rw-r--r--drivers/acpi/acpica/utdebug.c120
1 files changed, 79 insertions, 41 deletions
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 5d95166245ae..c57d9cc07ba9 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2012, Intel Corp. 8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -166,11 +166,9 @@ acpi_debug_print(u32 requested_debug_level,
166 acpi_thread_id thread_id; 166 acpi_thread_id thread_id;
167 va_list args; 167 va_list args;
168 168
169 /* 169 /* Check if debug output enabled */
170 * Stay silent if the debug level or component ID is disabled 170
171 */ 171 if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) {
172 if (!(requested_debug_level & acpi_dbg_level) ||
173 !(component_id & acpi_dbg_layer)) {
174 return; 172 return;
175 } 173 }
176 174
@@ -236,8 +234,9 @@ acpi_debug_print_raw(u32 requested_debug_level,
236{ 234{
237 va_list args; 235 va_list args;
238 236
239 if (!(requested_debug_level & acpi_dbg_level) || 237 /* Check if debug output enabled */
240 !(component_id & acpi_dbg_layer)) { 238
239 if (!ACPI_IS_DEBUG_ENABLED(requested_debug_level, component_id)) {
241 return; 240 return;
242 } 241 }
243 242
@@ -272,9 +271,13 @@ acpi_ut_trace(u32 line_number,
272 acpi_gbl_nesting_level++; 271 acpi_gbl_nesting_level++;
273 acpi_ut_track_stack_ptr(); 272 acpi_ut_track_stack_ptr();
274 273
275 acpi_debug_print(ACPI_LV_FUNCTIONS, 274 /* Check if enabled up-front for performance */
276 line_number, function_name, module_name, component_id, 275
277 "%s\n", acpi_gbl_fn_entry_str); 276 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
277 acpi_debug_print(ACPI_LV_FUNCTIONS,
278 line_number, function_name, module_name,
279 component_id, "%s\n", acpi_gbl_fn_entry_str);
280 }
278} 281}
279 282
280ACPI_EXPORT_SYMBOL(acpi_ut_trace) 283ACPI_EXPORT_SYMBOL(acpi_ut_trace)
@@ -304,9 +307,14 @@ acpi_ut_trace_ptr(u32 line_number,
304 acpi_gbl_nesting_level++; 307 acpi_gbl_nesting_level++;
305 acpi_ut_track_stack_ptr(); 308 acpi_ut_track_stack_ptr();
306 309
307 acpi_debug_print(ACPI_LV_FUNCTIONS, 310 /* Check if enabled up-front for performance */
308 line_number, function_name, module_name, component_id, 311
309 "%s %p\n", acpi_gbl_fn_entry_str, pointer); 312 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
313 acpi_debug_print(ACPI_LV_FUNCTIONS,
314 line_number, function_name, module_name,
315 component_id, "%s %p\n", acpi_gbl_fn_entry_str,
316 pointer);
317 }
310} 318}
311 319
312/******************************************************************************* 320/*******************************************************************************
@@ -335,9 +343,14 @@ acpi_ut_trace_str(u32 line_number,
335 acpi_gbl_nesting_level++; 343 acpi_gbl_nesting_level++;
336 acpi_ut_track_stack_ptr(); 344 acpi_ut_track_stack_ptr();
337 345
338 acpi_debug_print(ACPI_LV_FUNCTIONS, 346 /* Check if enabled up-front for performance */
339 line_number, function_name, module_name, component_id, 347
340 "%s %s\n", acpi_gbl_fn_entry_str, string); 348 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
349 acpi_debug_print(ACPI_LV_FUNCTIONS,
350 line_number, function_name, module_name,
351 component_id, "%s %s\n", acpi_gbl_fn_entry_str,
352 string);
353 }
341} 354}
342 355
343/******************************************************************************* 356/*******************************************************************************
@@ -366,9 +379,14 @@ acpi_ut_trace_u32(u32 line_number,
366 acpi_gbl_nesting_level++; 379 acpi_gbl_nesting_level++;
367 acpi_ut_track_stack_ptr(); 380 acpi_ut_track_stack_ptr();
368 381
369 acpi_debug_print(ACPI_LV_FUNCTIONS, 382 /* Check if enabled up-front for performance */
370 line_number, function_name, module_name, component_id, 383
371 "%s %08X\n", acpi_gbl_fn_entry_str, integer); 384 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
385 acpi_debug_print(ACPI_LV_FUNCTIONS,
386 line_number, function_name, module_name,
387 component_id, "%s %08X\n",
388 acpi_gbl_fn_entry_str, integer);
389 }
372} 390}
373 391
374/******************************************************************************* 392/*******************************************************************************
@@ -393,9 +411,13 @@ acpi_ut_exit(u32 line_number,
393 const char *module_name, u32 component_id) 411 const char *module_name, u32 component_id)
394{ 412{
395 413
396 acpi_debug_print(ACPI_LV_FUNCTIONS, 414 /* Check if enabled up-front for performance */
397 line_number, function_name, module_name, component_id, 415
398 "%s\n", acpi_gbl_fn_exit_str); 416 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
417 acpi_debug_print(ACPI_LV_FUNCTIONS,
418 line_number, function_name, module_name,
419 component_id, "%s\n", acpi_gbl_fn_exit_str);
420 }
399 421
400 acpi_gbl_nesting_level--; 422 acpi_gbl_nesting_level--;
401} 423}
@@ -425,17 +447,23 @@ acpi_ut_status_exit(u32 line_number,
425 u32 component_id, acpi_status status) 447 u32 component_id, acpi_status status)
426{ 448{
427 449
428 if (ACPI_SUCCESS(status)) { 450 /* Check if enabled up-front for performance */
429 acpi_debug_print(ACPI_LV_FUNCTIONS, 451
430 line_number, function_name, module_name, 452 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
431 component_id, "%s %s\n", acpi_gbl_fn_exit_str, 453 if (ACPI_SUCCESS(status)) {
432 acpi_format_exception(status)); 454 acpi_debug_print(ACPI_LV_FUNCTIONS,
433 } else { 455 line_number, function_name,
434 acpi_debug_print(ACPI_LV_FUNCTIONS, 456 module_name, component_id, "%s %s\n",
435 line_number, function_name, module_name, 457 acpi_gbl_fn_exit_str,
436 component_id, "%s ****Exception****: %s\n", 458 acpi_format_exception(status));
437 acpi_gbl_fn_exit_str, 459 } else {
438 acpi_format_exception(status)); 460 acpi_debug_print(ACPI_LV_FUNCTIONS,
461 line_number, function_name,
462 module_name, component_id,
463 "%s ****Exception****: %s\n",
464 acpi_gbl_fn_exit_str,
465 acpi_format_exception(status));
466 }
439 } 467 }
440 468
441 acpi_gbl_nesting_level--; 469 acpi_gbl_nesting_level--;
@@ -465,10 +493,15 @@ acpi_ut_value_exit(u32 line_number,
465 const char *module_name, u32 component_id, u64 value) 493 const char *module_name, u32 component_id, u64 value)
466{ 494{
467 495
468 acpi_debug_print(ACPI_LV_FUNCTIONS, 496 /* Check if enabled up-front for performance */
469 line_number, function_name, module_name, component_id, 497
470 "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, 498 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
471 ACPI_FORMAT_UINT64(value)); 499 acpi_debug_print(ACPI_LV_FUNCTIONS,
500 line_number, function_name, module_name,
501 component_id, "%s %8.8X%8.8X\n",
502 acpi_gbl_fn_exit_str,
503 ACPI_FORMAT_UINT64(value));
504 }
472 505
473 acpi_gbl_nesting_level--; 506 acpi_gbl_nesting_level--;
474} 507}
@@ -497,9 +530,14 @@ acpi_ut_ptr_exit(u32 line_number,
497 const char *module_name, u32 component_id, u8 *ptr) 530 const char *module_name, u32 component_id, u8 *ptr)
498{ 531{
499 532
500 acpi_debug_print(ACPI_LV_FUNCTIONS, 533 /* Check if enabled up-front for performance */
501 line_number, function_name, module_name, component_id, 534
502 "%s %p\n", acpi_gbl_fn_exit_str, ptr); 535 if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
536 acpi_debug_print(ACPI_LV_FUNCTIONS,
537 line_number, function_name, module_name,
538 component_id, "%s %p\n", acpi_gbl_fn_exit_str,
539 ptr);
540 }
503 541
504 acpi_gbl_nesting_level--; 542 acpi_gbl_nesting_level--;
505} 543}