[Pixman] [PATCH 7/8] perfstat: Gather performance data from pixman_fill()
Taekyun Kim
podain77 at gmail.com
Mon Sep 19 07:08:25 PDT 2011
From: Taekyun Kim <tkq.kim at samsung.com>
---
pixman/pixman-arm-neon.c | 22 ++++++++++++++++++----
pixman/pixman-fast-path.c | 12 ++++++++++++
pixman/pixman-mmx.c | 12 ++++++++++++
pixman/pixman-sse2.c | 12 ++++++++++++
4 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c
index e5c6769..acfd9bc 100644
--- a/pixman/pixman-arm-neon.c
+++ b/pixman/pixman-arm-neon.c
@@ -452,11 +452,25 @@ arm_neon_fill (pixman_implementation_t *imp,
int height,
uint32_t xor)
{
- if (pixman_fill_neon (bits, stride, bpp, x, y, width, height, xor))
- return TRUE;
+ double t0 = 0.0, t1 = 0.0;
+
+ if (perfstat_is_enabled ())
+ t0 = perfstat_get_time ();
+
+ if (!pixman_fill_neon (bits, stride, bpp, x, y, width, height, xor))
+ {
+ return _pixman_implementation_fill (
+ imp->delegate, bits, stride, bpp, x, y, width, height, xor);
+ }
- return _pixman_implementation_fill (
- imp->delegate, bits, stride, bpp, x, y, width, height, xor);
+ if (perfstat_is_enabled ())
+ {
+ t1 = perfstat_get_time ();
+ perfstat_add_fill (PIXMAN_IMPLEMENTATION_ARM_NEON,
+ bpp, width, height, t1 - t0);
+ }
+
+ return TRUE;
}
#define BIND_COMBINE_U(name) \
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 14ad07c..0acd6cc 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1982,12 +1982,24 @@ fast_path_fill (pixman_implementation_t *imp,
int height,
uint32_t xor)
{
+ double t0 = 0.0, t1 = 0.0;
+
+ if (perfstat_is_enabled ())
+ t0 = perfstat_get_time ();
+
if (!pixman_fill_fast_path (bits, stride, bpp, x, y, width, height, xor))
{
return _pixman_implementation_fill (
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
}
+ if (perfstat_is_enabled ())
+ {
+ t1 = perfstat_get_time ();
+ perfstat_add_fill (PIXMAN_IMPLEMENTATION_C_FAST_PATH,
+ bpp, width, height, t1 - t0);
+ }
+
return TRUE;
}
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 47d8bdd..67c3289 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3120,12 +3120,24 @@ mmx_fill (pixman_implementation_t *imp,
int height,
uint32_t xor)
{
+ double t0 = 0.0, t1 = 0.0;
+
+ if (perfstat_is_enabled ())
+ t0 = perfstat_get_time ();
+
if (!pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor))
{
return _pixman_implementation_fill (
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
}
+ if (perfstat_is_enabled ())
+ {
+ t1 = perfstat_get_time ();
+ perfstat_add_fill (PIXMAN_IMPLEMENTATION_MMX,
+ bpp, width, height, t1 - t0);
+ }
+
return TRUE;
}
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 431ea6e..de633df 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5551,12 +5551,24 @@ sse2_fill (pixman_implementation_t *imp,
int height,
uint32_t xor)
{
+ double t0 = 0.0, t1 = 0.0;
+
+ if (perfstat_is_enabled ())
+ t0 = perfstat_get_time ();
+
if (!pixman_fill_sse2 (bits, stride, bpp, x, y, width, height, xor))
{
return _pixman_implementation_fill (
imp->delegate, bits, stride, bpp, x, y, width, height, xor);
}
+ if (perfstat_is_enabled ())
+ {
+ t1 = perfstat_get_time ();
+ perfstat_add_fill (PIXMAN_IMPLEMENTATION_SSE2,
+ bpp, width, height, t1 - t0);
+ }
+
return TRUE;
}
--
1.7.1
More information about the Pixman
mailing list