Blame 0169-hw-qxl-tracing-fixes.patch

5544c1
From e4a803d8ebd69719f4d997052e5bc3a5a7d91124 Mon Sep 17 00:00:00 2001
Hans de Goede 93b7e3
From: Alon Levy <alevy@redhat.com>
Hans de Goede 93b7e3
Date: Wed, 12 Sep 2012 16:13:26 +0300
5544c1
Subject: [PATCH] hw/qxl: tracing fixes
Hans de Goede 93b7e3
Hans de Goede 93b7e3
Add two new trace events:
Hans de Goede 93b7e3
qxl_send_events(int qid, uint32_t events) "%d %d"
Hans de Goede 93b7e3
qxl_set_guest_bug(int qid) "%d"
Hans de Goede 93b7e3
Hans de Goede 93b7e3
Change qxl_io_unexpected_vga_mode parameters to be equivalent to those
Hans de Goede 93b7e3
of qxl_io_write for easier grouping under a single systemtap probe.
Hans de Goede 93b7e3
Hans de Goede 93b7e3
Change d to qxl in one place.
Hans de Goede 93b7e3
Hans de Goede 93b7e3
Signed-off-by: Alon Levy <alevy@redhat.com>
Hans de Goede 93b7e3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5544c1
(cherry picked from commit 917ae08ca1565aab2d10c8b6269cd905d6c5c05b)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Hans de Goede 93b7e3
---
Hans de Goede 93b7e3
 hw/qxl.c     | 8 +++++---
Hans de Goede 93b7e3
 trace-events | 6 ++++--
Hans de Goede 93b7e3
 2 files changed, 9 insertions(+), 5 deletions(-)
Hans de Goede 93b7e3
Hans de Goede 93b7e3
diff --git a/hw/qxl.c b/hw/qxl.c
5544c1
index 67f7100..59bf822 100644
Hans de Goede 93b7e3
--- a/hw/qxl.c
Hans de Goede 93b7e3
+++ b/hw/qxl.c
Hans de Goede 93b7e3
@@ -141,6 +141,7 @@ static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
Hans de Goede 93b7e3
 
Hans de Goede 93b7e3
 void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
Hans de Goede 93b7e3
 {
Hans de Goede 93b7e3
+    trace_qxl_set_guest_bug(qxl->id);
Hans de Goede 93b7e3
     qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
Hans de Goede 93b7e3
     qxl->guest_bug = 1;
Hans de Goede 93b7e3
     if (qxl->guestdebug) {
5544c1
@@ -1381,7 +1382,7 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
Hans de Goede 93b7e3
             break;
Hans de Goede 93b7e3
         }
Hans de Goede 93b7e3
         trace_qxl_io_unexpected_vga_mode(d->id,
Hans de Goede 93b7e3
-            io_port, io_port_to_string(io_port));
Hans de Goede 93b7e3
+            addr, val, io_port_to_string(io_port));
Hans de Goede 93b7e3
         /* be nice to buggy guest drivers */
Hans de Goede 93b7e3
         if (io_port >= QXL_IO_UPDATE_AREA_ASYNC &&
Hans de Goede 93b7e3
             io_port < QXL_IO_RANGE_SIZE) {
5544c1
@@ -1580,9 +1581,9 @@ cancel_async:
Hans de Goede 93b7e3
 static uint64_t ioport_read(void *opaque, target_phys_addr_t addr,
Hans de Goede 93b7e3
                             unsigned size)
Hans de Goede 93b7e3
 {
Hans de Goede 93b7e3
-    PCIQXLDevice *d = opaque;
Hans de Goede 93b7e3
+    PCIQXLDevice *qxl = opaque;
Hans de Goede 93b7e3
 
Hans de Goede 93b7e3
-    trace_qxl_io_read_unexpected(d->id);
Hans de Goede 93b7e3
+    trace_qxl_io_read_unexpected(qxl->id);
Hans de Goede 93b7e3
     return 0xff;
Hans de Goede 93b7e3
 }
Hans de Goede 93b7e3
 
5544c1
@@ -1612,6 +1613,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
Hans de Goede 93b7e3
     uint32_t old_pending;
Hans de Goede 93b7e3
     uint32_t le_events = cpu_to_le32(events);
Hans de Goede 93b7e3
 
Hans de Goede 93b7e3
+    trace_qxl_send_events(d->id, events);
Hans de Goede 93b7e3
     assert(qemu_spice_display_is_running(&d->ssd));
Hans de Goede 93b7e3
     old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);
