From patchwork Fri Mar 15 06:35:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 10854113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E92F46C2 for ; Fri, 15 Mar 2019 06:38:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C25C22A860 for ; Fri, 15 Mar 2019 06:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B252A2A863; Fri, 15 Mar 2019 06:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50F462A860 for ; Fri, 15 Mar 2019 06:38:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4gRp-0007iF-J3; Fri, 15 Mar 2019 06:36:05 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h4gRo-0007iA-Ce for xen-devel@lists.xenproject.org; Fri, 15 Mar 2019 06:36:04 +0000 X-Inumbo-ID: 995c0952-46ec-11e9-bc90-bc764e045a96 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 995c0952-46ec-11e9-bc90-bc764e045a96; Fri, 15 Mar 2019 06:36:01 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 60899AC5C; Fri, 15 Mar 2019 06:36:00 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 15 Mar 2019 07:35:56 +0100 Message-Id: <20190315063557.24814-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190315063557.24814-1-jgross@suse.com> References: <20190315063557.24814-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 1/2] xen/debug: make debugtrace configurable via Kconfig X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of having to edit include/xen/lib.h for making debugtrace available make it configurable via Kconfig. Default is off, it is available only in expert mode or in debug builds. Signed-off-by: Juergen Gross Acked-by: Jan Beulich --- xen/Kconfig.debug | 7 +++++++ xen/drivers/char/console.c | 2 +- xen/include/xen/lib.h | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index 4d5d7f87cb..daacf85141 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -98,6 +98,13 @@ config UBSAN If unsure, say N here. +config DEBUG_TRACE + bool "Debug trace support" + ---help--- + Debug trace enables to record debug trace messages which are printed + either directly to the console or are printed to console in case of + a system crash. + endif # DEBUG || EXPERT endmenu diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 4315588f05..41ec13ce52 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -1157,7 +1157,7 @@ int printk_ratelimit(void) * ************************************************************** */ -#ifdef DEBUG_TRACE_DUMP +#ifdef CONFIG_DEBUG_TRACE /* Send output direct to console, or buffer it? */ static volatile int debugtrace_send_to_console; diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 89939f43c8..e0b7bcb6b7 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -86,8 +86,7 @@ int parse_boolean(const char *name, const char *s, const char *e); */ int cmdline_strcmp(const char *frag, const char *name); -/*#define DEBUG_TRACE_DUMP*/ -#ifdef DEBUG_TRACE_DUMP +#ifdef CONFIG_DEBUG_TRACE extern void debugtrace_dump(void); extern void debugtrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));