[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v1 6/7] acpi: Remove dependency on __LINE__ for release builds
When using xsplice, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds, remove the use of these line numbers in the ACPI code and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx> --- xen/drivers/acpi/utilities/utmisc.c | 46 +++++++++++++++++++++++++++++++++++++ xen/include/acpi/acmacros.h | 4 ++++ xen/include/acpi/acutils.h | 19 +++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/xen/drivers/acpi/utilities/utmisc.c b/xen/drivers/acpi/utilities/utmisc.c index b3e3012..8ace116 100644 --- a/xen/drivers/acpi/utilities/utmisc.c +++ b/xen/drivers/acpi/utilities/utmisc.c @@ -134,6 +134,51 @@ const char *__init acpi_ut_validate_exception(acpi_status status) * ******************************************************************************/ +#ifdef NDEBUG +void ACPI_INTERNAL_VAR_XFACE __init +acpi_ut_error(const char *module_name, void *addr, char *format, ...) +{ + va_list args; + + acpi_os_printf("ACPI Error (%s-%p): ", module_name, addr); + + va_start(args, format); + acpi_os_vprintf(format, args); + acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); + va_end(args); +} + +void ACPI_INTERNAL_VAR_XFACE __init +acpi_ut_warning(const char *module_name, void *addr, char *format, ...) +{ + va_list args; + + acpi_os_printf("ACPI Warning (%s-%p): ", module_name, addr); + + va_start(args, format); + acpi_os_vprintf(format, args); + acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); + va_end(args); + va_end(args); +} + +void ACPI_INTERNAL_VAR_XFACE __init +acpi_ut_info(const char *module_name, void *addr, char *format, ...) +{ + va_list args; + + /* + * Removed module_name, line_number, and acpica version, not needed + * for info output + */ + acpi_os_printf("ACPI: "); + + va_start(args, format); + acpi_os_vprintf(format, args); + acpi_os_printf("\n"); + va_end(args); +} +#else void ACPI_INTERNAL_VAR_XFACE __init acpi_ut_error(const char *module_name, u32 line_number, char *format, ...) { @@ -177,3 +222,4 @@ acpi_ut_info(const char *module_name, u32 line_number, char *format, ...) acpi_os_printf("\n"); va_end(args); } +#endif diff --git a/xen/include/acpi/acmacros.h b/xen/include/acpi/acmacros.h index 6765535..d8a2a14 100644 --- a/xen/include/acpi/acmacros.h +++ b/xen/include/acpi/acmacros.h @@ -422,7 +422,11 @@ * Ascii error messages can be configured out */ #ifndef ACPI_NO_ERROR_MESSAGES +#ifdef NDEBUG +#define AE_INFO _acpi_module_name, current_text_addr() +#else #define AE_INFO _acpi_module_name, __LINE__ +#endif /* * Error reporting. Callers module and line number are inserted by AE_INFO, diff --git a/xen/include/acpi/acutils.h b/xen/include/acpi/acutils.h index b1b0df7..708256d 100644 --- a/xen/include/acpi/acutils.h +++ b/xen/include/acpi/acutils.h @@ -174,6 +174,24 @@ acpi_ut_debug_print_raw(u32 requested_debug_level, u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6); +#ifdef NDEBUG +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_error(const char *module_name, + void *addr, char *format, ...) ACPI_PRINTF_LIKE(3); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_exception(const char *module_name, + void *addr, + acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_warning(const char *module_name, + void *addr, char *format, ...) ACPI_PRINTF_LIKE(3); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_info(const char *module_name, + void *addr, char *format, ...) ACPI_PRINTF_LIKE(3); +#else void ACPI_INTERNAL_VAR_XFACE acpi_ut_error(const char *module_name, u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); @@ -190,6 +208,7 @@ acpi_ut_warning(const char *module_name, void ACPI_INTERNAL_VAR_XFACE acpi_ut_info(const char *module_name, u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); +#endif /* * utmisc -- 2.4.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |