From patchwork Fri May 6 15:48:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9034231 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2003BBF29F for ; Fri, 6 May 2016 15:55:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3752D20394 for ; Fri, 6 May 2016 15:55:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1EE7520392 for ; Fri, 6 May 2016 15:55:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayi4S-0002eA-VS; Fri, 06 May 2016 15:53:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayi4S-0002dy-5N for xen-devel@lists.xen.org; Fri, 06 May 2016 15:53:40 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id D1/37-03814-30EBC275; Fri, 06 May 2016 15:53:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeJIrShJLcpLzFFi42JxWrohUpd5n06 4QYe8xZKPi1kcGD2O7v7NFMAYxZqZl5RfkcCacfDOavaCP3IV2191MTYwnpLqYuTkkBDwl7i/ /h8riM0mYCBx69J3ZhBbREBWYnXXHHYQm1kgQGLyvElAcQ4OYQE/iWNTzUDCLAIqEsve/WMDs XkFPCUO79vNDDFSTuLc+i8sIDangJdE89/XYHEhoJolU7ZC2WoSb5efYYHoFZQ4OfMJC8QqCY mDL16ArZIQ4Jb4220/gZFvFpKqWUiqFjAyrWJUL04tKkst0rXQSyrKTM8oyU3MzNE1NDDWy00 tLk5MT81JTCrWS87P3cQIDCYGINjBeKHd+RCjJAeTkijv9wKdcCG+pPyUyozE4oz4otKc1OJD jDIcHEoSvFF7gHKCRanpqRVpmTnAsIZJS3DwKInwrgRJ8xYXJOYWZ6ZDpE4xKkqJQyQEQBIZp XlwbbBYusQoKyXMywh0iBBPQWpRbmYJqvwrRnEORiVh3hcgU3gy80rgpr8CWswEtPj9XE2QxS WJCCmpBkapKUuX3tGQ8vYL8dOR9j4q0WjjqfIn7Hj9ahcO1ZUPpu8KOr3mcrJQ3OUHbVuf7BV fHfXdN0Tt7dZS68vTdpkXzPCd//L7/VURSxf9PLRyd3u++KETF7Nubc+MLVD3TOhNqt01g//P DeOrT88YS1SnCFcVnIqzDG2M3s2reUlI2XNLpaHWsWAlluKMREMt5qLiRADBYn4uoAIAAA== X-Env-Sender: prvs=92798eb09=ross.lagerwall@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1462550011!35718337!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36447 invoked from network); 6 May 2016 15:53:38 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 6 May 2016 15:53:38 -0000 X-IronPort-AV: E=Sophos;i="5.24,587,1454976000"; d="scan'208";a="352117125" From: Ross Lagerwall To: Date: Fri, 6 May 2016 16:48:07 +0100 Message-ID: <1462549688-29263-7-git-send-email-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com> References: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ross Lagerwall , Jan Beulich Subject: [Xen-devel] [PATCH v1 6/7] acpi: Remove dependency on __LINE__ for release builds X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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