[v3] Add random memcpy test

Message ID 1490647988.19074.94.camel@caviumnetworks.com
State New, archived
Headers

Commit Message

Steve Ellcey March 27, 2017, 8:53 p.m. UTC
  On Mon, 2017-03-27 at 12:57 -0700, Steve Ellcey wrote:

> I see the bench-memcpy-random.c file now but I think there is still
> something wrong.  I am using a glibc that has my aarch64 IFUNC version
> of memcpy and memmove implemented in it but I do not get measurements
> of the different implementations for the random memcpy test like I do
> for the other two memcpy tests.

Here is a patch so that bench-memcpy-random.c prints out timings for
all the IFUNC versions of memcpy.  The TEST_NAME change is clear,
TEST_NAME isn't really the name of the test but the name of the routine
being tested.  If you call it memcpy-random it looks for IFUNC versions
of the memcpy-random function instead of the memcpy function.  I also
changed the IMPL call to have 1 instead of 0 as the second argument.  I
don't really understand this change, but it is what the other two
memcpy tests do so I copied them and it seems to work.  Tested on x86
and aarch64.

Steve Ellcey
sellcey@cavium.com


2017-03-27  Steve Ellcey  <sellcey@caviumnetworks.com>

	* benchtests/bench-memcpy-random.c (TEST_NAME): Change to memcpy.
	(IMPL) Call with 1 instead of 0 as argument.
  

Comments

Siddhesh Poyarekar March 28, 2017, 9:39 a.m. UTC | #1
On Tuesday 28 March 2017 02:23 AM, Steve Ellcey wrote:
> Here is a patch so that bench-memcpy-random.c prints out timings for
> all the IFUNC versions of memcpy.  The TEST_NAME change is clear,
> TEST_NAME isn't really the name of the test but the name of the routine
> being tested.  If you call it memcpy-random it looks for IFUNC versions
> of the memcpy-random function instead of the memcpy function.  I also
> changed the IMPL call to have 1 instead of 0 as the second argument.  I
> don't really understand this change, but it is what the other two
> memcpy tests do so I copied them and it seems to work.  Tested on x86
> and aarch64.
> 
> Steve Ellcey
> sellcey@cavium.com
> 
> 
> 2017-03-27  Steve Ellcey  <sellcey@caviumnetworks.com>
> 
> 	* benchtests/bench-memcpy-random.c (TEST_NAME): Change to memcpy.
> 	(IMPL) Call with 1 instead of 0 as argument.

The flag is to enable testing it.  This patch is OK.

Thanks,
Siddhesh
  

Patch

diff --git a/benchtests/bench-memcpy-random.c b/benchtests/bench-memcpy-random.c
index 4cd6209..9ae925e 100644
--- a/benchtests/bench-memcpy-random.c
+++ b/benchtests/bench-memcpy-random.c
@@ -18,11 +18,11 @@ 
 
 #define MIN_PAGE_SIZE 131072
 #define TEST_MAIN
-#define TEST_NAME "memcpy-random"
+#define TEST_NAME "memcpy"
 #include "bench-string.h"
 #include <assert.h>
 
-IMPL (memcpy, 0)
+IMPL (memcpy, 1)
 
 #define NUM_COPIES 4096