- Reduced level two bitmap size from 2**16 to 2**14 addresses. This 
  improves the performance of exp-drd (with default settings) for 
  some tests.
- Some consistency checks were commented out via #if 0 / #endif because 
  of performance reasons. Replaced #if 0 by
  #ifdef ENABLE_DRD_CONSISTENCY_CHECKS.
- Enabled -DENABLE_DRD_CONSISTENCY_CHECKS for the drd_bitmap_test 
  regression test.
- Updated performance measurements.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8219 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/Testing.txt b/exp-drd/Testing.txt
index 2bef561..33d8f27 100644
--- a/exp-drd/Testing.txt
+++ b/exp-drd/Testing.txt
@@ -5,8 +5,8 @@
    command:
      perl tests/vg_regtest exp-drd
 2. Test the slowdown for matinv for various matrix sizes via the script
-   exp-drd/scripts/run-matinv (must be about 23 for i == 1 and about
-   33 for i == 10 with n == 200).
+   exp-drd/scripts/run-matinv (must be about 24 for i == 1 and about
+   31 for i == 10 with n == 200).
 3. Test whether DRD works with standard KDE applications and whether it does
    not print any false positives:
      ./vg-in-place --tool=exp-drd kate
diff --git a/exp-drd/drd_bitmap.h b/exp-drd/drd_bitmap.h
index 4f510c8..709a5a7 100644
--- a/exp-drd/drd_bitmap.h
+++ b/exp-drd/drd_bitmap.h
@@ -41,7 +41,7 @@
 
 /* Macro definitions. */
 
-#define ADDR0_BITS 16
+#define ADDR0_BITS 14
 
 #define ADDR0_COUNT ((UWord)1 << ADDR0_BITS)
 
@@ -110,7 +110,7 @@
 static __inline__ void bm0_set_range(UWord* bm0,
                                      const Addr a1, const SizeT size)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(a1 < ADDR0_COUNT);
   tl_assert(size > 0);
   tl_assert(a1 + size <= ADDR0_COUNT);
@@ -130,7 +130,7 @@
 static __inline__ void bm0_clear_range(UWord* bm0,
                                        const Addr a1, const SizeT size)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(a1 < ADDR0_COUNT);
   tl_assert(size > 0);
   tl_assert(a1 + size <= ADDR0_COUNT);
@@ -150,7 +150,7 @@
 static __inline__ UWord bm0_is_any_set(const UWord* bm0,
                                        const Addr a1, const SizeT size)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(a1 < ADDR0_COUNT);
   tl_assert(size > 0);
   tl_assert(a1 + size <= ADDR0_COUNT);
@@ -240,7 +240,7 @@
 Bool bm_cache_lookup(struct bitmap* const bm, const UWord a1,
                      struct bitmap2** bm2)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(bm);
   tl_assert(bm2);
 #endif
diff --git a/exp-drd/drd_main.c b/exp-drd/drd_main.c
index 618e193..5b688ec 100644
--- a/exp-drd/drd_main.c
+++ b/exp-drd/drd_main.c
@@ -276,7 +276,7 @@
 
 static VG_REGPARM(2) void drd_trace_load(Addr addr, SizeT size)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   /* The assert below has been commented out because of performance reasons.*/
   tl_assert(thread_get_running_tid()
             == VgThreadIdToDrdThreadId(VG_(get_running_tid())));
@@ -338,7 +338,7 @@
 static
 VG_REGPARM(2) void drd_trace_store(Addr addr, SizeT size)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   /* The assert below has been commented out because of performance reasons.*/
   tl_assert(thread_get_running_tid()
             == VgThreadIdToDrdThreadId(VG_(get_running_tid())));
diff --git a/exp-drd/drd_thread.h b/exp-drd/drd_thread.h
index e466376..6df7e5f 100644
--- a/exp-drd/drd_thread.h
+++ b/exp-drd/drd_thread.h
@@ -168,7 +168,7 @@
 static __inline__
 Bool running_thread_is_recording(void)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(0 <= (int)s_drd_running_tid && s_drd_running_tid < DRD_N_THREADS
             && s_drd_running_tid != DRD_INVALID_THREADID);
 #endif
@@ -179,11 +179,11 @@
 static __inline__
 void thread_set_stack_min(const DrdThreadId tid, const Addr stack_min)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(0 <= tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID);
 #endif
   s_threadinfo[tid].stack_min = stack_min;
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   /* This function can be called after the thread has been created but */
   /* before drd_post_thread_create() has filled in stack_max.          */
   tl_assert(s_threadinfo[tid].stack_min < s_threadinfo[tid].stack_max
@@ -209,7 +209,7 @@
 static __inline__
 Segment* thread_get_segment(const DrdThreadId tid)
 {
-#if 0
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
   tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
             && tid != DRD_INVALID_THREADID);
   tl_assert(s_threadinfo[tid].last);
diff --git a/exp-drd/scripts/run-splash2 b/exp-drd/scripts/run-splash2
index 97b22dc..9e2b609 100755
--- a/exp-drd/scripts/run-splash2
+++ b/exp-drd/scripts/run-splash2
@@ -62,17 +62,17 @@
 # Results (-p4):                native  DRD     DRD     HG    ITC     ITC
 #                               time         w/ filter             w/ filter
 # ............................................................................
-# Cholesky                        0.29  115     75      37    239      82
-# FFT                             0.19   80     45     556     90      41
-# LU, contiguous blocks           0.76   46     38      97    428     128
-# LU, non-contiguous blocks       0.80   48     42      59    428     128
-# Ocean, contiguous partitions   19.40   30     24      54     90      28
-# Ocean, non-continguous partns   0.29   26     28      53     90      28
-# Radiosity                       3.11  237     76      58    485     163
-# Radix                           4.05   16     15      85    222      56
-# Raytrace                        2.21  271     55      89    172      53
-# Water-n2                        0.17  174     34      52    189      39
-# Water-sp                        0.18  140     33      51    183      34
+# Cholesky                        0.29   99     63      37    239      82
+# FFT                             0.19   65     32     556     90      41
+# LU, contiguous blocks           0.76   45     37      97    428     128
+# LU, non-contiguous blocks       0.80   52     45      59    428     128
+# Ocean, contiguous partitions   19.40   39     33      54     90      28
+# Ocean, non-continguous partns   0.29   26     29      53     90      28
+# Radiosity                       3.11  224     61      58    485     163
+# Radix                           4.05   16     14      85    222      56
+# Raytrace                        2.21  276     53      89    172      53
+# Water-n2                        0.17  176     33      52    189      39
+# Water-sp                        0.18  145     33      51    183      34
 # ............................................................................
 # Hardware: dual-core Intel Xeon 5130, 2.0 GHz, 4 MB L2 cache, 4 GB RAM.
 # Software: Ubuntu 7.10 server, 64-bit, gcc 4.1.3.
diff --git a/exp-drd/tests/Makefile.am b/exp-drd/tests/Makefile.am
index f668b0a..f51a513 100644
--- a/exp-drd/tests/Makefile.am
+++ b/exp-drd/tests/Makefile.am
@@ -222,6 +222,7 @@
 
 drd_bitmap_test_SOURCES     = drd_bitmap_test.c
 drd_bitmap_test_CFLAGS      = $(AM_CFLAGS) -O2 \
+                              -DENABLE_DRD_CONSISTENCY_CHECKS\
                               @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
 
 fp_race_SOURCES             = fp_race.c