Print error, debug and info messages even if ACPI_DEBUG is off
Subsystems (2)
Shouldn't at least all error and warning messages be printed even if ACPI_DEBUG is off?
I collected all ACPI_DEBUG_PRINT (ACPI_DB_ERROR | ACPI_DB_WARN | ACPI_DB_INFO, ...) messages for discussion under:
ftp://ftp.suse.com/pub/people/trenn/acpi_messages/acpi_DEBUG_ERROR_messages ftp://ftp.suse.com/pub/people/trenn/acpi_messages/acpi_DEBUG_WARNING_messages ftp://ftp.suse.com/pub/people/trenn/acpi_messages/acpi_DEBUG_INFO_messages
The patch (2.6.11-rc5) attached provides another config, ACPI_DEBUG_LITE, that at least prints out ACPI_DB_ERROR | ACPI_DB_WARN messages.
It's probably cleaner to convert:
ACPI_DEBUG_PRINT (ACPI_DB_ERROR, ...) -> ACPI_REPORT_ERROR (...)ACPI_DEBUG_PRINT (ACPI_DB_WARNING, ...) -> ACPI_REPORT_WARNING (...)ACPI_DEBUG_PRINT (ACPI_DB_INFO, ...) -> ACPI_REPORT_INFO (...)
to show that messages, even if ACPI_DEBUG is disabled, without the need of another config variable.
Before I start on this one, I'd appreciate if someone of the Intel people could comment whether this will be accepted for mainline.
Thanks,
Thomas
Author: Thomas Renninger (mail-smMupaH/[email protected])
Patch provides new ACPI_DEBUG_LITE config that prints ACPI_DB_ERROR and ACPI_DB_WARNING messages even if ACPI_DEBUG (which uses significantly amount of CPU since latest kernel versions) is not set.
drivers/acpi/executer/exconvrt.c renamed from drivers/acpi/executer/exconvrt.c.orig +2 -4
@@ -682,11 +682,9 @@default : -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR , -"Unknown Target type ID 0x%X Op %s dest_type %s\n" , +ACPI_REPORT_ERROR (("Unknown Target type ID 0x%X dest_type %s\n" ,GET_CURRENT_ARG_TYPE (walk_state->op_info->runtime_args), - walk_state->op_info->name,acpi_ut_get_type_name (destination_type))); - +acpi_ut_get_type_name (destination_type)));ACPI_REPORT_ERROR (("Bad Target Type (ARGI): %X\n" ,GET_CURRENT_ARG_TYPE (walk_state->op_info->runtime_args))) status = AE_AML_INTERNAL;
drivers/acpi/executer/exresop.c renamed from drivers/acpi/executer/exresop.c.orig +4 -4
@@ -159,9 +159,10 @@return_ACPI_STATUS (AE_AML_INTERNAL ); } - +#ifdef ACPI_DEBUG_OUTPUT ACPI_DEBUG_PRINT ((ACPI_DB_EXEC ,"Opcode %X [%s] required_operand_types=%8.8X \n" , opcode, op_info->name, arg_types)); +#endif /* * Normal exit is with (arg_types == 0) at end of argument list.
@@ -232,10 +233,9 @@break ;default : -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR , +ACPI_REPORT_ERROR (("Operand is a Reference, Unknown Reference Opcode %X [%s]\n" , - obj_desc->reference.opcode, - (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name)); + obj_desc->reference.opcode));return_ACPI_STATUS (AE_AML_OPERAND_TYPE ); }
drivers/acpi/dispatcher/dswload.c renamed from drivers/acpi/dispatcher/dswload.c.orig +2 -1
@@ -706,9 +706,10 @@ACPI_FUNCTION_TRACE ("ds_load2_end_op" ); op = walk_state->op; +#ifdef ACPI_DEBUG_OUTPUT ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH ,"Opcode [%s] Op %p State %p\n" , walk_state->op_info->name, op, walk_state)); - +#endif /* Only interested in opcodes that have namespace objects */ if (!(walk_state->op_info->flags &AML_NSOBJECT )) {
drivers/acpi/events/evmisc.c renamed from drivers/acpi/events/evmisc.c.orig +2 -1
@@ -132,6 +132,7 @@* For value 0x80 (Status Change) on the power button or sleep button, * initiate soft-off or sleep operation? */ +#ifdef ACPI_DEBUG_OUTPUT ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Dispatching Notify(%X) on node %p\n" , notify_value, node));
@@ -143,7 +144,7 @@ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Notify value: 0x%2.2X **Device Specific**\n" , notify_value)); } - +#endif /* Get the notify object attached to the NS Node */ obj_desc =acpi_ns_get_attached_object (node);
drivers/acpi/namespace/nsalloc.c renamed from drivers/acpi/namespace/nsalloc.c.orig +2 -1
@@ -409,9 +409,10 @@ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE ].total_freed++); +#ifdef ACPI_DEBUG_OUTPUT ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS ,"Object %p, Remaining %X\n" , child_node, acpi_gbl_current_node_count)); - +#endif /* * Detach an object if there is one, then free the child node */
drivers/acpi/parser/psparse.c renamed from drivers/acpi/parser/psparse.c.orig +2 -0
@@ -680,10 +680,12 @@ op->common.aml_offset = walk_state->aml_offset;if (walk_state->op_info) { +#ifdef ACPI_DEBUG_OUTPUT ACPI_DEBUG_PRINT ((ACPI_DB_PARSE ,"Opcode %4.4X [%s] Op %p Aml %p aml_offset %5.5X\n" , (u32 ) op->common.aml_opcode, walk_state->op_info->name, op, parser_state->aml, op->common.aml_offset)); +#endif } }
drivers/acpi/utilities/utmisc.c renamed from drivers/acpi/utilities/utmisc.c.orig +10 -9
@@ -736,8 +736,8 @@ acpi_gbl_mutex_info[mutex_id].owner_id = this_thread_id; }else { -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Thread %X could not acquire Mutex [%s] %s\n" , - this_thread_id,acpi_ut_get_mutex_name (mutex_id), +ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Thread %X could not acquire Mutex %s\n" , + this_thread_id,acpi_format_exception (status))); }
@@ -783,8 +783,7 @@*/ if (acpi_gbl_mutex_info[mutex_id].owner_id ==ACPI_MUTEX_NOT_ACQUIRED ) {ACPI_DEBUG_PRINT ((ACPI_DB_ERROR , -"Mutex [%s] is not acquired, cannot release\n" , -acpi_ut_get_mutex_name (mutex_id))); +"Mutex is not acquired, cannot release\n" ));return (AE_NOT_ACQUIRED ); }
@@ -800,10 +799,11 @@if (i == mutex_id) {continue ; } - -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR , +ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX ,"Invalid release order: owns [%s], releasing [%s]\n" , -acpi_ut_get_mutex_name (i),acpi_ut_get_mutex_name (mutex_id))); +acpi_ut_get_mutex_name (i),acpi_ut_get_mutex_name (mutex_id))); + +ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Invalid Mutex release order\n" ));return (AE_RELEASE_DEADLOCK ); }
@@ -816,8 +816,8 @@ status =acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex,1 );if (ACPI_FAILURE (status)) { -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Thread %X could not release Mutex [%s] %s\n" , - this_thread_id,acpi_ut_get_mutex_name (mutex_id), +ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"Thread %X could not release Mutex %s\n" , + this_thread_id,acpi_format_exception (status))); }else {
@@ -1477,6 +1477,7 @@acpi_os_printf ("%8s-%04d: *** Warning: " , module_name, line_number); } +EXPORT_SYMBOL (acpi_ut_report_warning);/******************************************************************************* *
drivers/acpi/Kconfig renamed from drivers/acpi/Kconfig.orig +10 -0
@@ -343,4 +343,14 @@ This is the ACPI generic container driver which supports ACPI0004, PNP0A05 and PNP0A06 devices +config ACPI_DEBUG_LITE + bool "Print ACPI errors and warnings" + depends on ACPI + default n + help + Full ACPI_DEBUG output slows down the system significantly, + even if not enabled during runtime. + This variable takes care that errors and warnings will still be printed, + but higher debug levels can not be enabled any more during runtime. + endmenu
include/acpi/acmacros.h renamed from include/acpi/acmacros.h.orig +11 -0
@@ -604,7 +604,18 @@#define ACPI_DUMP_PATHNAME (a,b,c,d)#define ACPI_DUMP_RESOURCE_LIST (a)#define ACPI_DUMP_BUFFER (a,b) + + +#ifdef ACPI_DEBUG_LITE +/* compiler must optimize, no solution to only integrate +this in preprocessing directives found */ +#define ACPI_DEBUG_PRINT_SUB(L, LINE, DB_INFO, A...) (L == ACPI_LV_ERROR || L == ACPI_LV_WARN) ? \ + (ACPI_REPORT_WARNING ((A))) : (0) +#define ACPI_DEBUG_PRINT (pl) ACPI_DEBUG_PRINT_SUB pl +#else #define ACPI_DEBUG_PRINT (pl) +#endif +#define ACPI_DEBUG_PRINT_RAW (pl)#define ACPI_BREAK_MSG (a)
include/acpi/acutils.h renamed from include/acpi/acutils.h.orig +2 -0
@@ -45,6 +45,8 @@#define _ACUTILS_H +#include <linux/module.h> +typedef acpi_status (*acpi_pkg_callback) ( u8 object_type,