Complete integration of the new code management (sectored FIFO) story.

This commit adds stats gathering / printing (use -v -v), and selection
of sector size decided by asking skins, via
VG_(details).avg_translation_sizeB, the average size of their
translations.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1334 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index 06230dc..d9e7238 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -1222,6 +1222,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Julian Seward.");
    VG_(details_bug_reports_to)  ("jseward@acm.org");
+   VG_(details_avg_translation_sizeB) ( 106 );
 
    VG_(needs_core_errors)         ();
    VG_(needs_skin_errors)         ();
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 134dc4a..f6a12cb 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -1924,6 +1924,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
+   VG_(details_avg_translation_sizeB) ( 143 );
 
    VG_(needs_basic_block_discards)();
    VG_(needs_command_line_options)();
diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h
index 887b20b..5fa88b4 100644
--- a/coregrind/vg_include.h
+++ b/coregrind/vg_include.h
@@ -291,6 +291,7 @@
       Char* description;
       Char* copyright_author;
       Char* bug_reports_to;
+      Int   avg_translation_sizeB;
    }
    VgDetails;
 
@@ -1344,9 +1345,6 @@
 /* Is the client running on the simulated CPU or the real one? */
 extern Bool VG_(running_on_simd_CPU); /* Initially False */
 
-/* The current LRU epoch. */
-extern UInt VG_(current_epoch);
-
 /* This is the ThreadId of the last thread the scheduler ran. */
 extern ThreadId VG_(last_run_tid);
 
@@ -1361,16 +1359,8 @@
 /* Number of lookups which miss the fast tt helper. */
 extern UInt VG_(tt_fast_misses);
 
-/* Counts for LRU informational messages. */
+/* Counts for TT/TC informational messages. */
 
-/* Number and total o/t size of new translations this epoch. */
-extern UInt VG_(this_epoch_in_count);
-extern UInt VG_(this_epoch_in_osize);
-extern UInt VG_(this_epoch_in_tsize);
-/* Number and total o/t size of discarded translations this epoch. */
-extern UInt VG_(this_epoch_out_count);
-extern UInt VG_(this_epoch_out_osize);
-extern UInt VG_(this_epoch_out_tsize);
 /* Number and total o/t size of translations overall. */
 extern UInt VG_(overall_in_count);
 extern UInt VG_(overall_in_osize);
@@ -1380,8 +1370,8 @@
 extern UInt VG_(overall_out_osize);
 extern UInt VG_(overall_out_tsize);
 
-/* The number of LRU-clearings of TT/TC. */
-extern UInt VG_(number_of_lrus);
+/* The number of discards of TT/TC. */
+extern UInt VG_(number_of_tc_discards);
 
 /* Counts pertaining to the register allocator. */
 
@@ -1454,7 +1444,7 @@
 
 extern void VG_(get_tt_tc_used) ( UInt* tt_used, UInt* tc_used );
 
