[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 35/35] hw/display/vmware_vga: replace fprintf calls with trace eve
From: |
Gerd Hoffmann |
Subject: |
[PULL 35/35] hw/display/vmware_vga: replace fprintf calls with trace events |
Date: |
Fri, 4 Mar 2022 15:21:23 +0100 |
From: Carwyn Ellis <carwynellis@gmail.com>
Debug output was always being sent to STDERR.
This has been replaced with trace events.
Signed-off-by: Carwyn Ellis <carwynellis@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220206183956.10694-2-carwynellis@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/vmware_vga.c | 30 ++++++++++++++++++------------
hw/display/trace-events | 3 +++
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index e2969a6c81c8..0cc43a1f15f6 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -297,46 +297,52 @@ static inline bool vmsvga_verify_rect(DisplaySurface
*surface,
int x, int y, int w, int h)
{
if (x < 0) {
- fprintf(stderr, "%s: x was < 0 (%d)\n", name, x);
+ trace_vmware_verify_rect_less_than_zero(name, "x", x);
return false;
}
if (x > SVGA_MAX_WIDTH) {
- fprintf(stderr, "%s: x was > %d (%d)\n", name, SVGA_MAX_WIDTH, x);
+ trace_vmware_verify_rect_greater_than_bound(name, "x", SVGA_MAX_WIDTH,
+ x);
return false;
}
if (w < 0) {
- fprintf(stderr, "%s: w was < 0 (%d)\n", name, w);
+ trace_vmware_verify_rect_less_than_zero(name, "w", w);
return false;
}
if (w > SVGA_MAX_WIDTH) {
- fprintf(stderr, "%s: w was > %d (%d)\n", name, SVGA_MAX_WIDTH, w);
+ trace_vmware_verify_rect_greater_than_bound(name, "w", SVGA_MAX_WIDTH,
+ w);
return false;
}
if (x + w > surface_width(surface)) {
- fprintf(stderr, "%s: width was > %d (x: %d, w: %d)\n",
- name, surface_width(surface), x, w);
+ trace_vmware_verify_rect_surface_bound_exceeded(name, "width",
+ surface_width(surface),
+ "x", x, "w", w);
return false;
}
if (y < 0) {
- fprintf(stderr, "%s: y was < 0 (%d)\n", name, y);
+ trace_vmware_verify_rect_less_than_zero(name, "y", y);
return false;
}
if (y > SVGA_MAX_HEIGHT) {
- fprintf(stderr, "%s: y was > %d (%d)\n", name, SVGA_MAX_HEIGHT, y);
+ trace_vmware_verify_rect_greater_than_bound(name, "y", SVGA_MAX_HEIGHT,
+ y);
return false;
}
if (h < 0) {
- fprintf(stderr, "%s: h was < 0 (%d)\n", name, h);
+ trace_vmware_verify_rect_less_than_zero(name, "h", h);
return false;
}
if (h > SVGA_MAX_HEIGHT) {
- fprintf(stderr, "%s: h was > %d (%d)\n", name, SVGA_MAX_HEIGHT, h);
+ trace_vmware_verify_rect_greater_than_bound(name, "y", SVGA_MAX_HEIGHT,
+ y);
return false;
}
if (y + h > surface_height(surface)) {
- fprintf(stderr, "%s: update height > %d (y: %d, h: %d)\n",
- name, surface_height(surface), y, h);
+ trace_vmware_verify_rect_surface_bound_exceeded(name, "height",
+
surface_height(surface),
+ "y", y, "h", h);
return false;
}
diff --git a/hw/display/trace-events b/hw/display/trace-events
index 4a687d1b8ea6..91efc88f04f5 100644
--- a/hw/display/trace-events
+++ b/hw/display/trace-events
@@ -21,6 +21,9 @@ vmware_palette_write(uint32_t index, uint32_t value) "index
%d, value 0x%x"
vmware_scratch_read(uint32_t index, uint32_t value) "index %d, value 0x%x"
vmware_scratch_write(uint32_t index, uint32_t value) "index %d, value 0x%x"
vmware_setmode(uint32_t w, uint32_t h, uint32_t bpp) "%dx%d @ %d bpp"
+vmware_verify_rect_less_than_zero(const char *name, const char *param, int x)
"%s: %s was < 0 (%d)"
+vmware_verify_rect_greater_than_bound(const char *name, const char *param, int
bound, int x) "%s: %s was > %d (%d)"
+vmware_verify_rect_surface_bound_exceeded(const char *name, const char
*component, int bound, const char *param1, int value1, const char *param2, int
value2) "%s: %s > %d (%s: %d, %s: %d)"
# virtio-gpu-base.c
virtio_gpu_features(bool virgl) "virgl %d"
--
2.35.1
- [PULL 23/35] hw/usb/redirect.c: Stop using qemu_oom_check(), (continued)
- [PULL 23/35] hw/usb/redirect.c: Stop using qemu_oom_check(), Gerd Hoffmann, 2022/03/04
- [PULL 24/35] coreaudio: Notify error in coreaudio_init_out, Gerd Hoffmann, 2022/03/04
- [PULL 29/35] ui/console: fix texture leak when calling surface_gl_create_texture(), Gerd Hoffmann, 2022/03/04
- [PULL 27/35] docs: Add spec of OVMF GUIDed table for SEV guests, Gerd Hoffmann, 2022/03/04
- [PULL 28/35] ui/console: fix crash when using gl context with non-gl listeners, Gerd Hoffmann, 2022/03/04
- [PULL 30/35] ui: do not create a surface when resizing a GL scanout, Gerd Hoffmann, 2022/03/04
- [PULL 31/35] ui/clipboard: fix use-after-free regression, Gerd Hoffmann, 2022/03/04
- [PULL 32/35] ui/cocoa: Add Services menu, Gerd Hoffmann, 2022/03/04
- [PULL 26/35] hw/i386: Replace magic number with field length calculation, Gerd Hoffmann, 2022/03/04
- [PULL 33/35] softmmu/qdev-monitor: Add virtio-gpu-gl aliases, Gerd Hoffmann, 2022/03/04
- [PULL 35/35] hw/display/vmware_vga: replace fprintf calls with trace events,
Gerd Hoffmann <=
- [PULL 34/35] edid: Fix clock of Detailed Timing Descriptor, Gerd Hoffmann, 2022/03/04
- Re: [PULL 00/35] Kraxel 20220304 patches, Peter Maydell, 2022/03/05