[Pixman] [PATCH 8/8] perfstat: Gather performance data from pixman_blt()

Taekyun Kim podain77 at gmail.com
Mon Sep 19 07:08:26 PDT 2011


From: Taekyun Kim <tkq.kim at samsung.com>

---
 pixman/pixman-arm-neon.c |   12 ++++++++++++
 pixman/pixman-mmx.c      |   12 ++++++++++++
 pixman/pixman-sse2.c     |   12 ++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c
index acfd9bc..5b438e9 100644
--- a/pixman/pixman-arm-neon.c
+++ b/pixman/pixman-arm-neon.c
@@ -427,6 +427,11 @@ arm_neon_blt (pixman_implementation_t *imp,
               int                      width,
               int                      height)
 {
+    double t0 = 0.0, t1 = 0.0;
+
+    if (perfstat_is_enabled ())
+	t0 = perfstat_get_time ();
+
     if (!pixman_blt_neon (
             src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
             src_x, src_y, dest_x, dest_y, width, height))
@@ -438,6 +443,13 @@ arm_neon_blt (pixman_implementation_t *imp,
 	    src_x, src_y, dest_x, dest_y, width, height);
     }
 
+    if (perfstat_is_enabled ())
+    {
+	t1 = perfstat_get_time ();
+	perfstat_add_blt (PIXMAN_IMPLEMENTATION_ARM_NEON,
+			  src_bpp, dst_bpp, width, height, t1 - t0);
+    }
+
     return TRUE;
 }
 
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 67c3289..19415ad 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3095,6 +3095,11 @@ mmx_blt (pixman_implementation_t *imp,
          int                      width,
          int                      height)
 {
+    double t0 = 0.0, t1 = 0.0;
+
+    if (perfstat_is_enabled ())
+	t0 = perfstat_get_time ();
+
     if (!pixman_blt_mmx (
             src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
             src_x, src_y, dest_x, dest_y, width, height))
@@ -3106,6 +3111,13 @@ mmx_blt (pixman_implementation_t *imp,
 	    src_x, src_y, dest_x, dest_y, width, height);
     }
 
+    if (perfstat_is_enabled ())
+    {
+	t1 = perfstat_get_time ();
+	perfstat_add_blt (PIXMAN_IMPLEMENTATION_MMX,
+			  src_bpp, dst_bpp, width, height, t1 - t0);
+    }
+
     return TRUE;
 }
 
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index de633df..a34beeb 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5523,6 +5523,11 @@ sse2_blt (pixman_implementation_t *imp,
           int                      width,
           int                      height)
 {
+    double t0 = 0.0, t1 = 0.0;
+
+    if (perfstat_is_enabled ())
+	t0 = perfstat_get_time ();
+
     if (!pixman_blt_sse2 (
             src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
             src_x, src_y, dest_x, dest_y, width, height))
@@ -5534,6 +5539,13 @@ sse2_blt (pixman_implementation_t *imp,
 	    src_x, src_y, dest_x, dest_y, width, height);
     }
 
+    if (perfstat_is_enabled ())
+    {
+	t1 = perfstat_get_time ();
+	perfstat_add_blt (PIXMAN_IMPLEMENTATION_SSE2,
+			  src_bpp, dst_bpp, width, height, t1 - t0);
+    }
+
     return TRUE;
 }
 
-- 
1.7.1



More information about the Pixman mailing list