-extern Int  VG_(add_to_trans_tab) ( Addr orig_addr,  Int orig_size,
+extern void VG_(add_to_trans_tab) ( Addr orig_addr,  Int orig_size,
                                     Addr trans_addr, Int trans_size );
 
 extern void VG_(invalidate_translations) ( Addr start, UInt range );
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index 163b64b..b9792b4 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -372,9 +372,6 @@
 /* 64-bit counter for the number of bbs to go before a debug exit. */
 ULong VG_(bbs_to_go);
 
-/* The current LRU epoch. */
-UInt VG_(current_epoch) = 0;
-
 /* This is the ThreadId of the last thread the scheduler ran. */
 ThreadId VG_(last_run_tid) = 0;
 
@@ -396,16 +393,8 @@
 UInt VG_(tt_fast_misses) = 0;
 
 
-/* Counts for LRU informational messages. */
+/* Counts for TT/TC informational messages. */
 
-/* Number and total o/t size of new translations this epoch. */
-UInt VG_(this_epoch_in_count) = 0;
-UInt VG_(this_epoch_in_osize) = 0;
-UInt VG_(this_epoch_in_tsize) = 0;
-/* Number and total o/t size of discarded translations this epoch. */
-UInt VG_(this_epoch_out_count) = 0;
-UInt VG_(this_epoch_out_osize) = 0;
-UInt VG_(this_epoch_out_tsize) = 0;
 /* Number and total o/t size of translations overall. */
 UInt VG_(overall_in_count) = 0;
 UInt VG_(overall_in_osize) = 0;
@@ -415,8 +404,8 @@
 UInt VG_(overall_out_osize) = 0;
 UInt VG_(overall_out_tsize) = 0;
 
-/* The number of LRU-clearings of TT/TC. */
-UInt VG_(number_of_lrus) = 0;
+/* The number of discards of TT/TC. */
+UInt VG_(number_of_tc_discards) = 0;
 
 
 /* Counts pertaining to the register allocator. */
@@ -1182,9 +1171,8 @@
 static void vg_show_counts ( void )
 {
    VG_(message)(Vg_DebugMsg,
-		"      lru: %d epochs, %d clearings.",
-		VG_(current_epoch),
-                VG_(number_of_lrus) );
+		"    TT/TC: %d tc sectors discarded.",
+                VG_(number_of_tc_discards) );
    VG_(message)(Vg_DebugMsg,
                 "translate: new     %d (%d -> %d; ratio %d:10)",
                 VG_(overall_in_count),
@@ -1358,7 +1346,7 @@
    if (VG_(clo_verbosity) > 1)
       vg_show_counts();
 
-   if (VG_(clo_verbosity) > 2)
+   if (VG_(clo_verbosity) > 3)
       VG_(print_UInstr_histogram)();
 
    if (0) {
diff --git a/coregrind/vg_needs.c b/coregrind/vg_needs.c
index 5abeffd..c725f95 100644
--- a/coregrind/vg_needs.c
+++ b/coregrind/vg_needs.c
@@ -38,11 +38,12 @@
 
 /* Init with default values. */
 VgDetails VG_(details) = {
-   .name             = NULL,
-   .version          = NULL,
-   .description      = NULL,
-   .copyright_author = NULL,
-   .bug_reports_to   = NULL,
+   .name                  = NULL,
+   .version               = NULL,
+   .description           = NULL,
+   .copyright_author      = NULL,
+   .bug_reports_to        = NULL,
+   .avg_translation_sizeB = 0
 };
 
 VgNeeds VG_(needs) = {
@@ -116,6 +117,7 @@
    CHECK_NOT(VG_(details).description,      NULL);
    CHECK_NOT(VG_(details).copyright_author, NULL);
    CHECK_NOT(VG_(details).bug_reports_to,   NULL);
+   CHECK_NOT(VG_(details).avg_translation_sizeB, 0);
 
 #undef CHECK_NOT
 #undef INVALID_Bool
@@ -125,17 +127,18 @@
 /* Setting details */
 
 /* Use macro because they're so repetitive */
-#define DETAILS(detail)  \
-   extern void VG_(details_##detail)(Char* detail) \
-   {                                   \
-      VG_(details).detail = detail;          \
+#define DETAILS(type, detail)                       \
+   extern void VG_(details_##detail)(type detail)   \
+   {                                                \
+      VG_(details).detail = detail;                 \
    }
 
-DETAILS(name)
-DETAILS(version)
-DETAILS(description)
-DETAILS(copyright_author)
-DETAILS(bug_reports_to)
+DETAILS(Char*, name)
+DETAILS(Char*, version)
+DETAILS(Char*, description)
+DETAILS(Char*, copyright_author)
+DETAILS(Char*, bug_reports_to)
+DETAILS(Int, avg_translation_sizeB)
 
 /*--------------------------------------------------------------------*/
 /* Setting needs */
diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c
index df5e0a0..f11ed79 100644
--- a/coregrind/vg_scheduler.c
+++ b/coregrind/vg_scheduler.c
@@ -317,7 +317,7 @@
 void create_translation_for ( ThreadId tid, Addr orig_addr )
 {
    Addr trans_addr;
-   Int  orig_size, trans_size, tcbytes_allocated;
+   Int  orig_size, trans_size;
 
    /* Make a translation, into temporary storage. */
    VG_(translate)( &VG_(threads)[tid],
@@ -329,19 +329,10 @@
    vg_assert(orig_size > 0 && orig_size < 65536);
    vg_assert(trans_size > 0 && trans_size < 65536);
 
-   tcbytes_allocated
-      = VG_(add_to_trans_tab)( orig_addr, orig_size, trans_addr, trans_size );
+   VG_(add_to_trans_tab)( orig_addr, orig_size, trans_addr, trans_size );
 
    /* Free the intermediary -- was allocated by VG_(emit_code). */
    VG_(arena_free)( VG_AR_JITTER, (void*)trans_addr );
-
-   /* Update stats. */
-   VG_(this_epoch_in_count) ++;
-   VG_(this_epoch_in_osize) += orig_size;
-   VG_(this_epoch_in_tsize) += trans_size;
-   VG_(overall_in_count) ++;
-   VG_(overall_in_osize) += orig_size;
-   VG_(overall_in_tsize) += tcbytes_allocated; //trans_size; 
 }
 
 
diff --git a/coregrind/vg_transtab.c b/coregrind/vg_transtab.c
index 7082c13..8372d6c 100644
--- a/coregrind/vg_transtab.c
+++ b/coregrind/vg_transtab.c
@@ -43,8 +43,8 @@
 /* Number of sectors the TC is divided into. */
 #define VG_TC_N_SECTORS 8
 
-#define VG_TC_QSIZE 2000000
-
+/* Calculated once at startup and never changed. */
+/* const */ Int vg_tc_sector_szB = 0;
 
 /* Number of entries in the translation table.  This must be a prime
    number in order to make the hashing work properly. */
@@ -109,6 +109,12 @@
 /* The number of the sector currently being allocated in. */
 static Int vg_tc_current;
 
+/* Count of number of translations, orig and new bytes in each sector.
+   For stats purposes only. */
+static Int vg_tc_stats_count[VG_TC_N_SECTORS];
+static Int vg_tc_stats_osize[VG_TC_N_SECTORS];
+static Int vg_tc_stats_tsize[VG_TC_N_SECTORS];
+
 
 /*------------------ TRANSLATION TABLE ------------------*/
 
@@ -127,6 +133,22 @@
 
 /*------------------ TT HELPERS ------------------*/
 
+static
+void pp_tt_tc_status ( Char* submsg )
+{
+   Int tc_used, s;
+   if (VG_(clo_verbosity) <= 2)
+      return;
+   tc_used = 0;
+   for (s = 0; s < VG_TC_N_SECTORS; s++)
+      tc_used += vg_tc_used[s];
+
+   VG_(message)(Vg_DebugMsg, 
+       "%luk bbs: tt %d, tc %d, %s",
+       VG_(bbs_done) / 1000,
+       vg_tt_used, tc_used, submsg );
+}
+
 /* Invalidate the tt_fast cache, for whatever reason, by pointing all
    entries at vg_tc_bogus_TCEntry.  */
 static
@@ -218,8 +240,7 @@
             add_tt_entry(tce);
       }
    }
-   VG_(printf)("TT: rebuild of TC complete, %d entries\n",
-               vg_tt_used );
+   pp_tt_tc_status ( "after  rebuild of TC" );
 }
 
 
@@ -250,12 +271,21 @@
 static
 void discard_oldest_sector ( void )
 {
+   Char msg[100];
    Int s = find_oldest_sector();
    if (s != -1) {
       vg_assert(s >= 0 && s < VG_TC_N_SECTORS);
-      VG_(printf)("TT: discard sector %d (holding %d bytes)\n", 
-                  s, vg_tc_used[s]);
+      VG_(sprintf)(msg, "before discard of sector %d (%d bytes)", 
+                        s, vg_tc_used[s]);
+      pp_tt_tc_status ( msg );
+      VG_(overall_out_count) += vg_tc_stats_count[s];
+      VG_(overall_out_osize) += vg_tc_stats_osize[s];
+      VG_(overall_out_tsize) += vg_tc_stats_tsize[s]; 
       vg_tc_used[s] = 0;
+      vg_tc_stats_count[s] = 0;
+      vg_tc_stats_osize[s] = 0;
+      vg_tc_stats_tsize[s] = 0;
+      VG_(number_of_tc_discards) ++;
    }
 }
 
@@ -265,12 +295,15 @@
 static
 Int maybe_commission_sector ( void )
 {
-   Int s;
+   Char msg[100];
+   Int  s;
    for (s = 0; s < VG_TC_N_SECTORS; s++) {
       if (vg_tc[s] != NULL && vg_tc_used[s] == 0) {
          vg_tc_age[s] = VG_(overall_in_count);
-         VG_(printf)("TT: commission sector %d at time %d\n",
-                     s, vg_tc_age[s] );
+         VG_(sprintf)(msg, "after  commission of sector %d "
+                           "at time %d", 
+                           s, vg_tc_age[s]);
+         pp_tt_tc_status ( msg );
 #        ifdef DEBUG_TRANSTAB
          VG_(sanity_check_tc_tt)();
 #        endif
@@ -280,36 +313,18 @@
    for (s = 0; s < VG_TC_N_SECTORS; s++) {
       if (vg_tc[s] == NULL) {
          vg_tc[s] = VG_(get_memory_from_mmap) 
-                       ( VG_TC_QSIZE, "trans-cache(sector)" );
+                       ( vg_tc_sector_szB, "trans-cache(sector)" );
          vg_tc_used[s] = 0;
-         VG_(printf)("TT: allocate   sector %d of %d bytes\n",
-                     s, VG_TC_QSIZE );
+         VG_(sprintf)(msg, "after  allocation of sector %d "
+                           "(size %d)", 
+                           s, vg_tc_sector_szB );
+         pp_tt_tc_status ( msg );
          return maybe_commission_sector();
       }
    }
    return -1;
 }
 
-void VG_(init_tt_tc) ( void )
-{
-   Int s;
-   for (s = 0; s < VG_TC_N_SECTORS; s++) {
-      vg_tc[s] = NULL;
-      vg_tc_used[s] = 0;
-      vg_tc_age[s] = 0;
-   }
-   vg_tc_current = 0;
-
-   vg_tt = VG_(get_memory_from_mmap) ( VG_TT_SIZE * sizeof(TTEntry),
-                                       "trans-table" );
-   /* The main translation table is empty. */
-   initialise_tt();
-
-#  ifdef DEBUG_TRANSTAB
-   VG_(sanity_check_tc_tt)();
-#  endif
-}
-
 
 static
 UChar* allocate ( Int nBytes )
@@ -329,7 +344,7 @@
    if (vg_tc_current >= 0 
        && vg_tc_current < VG_TC_N_SECTORS
        && vg_tc[vg_tc_current] != NULL
-       && vg_tc_used[vg_tc_current] + nBytes <= VG_TC_QSIZE) {
+       && vg_tc_used[vg_tc_current] + nBytes <= vg_tc_sector_szB) {
       /* Yes. */
       UChar* p = &(vg_tc[vg_tc_current][ vg_tc_used[vg_tc_current] ]);
       vg_tc_used[vg_tc_current] += nBytes;
@@ -374,11 +389,11 @@
 */
 void VG_(sanity_check_tc_tt) ( void )
 {
-  Int i, s;
-  TTEntry* tte;
-  TCEntry* tce;
-  /* Checks: 
-     - Each TT entry points to a valid and corresponding TC entry.
+   Int i, s;
+   TTEntry* tte;
+   TCEntry* tce;
+   /* Checks: 
+      - Each TT entry points to a valid and corresponding TC entry.
    */
    for (i = 0; i < VG_TT_SIZE; i++) {
       tte = &vg_tt[i];
@@ -398,36 +413,14 @@
          be VG_TTE_DELETED, or a real orig addr. */
       vg_assert(tte->orig_addr == tce->orig_addr);
    }
-
-
-#if 0
-   Int      i, counted_entries, counted_bytes;
-   TTEntry* tte;
-   counted_entries = 0;
-   counted_bytes   = 0;
-   for (i = 0; i < VG_TT_SIZE; i++) {
-      tte = &vg_tt[i];
-      if (tte->orig_addr == VG_TTE_EMPTY) continue;
-      vg_assert(tte->mru_epoch >= 0);
-      vg_assert(tte->mru_epoch <= VG_(current_epoch));
-      counted_entries++;
-      counted_bytes += 4+tte->trans_size;
-      vg_assert(tte->trans_addr >= (Addr)&vg_tc[4]);
-      vg_assert(tte->trans_addr < (Addr)&vg_tc[vg_tc_used]);
-      vg_assert(VG_READ_MISALIGNED_WORD(tte->trans_addr-4) == i);
-   }
-   vg_assert(counted_entries == vg_tt_used);
-   vg_assert(counted_bytes == vg_tc_used);
-#endif
 }
 
 
 /* Add this already-filled-in entry to the TT.  Assumes that the
    relevant code chunk has been placed in TC, along with a dummy back
-   pointer, which is inserted here.  Return # of tc bytes allocated,
-   for stats purposes only.
+   pointer, which is inserted here.
 */
-Int VG_(add_to_trans_tab) ( Addr orig_addr,  Int orig_size,
+void VG_(add_to_trans_tab) ( Addr orig_addr,  Int orig_size,
                              Addr trans_addr, Int trans_size )
 {
    Int i, nBytes, trans_size_aligned;
@@ -447,6 +440,8 @@
 
    tce = (TCEntry*)allocate(nBytes);
    /* VG_(printf)("allocate returned %p\n", tce); */
+   vg_assert(vg_tc_current >= 0 && vg_tc_current < VG_TC_N_SECTORS);
+
    tce->orig_addr  = orig_addr;
    tce->orig_size  = (UShort)orig_size;  /* what's the point of storing this? */
    tce->trans_size = (UShort)trans_size_aligned;
@@ -455,7 +450,15 @@
    }
 
    add_tt_entry(tce);
-   return trans_size;  /* nBytes; */
+
+   /* Update stats. */
+   VG_(overall_in_count) ++;
+   VG_(overall_in_osize) += orig_size;
+   VG_(overall_in_tsize) += trans_size;
+
+   vg_tc_stats_count[vg_tc_current] ++;
+   vg_tc_stats_osize[vg_tc_current] += orig_size;
+   vg_tc_stats_tsize[vg_tc_current] += trans_size;
 }
 
 
@@ -516,9 +519,6 @@
 
       vg_tt[i].orig_addr = VG_TTE_DELETED;
       tce->orig_addr = VG_TTE_DELETED;
-      VG_(this_epoch_out_count) ++;
-      VG_(this_epoch_out_osize) += tce->orig_size;
-      VG_(this_epoch_out_tsize) += tce->trans_size;
       VG_(overall_out_count) ++;
       VG_(overall_out_osize) += tce->orig_size;
       VG_(overall_out_tsize) += tce->trans_size;
@@ -538,7 +538,7 @@
 #     endif
    }
 
-   if (1|| VG_(clo_verbosity) > 1)
+   if (VG_(clo_verbosity) > 2)
       VG_(message)(Vg_UserMsg,   
          "discard %d (%d -> %d) translations in range %p .. %p",
          out_count, out_osize, out_tsize, i_start, i_end );
@@ -549,6 +549,48 @@
 /*--- Initialisation.                                      ---*/
 /*------------------------------------------------------------*/
 
+void VG_(init_tt_tc) ( void )
+{
+   Int s;
+
+   /* Figure out how big each sector should be.  */
+   vg_tc_sector_szB 
+      = (VG_TT_LIMIT /* max TT entries we expect */
+         * VG_(details).avg_translation_sizeB)
+        / VG_TC_N_SECTORS;
+   /* Ensure the calculated value is not way crazy. */
+   vg_assert(vg_tc_sector_szB >= 200000);
+   vg_assert(vg_tc_sector_szB <= 6000000);
+
+   for (s = 0; s < VG_TC_N_SECTORS; s++) {
+      vg_tc[s] = NULL;
+      vg_tc_used[s] = 0;
+      vg_tc_age[s] = 0;
+      vg_tc_stats_count[s] = 0;
+      vg_tc_stats_osize[s] = 0;
+      vg_tc_stats_tsize[s] = 0;
+   }
+   vg_tc_current = 0;
+
+   vg_tt = VG_(get_memory_from_mmap) ( VG_TT_SIZE * sizeof(TTEntry),
+                                       "trans-table" );
+   /* The main translation table is empty. */
+   initialise_tt();
+
+   if (VG_(clo_verbosity) > 2) {
+      VG_(message)(Vg_DebugMsg,
+         "Translation Cache: using %d sectors of %d bytes each", 
+          VG_TC_N_SECTORS, vg_tc_sector_szB );
+      VG_(message)(Vg_DebugMsg,
+         "Translation Table: %d total entries, max occupancy %d (%d%%)",
+         VG_TT_SIZE, VG_TT_LIMIT, VG_TT_LIMIT_PERCENT );
+   }
+
+#  ifdef DEBUG_TRANSTAB
+   VG_(sanity_check_tc_tt)();
+#  endif
+}
+
 /*--------------------------------------------------------------------*/
 /*--- end                                            vg_transtab.c ---*/
 /*--------------------------------------------------------------------*/
diff --git a/example/ex_main.c b/example/ex_main.c
index 38664c6..deac4d5 100644
--- a/example/ex_main.c
+++ b/example/ex_main.c
@@ -16,6 +16,10 @@
       "Copyright (C) 2002, and put in the public domain, by Santa Claus.");
    VG_(details_bug_reports_to)  ("santa.claus@northpole.org");
 
+   /* Adjust this to be closer to reality once you have your skin
+      working. */
+   VG_(details_avg_translation_sizeB) ( 100 );
+
    /* No needs, no core events to track */
 }
 
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index dee7a48..3e9de66 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -3077,6 +3077,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
+   VG_(details_avg_translation_sizeB) ( 89 );
 
    VG_(needs_core_errors)();
    VG_(needs_skin_errors)();
diff --git a/include/vg_skin.h b/include/vg_skin.h
index 1d0e1d3..e748111 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -1195,11 +1195,17 @@
    surprisingly) no version info is printed; this mechanism is designed for
    skins distributed with Valgrind that share a version number with
    Valgrind.  Other skins not distributed as part of Valgrind should
-   probably have their own version number. */
-extern void VG_(details_name)             ( Char* name );
-extern void VG_(details_version)          ( Char* version );
-extern void VG_(details_description)      ( Char* description );
-extern void VG_(details_copyright_author) ( Char* copyright_author );
+   probably have their own version number.  */
+extern void VG_(details_name)                  ( Char* name );
+extern void VG_(details_version)               ( Char* version );
+extern void VG_(details_description)           ( Char* description );
+extern void VG_(details_copyright_author)      ( Char* copyright_author );
+
+/* Average size of a translation, in bytes, so that the translation
+   storage machinery can allocate memory appropriately.  Not critical.
+   If you're unsure, set to 100 (indicating typical code expansion of
+   about 6:1). */
+extern void VG_(details_avg_translation_sizeB) ( Int );
 
 /* String printed if an `sk_assert' assertion fails or VG_(skin_panic)
    is called.  Should probably be an email address. */
diff --git a/lackey/lk_main.c b/lackey/lk_main.c
index 117cb49..98c662d 100644
--- a/lackey/lk_main.c
+++ b/lackey/lk_main.c
@@ -82,6 +82,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
+   VG_(details_avg_translation_sizeB) ( 175 );
 
    VG_(register_compact_helper)((Addr) & add_one_dlrr_call);
    VG_(register_compact_helper)((Addr) & add_one_BB);
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index 9035cbd..742cb58 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -1535,6 +1535,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Julian Seward.");
    VG_(details_bug_reports_to)  ("jseward@acm.org");
+   VG_(details_avg_translation_sizeB) ( 200 );
 
    VG_(needs_core_errors)         ();
    VG_(needs_skin_errors)         ();
diff --git a/none/nl_main.c b/none/nl_main.c
index dc31c81..b31fa5a 100644
--- a/none/nl_main.c
+++ b/none/nl_main.c
@@ -40,6 +40,7 @@
    VG_(details_copyright_author)(
       "Copyright (C) 2002, and GNU GPL'd, by Nicholas Nethercote.");
    VG_(details_bug_reports_to)  ("njn25@cam.ac.uk");
+   VG_(details_avg_translation_sizeB) ( 76 );
 
    /* No needs, no core events to track */
 }