From 5cd4735b088936308cff9a54e0f15a0d7b3ceead Mon Sep 17 00:00:00 2001
Message-Id: <5cd4735b088936308cff9a54e0f15a0d7b3ceead.1349887753.git.minovotn@redhat.com>
In-Reply-To: <8366ff5a206b0f75edd17a4a78f7c389ebb81d49.1349887753.git.minovotn@redhat.com>
References: <8366ff5a206b0f75edd17a4a78f7c389ebb81d49.1349887753.git.minovotn@redhat.com>
From: Alon Levy <alevy@redhat.com>
Date: Sun, 7 Oct 2012 14:26:49 +0200
Subject: [PATCH 11/11] qxl/qxl_render.c: add trace events

RH-Author: Alon Levy <alevy@redhat.com>
Message-id: <1349620009-26192-8-git-send-email-alevy@redhat.com>
Patchwork-id: 42775
O-Subject: [PATCH RHEL-6.4 v2 7/7] qxl/qxl_render.c: add trace events
Bugzilla: 820136
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Uri Lublin <uril@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Upstream: d53291cf59139ec99425a75b3963f7f9b9a1eebf

Conflicts:
	hw/qxl-render.c
	trace-events

Changes from upstream:
 disable all added tracepoints
 include trace.h (not upstream, there console.h include provides it)

RHBZ: 820136
---
 hw/qxl-render.c | 15 ++++++---------
 trace-events    |  6 ++++++
 2 files changed, 12 insertions(+), 9 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/qxl-render.c | 15 ++++++---------
 trace-events    |  6 ++++++
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/hw/qxl-render.c b/hw/qxl-render.c
index 4b434f4..c0392d6 100644
--- a/hw/qxl-render.c
+++ b/hw/qxl-render.c
@@ -19,6 +19,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "trace.h"
+
 #include "qxl.h"
 
 static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)
@@ -31,11 +33,10 @@ static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)
         return;
     }
     if (!qxl->guest_primary.data) {
-        dprint(qxl, 1, "%s: initializing guest_primary.data\n", __func__);
+        trace_qxl_render_blit_guest_primary_initialized();
         qxl->guest_primary.data = qemu_get_ram_ptr(qxl->vga.vram_offset);
     }
-    dprint(qxl, 2, "%s: stride %d, [%d, %d, %d, %d]\n", __func__,
-            qxl->guest_primary.qxl_stride,
+    trace_qxl_render_blit(qxl->guest_primary.qxl_stride,
             rect->left, rect->right, rect->top, rect->bottom);
     src = qxl->guest_primary.data;
     if (qxl->guest_primary.qxl_stride < 0) {
@@ -107,8 +108,7 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
         qxl->guest_primary.data = qemu_get_ram_ptr(qxl->vga.vram_offset);
         qxl_set_rect_to_surface(qxl, &qxl->dirty[0]);
         qxl->num_dirty_rects = 1;
-        dprint(qxl, 1, "%s: %dx%d, stride %d, bpp %d, depth %d\n",
-               __FUNCTION__,
+        trace_qxl_render_guest_primary_resized(
                qxl->guest_primary.surface.width,
                qxl->guest_primary.surface.height,
                qxl->guest_primary.qxl_stride,
@@ -118,8 +118,6 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
     if (surface->width != qxl->guest_primary.surface.width ||
         surface->height != qxl->guest_primary.surface.height) {
         if (qxl->guest_primary.qxl_stride > 0) {
-            dprint(qxl, 1, "%s: using guest_primary for displaysurface\n",
-                   __func__);
             qemu_free_displaysurface(vga->ds);
             qemu_create_displaysurface_from(qxl->guest_primary.surface.width,
                                             qxl->guest_primary.surface.height,
@@ -127,8 +125,6 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
                                             qxl->guest_primary.abs_stride,
                                             qxl->guest_primary.data);
         } else {
-            dprint(qxl, 1, "%s: resizing displaysurface to guest_primary\n",
-                   __func__);
             qemu_resize_displaysurface(vga->ds,
                     qxl->guest_primary.surface.width,
                     qxl->guest_primary.surface.height);
@@ -188,6 +184,7 @@ void qxl_render_update_area_bh(void *opaque)
 void qxl_render_update_area_done(PCIQXLDevice *qxl, QXLCookie *cookie)
 {
     qemu_mutex_lock(&qxl->ssd.lock);
+    trace_qxl_render_update_area_done(cookie);
     qemu_bh_schedule(qxl->update_area_bh);
     qxl->render_update_cookie_num--;
     qemu_mutex_unlock(&qxl->ssd.lock);
diff --git a/trace-events b/trace-events
index 97f5883..39db8eb 100644
--- a/trace-events
+++ b/trace-events
@@ -262,3 +262,9 @@ disable qxl_spice_reset_memslots(int qid) "%d"
 disable 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]"
 disable qxl_spice_update_area_rest(int qid, uint32_t num_dirty_rects, uint32_t clear_dirty_region) "%d #d=%d clear=%d"
 disable qxl_surfaces_dirty(int qid, int surface, int addr, int offset, int size) "%d surface=%d addr=%d offset=%d size=%d"
+
+# hw/qxl-render.c
+disable qxl_render_blit_guest_primary_initialized(void) ""
+disable qxl_render_blit(int32_t stride, int32_t left, int32_t right, int32_t top, int32_t bottom) "stride=%d [%d, %d, %d, %d]"
+disable qxl_render_guest_primary_resized(int32_t width, int32_t height, int32_t stride, int32_t bytes_pp, int32_t bits_pp) "%dx%d, stride %d, bpp %d, depth %d"
+disable qxl_render_update_area_done(void *cookie) "%p"
-- 
1.7.11.4

