Split ACPI_DEBUG function trace into its own compile option. Function trace is most of the ACPI_DEBUG costs, but is not much of use for kernel ACPI debugging. Size of kernel image increased on test compile: + 48k (Full ACPI_DEBUG) + 35k (ACPI_DEBUG with function trace compiled out) Performance without function trace is also much better. Also remove ACPI_LV_DEBUG_OBJECT from default debug level as a lot vendors let Store (value, debug) in their code and this might confuse users when it pops up in syslog. If you make use of your own, overridden DSDT and store things to the debug object, you need to explicitly add the debug_object flag to the boot param acpi.debug_level= or enable it at runtime in the corresponding /sys/ file. Signed-off-by: Thomas Renninger --- drivers/acpi/Kconfig | 13 ++++++++++++- include/acpi/acmacros.h | 23 +++++++++++++++++++++++ include/acpi/acoutput.h | 4 ++-- 3 files changed, 37 insertions(+), 3 deletions(-) Index: linux-2.6.22-rc3/drivers/acpi/Kconfig =================================================================== --- linux-2.6.22-rc3.orig/drivers/acpi/Kconfig +++ linux-2.6.22-rc3/drivers/acpi/Kconfig @@ -278,7 +278,18 @@ config ACPI_DEBUG help The ACPI driver can optionally report errors with a great deal of verbosity. Saying Y enables these statements. This will increase - your kernel size by around 50K. + your kernel size by around 35K. + +config ACPI_DEBUG_FUNC_TRACE + bool "Additionally enable ACPI function tracing" + default n + depends on ACPI_DEBUG + help + This will increase your kernel size by another 15K. + ACPI function tracing log the invoked ACPICA subsystem functions + in syslog (still needs to be enabled via acpi.debug_level= mask). + This significantly slows down ACPI code processing, only enable it + if you know what you are doing. config ACPI_EC bool Index: linux-2.6.22-rc3/include/acpi/acmacros.h =================================================================== --- linux-2.6.22-rc3.orig/include/acpi/acmacros.h +++ linux-2.6.22-rc3/include/acpi/acmacros.h @@ -486,6 +486,8 @@ #define ACPI_FUNCTION_NAME(name) #endif +#ifdef DEBUG_FUNC_TRACE + #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ acpi_ut_trace(ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ @@ -563,6 +565,27 @@ #endif /* ACPI_SIMPLE_RETURN_MACROS */ +#else /* !DEBUG_FUNC_TRACE */ + +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_TRACE_PTR(a,b) +#define ACPI_FUNCTION_TRACE_U32(a,b) +#define ACPI_FUNCTION_TRACE_STR(a,b) +#define ACPI_FUNCTION_EXIT +#define ACPI_FUNCTION_STATUS_EXIT(s) +#define ACPI_FUNCTION_VALUE_EXIT(s) +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_ENTRY() + +#define return_VOID return +#define return_ACPI_STATUS(s) return(s) +#define return_VALUE(s) return(s) +#define return_UINT8(s) return(s) +#define return_UINT32(s) return(s) +#define return_PTR(s) return(s) + +#endif /* DEBUG_FUNC_TRACE */ + /* Conditional execution */ #define ACPI_DEBUG_EXEC(a) a Index: linux-2.6.22-rc3/include/acpi/acoutput.h =================================================================== --- linux-2.6.22-rc3.orig/include/acpi/acoutput.h +++ linux-2.6.22-rc3/include/acpi/acoutput.h @@ -178,8 +178,8 @@ /* Defaults for debug_level, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) #endif /* __ACOUTPUT_H__ */