Hans de Goede 93b7e3
     if ((old_pending & le_events) == le_events) {
Hans de Goede 93b7e3
diff --git a/trace-events b/trace-events
5544c1
index cf05414..aa79836 100644
Hans de Goede 93b7e3
--- a/trace-events
Hans de Goede 93b7e3
+++ b/trace-events
5544c1
@@ -931,7 +931,7 @@ qxl_interface_update_area_complete_overflow(int qid, int max) "%d max=%d"
Hans de Goede 93b7e3
 qxl_interface_update_area_complete_schedule_bh(int qid, uint32_t num_dirty) "%d #dirty=%d"
Hans de Goede 93b7e3
 qxl_io_destroy_primary_ignored(int qid, const char *mode) "%d %s"
Hans de Goede 93b7e3
 qxl_io_read_unexpected(int qid) "%d"
Hans de Goede 93b7e3
-qxl_io_unexpected_vga_mode(int qid, uint32_t io_port, const char *desc) "%d 0x%x (%s)"
Hans de Goede 93b7e3
+qxl_io_unexpected_vga_mode(int qid, uint64_t addr, uint64_t val, const char *desc) "%d 0x%"PRIx64"=%"PRIu64" (%s)"
Hans de Goede 93b7e3
 qxl_io_write(int qid, const char *mode, uint64_t addr, uint64_t val, unsigned size, int async) "%d %s addr=%"PRIu64 " val=%"PRIu64" size=%u async=%d"
Hans de Goede 93b7e3
 qxl_memslot_add_guest(int qid, uint32_t slot_id, uint64_t guest_start, uint64_t guest_end) "%d %u: guest phys 0x%"PRIx64 " - 0x%" PRIx64
Hans de Goede 93b7e3
 qxl_post_load(int qid, const char *mode) "%d %s"
5544c1
@@ -962,7 +962,7 @@ qxl_spice_destroy_surfaces(int qid, int async) "%d async=%d"
Hans de Goede 93b7e3
 qxl_spice_destroy_surface_wait_complete(int qid, uint32_t id) "%d sid=%d"
Hans de Goede 93b7e3
 qxl_spice_destroy_surface_wait(int qid, uint32_t id, int async) "%d sid=%d async=%d"
Hans de Goede 93b7e3
 qxl_spice_flush_surfaces_async(int qid, uint32_t surface_count, uint32_t num_free_res) "%d s#=%d, res#=%d"
Hans de Goede 93b7e3
-qxl_spice_monitors_config(int id) "%d"
Hans de Goede 93b7e3
+qxl_spice_monitors_config(int qid) "%d"
Hans de Goede 93b7e3
 qxl_spice_loadvm_commands(int qid, void *ext, uint32_t count) "%d ext=%p count=%d"
Hans de Goede 93b7e3
 qxl_spice_oom(int qid) "%d"
Hans de Goede 93b7e3
 qxl_spice_reset_cursor(int qid) "%d"
5544c1
@@ -971,6 +971,8 @@ qxl_spice_reset_memslots(int qid) "%d"
Hans de Goede 93b7e3
 qxl_spice_update_area(int qid, uint32_t surface_id, uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) "%d sid=%d [%d,%d,%d,%d]"
Hans de Goede 93b7e3
 qxl_spice_update_area_rest(int qid, uint32_t num_dirty_rects, uint32_t clear_dirty_region) "%d #d=%d clear=%d"
Hans de Goede 93b7e3
 qxl_surfaces_dirty(int qid, int surface, int offset, int size) "%d surface=%d offset=%d size=%d"
Hans de Goede 93b7e3
+qxl_send_events(int qid, uint32_t events) "%d %d"
Hans de Goede 93b7e3
+qxl_set_guest_bug(int qid) "%d"
Hans de Goede 93b7e3
 
Hans de Goede 93b7e3
 # hw/qxl-render.c
Hans de Goede 93b7e3
 qxl_render_blit_guest_primary_initialized(void) ""
Hans de Goede 93b7e3
-- 
5544c1
1.7.12.1
Hans de Goede 93b7e3