diff mbox

core/test/run-trace: Reduce number of samples when running under valgrind

Message ID 20170307052531.20826-1-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith March 7, 2017, 5:25 a.m. UTC
This reduces 'make check' run time by ~10 seconds on my laptop,
and just the run-trace test itself takes 15 seconds less (under valgrind).

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 core/test/run-trace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stewart Smith March 7, 2017, 6:45 a.m. UTC | #1
Stewart Smith <stewart@linux.vnet.ibm.com> writes:
> This reduces 'make check' run time by ~10 seconds on my laptop,
> and just the run-trace test itself takes 15 seconds less (under valgrind).
>
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Too tempting to not just immediately merge. Merged to master as of 65561f0e9362d6373afbc62de510720b76c238e0


> ---
>  core/test/run-trace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/core/test/run-trace.c b/core/test/run-trace.c
> index fa8a30b12a5a..980168868680 100644
> --- a/core/test/run-trace.c
> +++ b/core/test/run-trace.c
> @@ -26,6 +26,8 @@
>  #include <sys/types.h>
>  #include <sys/wait.h>
>
> +#include <valgrind/valgrind.h>
> +
>  /* Don't include these: PPC-specific */
>  #define __CPU_H
>  #define __TIME_H
> @@ -130,7 +132,7 @@ static struct cpu_thread *this_cpu(void)
>  }
>
>  #include <sys/mman.h>
> -#define PER_CHILD_TRACES (1024*1024)
> +#define PER_CHILD_TRACES ((RUNNING_ON_VALGRIND) ? (1024*16) : (1024*1024))
>
>  static void write_trace_entries(int id)
>  {
> -- 
> 2.9.3
>
diff mbox

Patch

diff --git a/core/test/run-trace.c b/core/test/run-trace.c
index fa8a30b12a5a..980168868680 100644
--- a/core/test/run-trace.c
+++ b/core/test/run-trace.c
@@ -26,6 +26,8 @@ 
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include <valgrind/valgrind.h>
+
 /* Don't include these: PPC-specific */
 #define __CPU_H
 #define __TIME_H
@@ -130,7 +132,7 @@  static struct cpu_thread *this_cpu(void)
 }
 
 #include <sys/mman.h>
-#define PER_CHILD_TRACES (1024*1024)
+#define PER_CHILD_TRACES ((RUNNING_ON_VALGRIND) ? (1024*16) : (1024*1024))
 
 static void write_trace_entries(int id)
 {