From patchwork Wed Apr 3 09:25:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Damian, Alexandru" X-Patchwork-Id: 233339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CC3A02C00A3 for ; Wed, 3 Apr 2013 21:10:35 +1100 (EST) Received: from localhost ([::1]:46156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKeH-0001SX-Vm for incoming@patchwork.ozlabs.org; Wed, 03 Apr 2013 06:10:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKdt-0001Qk-MD for qemu-devel@nongnu.org; Wed, 03 Apr 2013 06:10:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNKdl-0004QT-1F for qemu-devel@nongnu.org; Wed, 03 Apr 2013 06:10:09 -0400 Received: from mga03.intel.com ([143.182.124.21]:45265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKRx-0000Ad-GT for qemu-devel@nongnu.org; Wed, 03 Apr 2013 05:57:49 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 03 Apr 2013 02:25:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,399,1363158000"; d="scan'208";a="222261539" Received: from adamian-desktop.rb.intel.com ([10.237.105.55]) by AZSMGA002.ch.intel.com with ESMTP; 03 Apr 2013 02:25:09 -0700 Received: by adamian-desktop.rb.intel.com (Postfix, from userid 1000) id 84496560C05; Wed, 3 Apr 2013 12:25:10 +0300 (EEST) From: Alex DAMIAN To: kraxel@redhat.com, blauwirbel@gmail.com, pbonzini@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org Date: Wed, 3 Apr 2013 12:25:03 +0300 Message-Id: <1364981103-17220-1-git-send-email-alexandru.damian@intel.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 143.182.124.21 Cc: Alexandru DAMIAN Subject: [Qemu-devel] [PATCH] vga.c: move debug printfs to trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Alexandru DAMIAN Move all register read/write log events from DEBUG ifdefs to the tracing infrastructure. Signed-off-by: Alexandru DAMIAN --- hw/vga.c | 45 +++++++++++---------------------------------- trace-events | 4 ++++ 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 59bfb22..f9292ed 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -32,11 +32,7 @@ #include "hw/xen.h" #include "trace.h" -//#define DEBUG_VGA //#define DEBUG_VGA_MEM -//#define DEBUG_VGA_REG - -//#define DEBUG_BOCHS_VBE /* 16 state changes per vertical frame @60 Hz */ #define VGA_TEXT_CURSOR_PERIOD_MS (1000 * 2 * 16 / 60) @@ -390,9 +386,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr) break; case VGA_SEQ_D: val = s->sr[s->sr_index]; -#ifdef DEBUG_VGA_REG - printf("vga: read SR%x = 0x%02x\n", s->sr_index, val); -#endif + trace_vga_register_read("SR", s->sr_index, val); break; case VGA_PEL_IR: val = s->dac_state; @@ -418,9 +412,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr) break; case VGA_GFX_D: val = s->gr[s->gr_index]; -#ifdef DEBUG_VGA_REG - printf("vga: read GR%x = 0x%02x\n", s->gr_index, val); -#endif + trace_vga_register_read("GR", s->gr_index, val); break; case VGA_CRT_IM: case VGA_CRT_IC: @@ -429,9 +421,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr) case VGA_CRT_DM: case VGA_CRT_DC: val = s->cr[s->cr_index]; -#ifdef DEBUG_VGA_REG - printf("vga: read CR%x = 0x%02x\n", s->cr_index, val); -#endif + trace_vga_register_read("CR", s->cr_index, val); break; case VGA_IS1_RM: case VGA_IS1_RC: @@ -444,9 +434,7 @@ uint32_t vga_ioport_read(void *opaque, uint32_t addr) break; } } -#if defined(DEBUG_VGA) - printf("VGA: read addr=0x%04x data=0x%02x\n", addr, val); -#endif + trace_vga_register_read("port", addr, val); return val; } @@ -461,9 +449,8 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) if (vga_ioport_invalid(s, addr)) { return; } -#ifdef DEBUG_VGA - printf("VGA: write addr=0x%04x data=0x%02x\n", addr, val); -#endif + + trace_vga_register_write("port", addr, val); switch(addr) { case VGA_ATT_W: @@ -505,9 +492,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) s->sr_index = val & 7; break; case VGA_SEQ_D: -#ifdef DEBUG_VGA_REG - printf("vga: write SR%x = 0x%02x\n", s->sr_index, val); -#endif + trace_vga_register_write("SR", s->sr_index, val); s->sr[s->sr_index] = val & sr_mask[s->sr_index]; if (s->sr_index == VGA_SEQ_CLOCK_MODE) { s->update_retrace_info(s); @@ -536,9 +521,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) s->gr_index = val & 0x0f; break; case VGA_GFX_D: -#ifdef DEBUG_VGA_REG - printf("vga: write GR%x = 0x%02x\n", s->gr_index, val); -#endif + trace_vga_register_write("GR", s->gr_index, val); s->gr[s->gr_index] = val & gr_mask[s->gr_index]; vga_update_memory_access(s); break; @@ -548,9 +531,7 @@ void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) break; case VGA_CRT_DM: case VGA_CRT_DC: -#ifdef DEBUG_VGA_REG - printf("vga: write CR%x = 0x%02x\n", s->cr_index, val); -#endif + trace_vga_register_write("CR", s->cr_index, val); /* handle CR0-7 protection */ if ((s->cr[VGA_CRTC_V_SYNC_END] & VGA_CR11_LOCK_CR0_CR7) && s->cr_index <= VGA_CRTC_OVERFLOW) { @@ -620,9 +601,7 @@ uint32_t vbe_ioport_read_data(void *opaque, uint32_t addr) } else { val = 0; } -#ifdef DEBUG_BOCHS_VBE - printf("VBE: read index=0x%x val=0x%x\n", s->vbe_index, val); -#endif + trace_vga_register_read("VBE", s->vbe_index, val); return val; } @@ -637,9 +616,7 @@ void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val) VGACommonState *s = opaque; if (s->vbe_index <= VBE_DISPI_INDEX_NB) { -#ifdef DEBUG_BOCHS_VBE - printf("VBE: write index=0x%x val=0x%x\n", s->vbe_index, val); -#endif + trace_vga_register_write("VBE", s->vbe_index, val); switch(s->vbe_index) { case VBE_DISPI_INDEX_ID: if (val == VBE_DISPI_ID0 || diff --git a/trace-events b/trace-events index 7f34112..8a9e199 100644 --- a/trace-events +++ b/trace-events @@ -1101,3 +1101,7 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev # migration.c migrate_set_state(int new_state) "new state %d" + +# hw/vga.c +vga_register_read(const char *name, int index, int value) "VGA: read %s %x = 0x%02x" +vga_register_write(const char *name, int index, int value) "VGA: write %s %x = 0x%02x"