From patchwork Thu Aug 1 10:13:30 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: 11070431 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 6CA56112C for ; Thu, 1 Aug 2019 10:15:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD1F26E3E for ; Thu, 1 Aug 2019 10:15:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA1028528; Thu, 1 Aug 2019 10:15:29 +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 E5DCB26E3E for ; Thu, 1 Aug 2019 10:15:28 +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 1ht85c-00014N-M1; Thu, 01 Aug 2019 10:13:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ht85b-00013s-D6 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2019 10:13:39 +0000 X-Inumbo-ID: 06ac6d27-b445-11e9-8980-bc764e045a96 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 06ac6d27-b445-11e9-8980-bc764e045a96; Thu, 01 Aug 2019 10:13:37 +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 9185AB602; Thu, 1 Aug 2019 10:13:36 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Thu, 1 Aug 2019 12:13:30 +0200 Message-Id: <20190801101333.9821-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190801101333.9821-1-jgross@suse.com> References: <20190801101333.9821-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 1/4] xen: use common output function in debugtrace 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 Today dumping the debugtrace buffers is done via sercon_puts(), while direct printing of trace entries (after toggling output to the console) is using serial_puts(). Use sercon_puts() in both cases, as the difference between both is not really making sense. In order to prepare moving debugtrace functionality to an own source file rename sercon_puts() to console_serial_puts() and make it globally visible. Signed-off-by: Juergen Gross --- xen/drivers/char/console.c | 16 ++++++++-------- xen/include/xen/console.h | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index d728e737d1..49fbbed21a 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -346,7 +346,7 @@ void console_giveback(int id) serial_steal_fn = NULL; } -static void sercon_puts(const char *s) +void console_serial_puts(const char *s) { if ( serial_steal_fn != NULL ) (*serial_steal_fn)(s); @@ -389,7 +389,7 @@ static void dump_console_ring_key(unsigned char key) } buf[sofar] = '\0'; - sercon_puts(buf); + console_serial_puts(buf); video_puts(buf); free_xenheap_pages(buf, order); @@ -548,7 +548,7 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, int count) /* Use direct console output as it could be interactive */ spin_lock_irq(&console_lock); - sercon_puts(kbuf); + console_serial_puts(kbuf); video_puts(kbuf); #ifdef CONFIG_X86 @@ -669,7 +669,7 @@ static void __putstr(const char *str) { ASSERT(spin_is_locked(&console_lock)); - sercon_puts(str); + console_serial_puts(str); video_puts(str); #ifdef CONFIG_X86 @@ -1182,11 +1182,11 @@ static void debugtrace_dump_worker(void) /* Print oldest portion of the ring. */ ASSERT(debugtrace_buf[debugtrace_bytes - 1] == 0); - sercon_puts(&debugtrace_buf[debugtrace_prd]); + console_serial_puts(&debugtrace_buf[debugtrace_prd]); /* Print youngest portion of the ring. */ debugtrace_buf[debugtrace_prd] = '\0'; - sercon_puts(&debugtrace_buf[0]); + console_serial_puts(&debugtrace_buf[0]); memset(debugtrace_buf, '\0', debugtrace_bytes); @@ -1267,8 +1267,8 @@ void debugtrace_printk(const char *fmt, ...) if ( debugtrace_send_to_console ) { snprintf(cntbuf, sizeof(cntbuf), "%u ", ++count); - serial_puts(sercon_handle, cntbuf); - serial_puts(sercon_handle, buf); + console_serial_puts(cntbuf); + console_serial_puts(buf); } else { diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h index b4f9463936..041522692f 100644 --- a/xen/include/xen/console.h +++ b/xen/include/xen/console.h @@ -46,6 +46,9 @@ void console_giveback(int id); int console_suspend(void); int console_resume(void); +/* Emit a string via the serial console. */ +void console_serial_puts(const char *s); + extern int8_t opt_console_xen; #endif /* __CONSOLE_H__ */