From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx1x2-0005Ms-U8 for qemu-devel@nongnu.org; Fri, 26 Aug 2011 15:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qx1x1-000728-Km for qemu-devel@nongnu.org; Fri, 26 Aug 2011 15:20:24 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:40403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx1x0-00071C-Nh for qemu-devel@nongnu.org; Fri, 26 Aug 2011 15:20:23 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 26 Aug 2011 21:20:11 +0200 Message-Id: <1314386412-7625-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1314386412-7625-1-git-send-email-hpoussin@reactos.org> References: <1314386412-7625-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/2] g364fb: use trace framework List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Signed-off-by: Herv=C3=A9 Poussineau --- hw/g364fb.c | 29 +++++++++++------------------ trace-events | 4 ++++ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/hw/g364fb.c b/hw/g364fb.c index b3020c5..fa074f4 100644 --- a/hw/g364fb.c +++ b/hw/g364fb.c @@ -21,17 +21,7 @@ #include "mips.h" #include "console.h" #include "pixel_ops.h" - -//#define DEBUG_G364 - -#ifdef DEBUG_G364 -#define DPRINTF(fmt, ...) \ -do { printf("g364: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while (0) -#endif -#define BADF(fmt, ...) \ -do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0) +#include "trace.h" =20 typedef struct G364State { /* hardware */ @@ -110,7 +100,8 @@ static void g364fb_draw_graphic8(G364State *s) w =3D 4; break; default: - BADF("unknown host depth %d\n", ds_get_bits_per_pixel(s->ds)= ); + hw_error("g364: unknown host depth %d", + ds_get_bits_per_pixel(s->ds)); return; } =20 @@ -262,7 +253,7 @@ static void g364fb_update_display(void *opaque) } else if (s->depth =3D=3D 8) { g364fb_draw_graphic8(s); } else { - BADF("unknown guest depth %d\n", s->depth); + error_report("g364: unknown guest depth %d", s->depth); } =20 qemu_irq_raise(s->irq); @@ -304,7 +295,7 @@ static void g364fb_screen_dump(void *opaque, const ch= ar *filename) FILE *f; =20 if (s->depth !=3D 8) { - BADF("unknown guest depth %d\n", s->depth); + error_report("g364: unknown guest depth %d", s->depth); return; } =20 @@ -367,14 +358,15 @@ static uint32_t g364fb_ctrl_readl(void *opaque, tar= get_phys_addr_t addr) break; default: { - BADF("invalid read at [" TARGET_FMT_plx "]\n", addr); + error_report("g364: invalid read at [" TARGET_FMT_plx "]= ", + addr); val =3D 0; break; } } } =20 - DPRINTF("read 0x%08x at [" TARGET_FMT_plx "]\n", val, addr); + trace_g364fb_read(addr, val); =20 return val; } @@ -419,7 +411,7 @@ static void g364fb_ctrl_writel(void *opaque, target_p= hys_addr_t addr, uint32_t v { G364State *s =3D opaque; =20 - DPRINTF("write 0x%08x at [" TARGET_FMT_plx "]\n", val, addr); + trace_g364fb_write(addr, val); =20 if (addr >=3D REG_CLR_PAL && addr < REG_CLR_PAL + 0x800) { /* color palette */ @@ -483,7 +475,8 @@ static void g364fb_ctrl_writel(void *opaque, target_p= hys_addr_t addr, uint32_t v g364fb_reset(s); break; default: - BADF("invalid write of 0x%08x at [" TARGET_FMT_plx "]\n"= , val, addr); + error_report("g364: invalid write of 0x%" PRIx64 + " at [" TARGET_FMT_plx "]", val, addr); break; } } diff --git a/trace-events b/trace-events index dc300a2..f08d6d0 100644 --- a/trace-events +++ b/trace-events @@ -284,6 +284,10 @@ disable qed_aio_write_prefill(void *s, void *acb, ui= nt64_t start, size_t len, ui disable qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_= t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRI= u64"" disable qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset,= size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu" =20 +# hw/g364fb.c +disable g364fb_read(uint64_t addr, uint32_t val) "read addr=3D0x%"PRIx64= ": 0x%x" +disable g364fb_write(uint64_t addr, uint32_t new) "write addr=3D0x%"PRIx= 64": 0x%x" + # hw/grlib_gptimer.c disable grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count= 0x%x and run" disable grlib_gptimer_disabled(int id, uint32_t config) "timer:%d Timer = disable config 0x%x" --=20 1.7.5.4