core/test/run-trace: Reduce number of samples when running under valgrind
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).
#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)
{
