Received: from eggs.gnu.org ([2001:4830:134:3::10]:41731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfWYm-0005cK-VH for qemu-devel@nongnu.org; Sun, 10 Nov 2013 10:04:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfWYl-0003EH-Ua for qemu-devel@nongnu.org; Sun, 10 Nov 2013 10:04:20 -0500 From: Stefan Weil Date: Sun, 10 Nov 2013 16:04:16 +0100 Message-Id: <1384095856-15284-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] console: Replace conditional debug messages by trace methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: qemu-trivial@nongnu.org, Stefan Weil , Anthony Liguori Signed-off-by: Stefan Weil --- This patch needs my previous patch which added trace.h, see http://patchwork.ozlabs.org/patch/290045/. trace-events | 2 ++ ui/console.c | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/trace-events b/trace-events index 8695e9e..d196234 100644 --- a/trace-events +++ b/trace-events @@ -1010,6 +1010,8 @@ dma_map_wait(void *dbs) "dbs=%p" # ui/console.c console_gfx_new(void) "" +console_putchar_csi(int esc_param0, int esc_param1, int ch, int nb_esc_params) "escape sequence CSI%d;%d%c, %d parameters" +console_putchar_unhandled(int ch) "unhandled escape character '%c'" console_txt_new(int w, int h) "%dx%d" console_select(int nr) "%d" console_refresh(int interval) "interval %d ms" diff --git a/ui/console.c b/ui/console.c index 61ed219..586fc6d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -29,7 +29,6 @@ #include "sysemu/char.h" #include "trace.h" -//#define DEBUG_CONSOLE #define DEFAULT_BACKSCROLL 512 #define MAX_CONSOLES 12 #define CONSOLE_CURSOR_PERIOD 500 @@ -867,10 +866,8 @@ static void console_putchar(QemuConsole *s, int ch) s->nb_esc_params++; if (ch == ';') break; -#ifdef DEBUG_CONSOLE - fprintf(stderr, "escape sequence CSI%d;%d%c, %d parameters\n", - s->esc_params[0], s->esc_params[1], ch, s->nb_esc_params); -#endif + trace_console_putchar_csi(s->esc_params[0], s->esc_params[1], + ch, s->nb_esc_params); s->state = TTY_STATE_NORM; switch(ch) { case 'A': @@ -984,9 +981,7 @@ static void console_putchar(QemuConsole *s, int ch) s->y = s->y_saved; break; default: -#ifdef DEBUG_CONSOLE - fprintf(stderr, "unhandled escape character '%c'\n", ch); -#endif + trace_console_putchar_unhandled(ch); break; } break; -- 1.7.10.4