]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Followup to r13652 (make the translation cache size be command-line
authorJulian Seward <jseward@acm.org>
Fri, 18 Oct 2013 11:18:45 +0000 (11:18 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 18 Oct 2013 11:18:45 +0000 (11:18 +0000)
controllable): reduce MAX_N_SECTORS to 24, speed up Sector
initialisation, wording tweaks.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13655

NEWS
coregrind/m_main.c
coregrind/m_transtab.c
coregrind/pub_core_transtab.h
docs/internals/3_8_BUGSTATUS.txt
docs/xml/manual-core.xml
none/tests/cmdline1.stdout.exp
none/tests/cmdline2.stdout.exp

diff --git a/NEWS b/NEWS
index a31481ebb2c50c32e6f2a582b6b88db13acd91b4..48d18e4b8a28e6a67a1c9b75642e1f7db3574f6e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -620,6 +620,9 @@ FIXED r??
 323177  Unhandled instruction: SMLSLD (ARM + Thumb)
         FIXED 2778 13584
 
+324421  Support for fanotify API on ARM architecture
+        FIXED 13586
+
 
 Release 3.8.1 (19 September 2012)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 8a079891d362a298c2408a5a42777a03dfc9a7f1..c2a918c552c5a6a84fb7cb0d7aa6bfeb57e392f3 100644 (file)
@@ -201,7 +201,7 @@ static void usage_NORETURN ( Bool debug_help )
 "    --merge-recursive-frames=<number>  merge frames between identical\n"
 "           program counters in max <number> frames) [0]\n"
 "    --num-transtab-sectors=<number> size of translated code cache [%d]\n"
-"           more sectors may increase the performance, but use more memory.\n"
+"           more sectors may increase performance, but use more memory.\n"
 "    --show-emwarns=no|yes     show warnings about emulation limits? [no]\n"
 "    --require-text-symbol=:sonamepattern:symbolpattern    abort run if the\n"
 "                              stated shared object doesn't have the stated\n"
index 456819b5d3e0bf9a22c6e7b911bce1266825f55b..082be51887f59077a6c47354c266f66fd067dc01 100644 (file)
@@ -57,7 +57,7 @@
 UInt VG_(clo_num_transtab_sectors) = N_SECTORS_DEFAULT;
 /* Nr of sectors.
    Will be set by VG_(init_tt_tc) to VG_(clo_num_transtab_sectors). */
-static int n_sectors;
+static UInt n_sectors = 0;
 
 /*------------------ CONSTANTS ------------------*/
 /* Number of TC entries in each sector.  This needs to be a prime
@@ -354,7 +354,7 @@ static Int    youngest_sector = -1;
 
 /* The number of ULongs in each TCEntry area.  This is computed once
    at startup and does not change. */
-static Int    tc_sector_szQ;
+static Int    tc_sector_szQ = 0;
 
 
 /* A list of sector numbers, in the order which they should be
@@ -2174,7 +2174,7 @@ static void unredir_discard_translations( Addr64 guest_start, ULong range )
 
 void VG_(init_tt_tc) ( void )
 {
-   Int i, j, avg_codeszQ;
+   Int i, avg_codeszQ;
 
    vg_assert(!init_done);
    init_done = True;
@@ -2208,23 +2208,15 @@ void VG_(init_tt_tc) ( void )
    vg_assert(n_sectors >= MIN_N_SECTORS);
    vg_assert(n_sectors <= MAX_N_SECTORS);
 
-   /* Initialise the sectors */
+   /* Initialise the sectors, even the ones we aren't going to use.
+      Set all fields to zero. */
    youngest_sector = 0;
-   for (i = 0; i < n_sectors; i++) {
-      sectors[i].tc = NULL;
-      sectors[i].tt = NULL;
-      sectors[i].tc_next = NULL;
-      sectors[i].tt_n_inuse = 0;
-      for (j = 0; j < ECLASS_N; j++) {
-         sectors[i].ec2tte_size[j] = 0;
-         sectors[i].ec2tte_used[j] = 0;
-         sectors[i].ec2tte[j] = NULL;
-      }
-      sectors[i].host_extents = NULL;
-   }
+   for (i = 0; i < MAX_N_SECTORS; i++)
+      VG_(memset)(&sectors[i], 0, sizeof(sectors[i]));
 
-   /* Initialise the sector_search_order hint table. */
-   for (i = 0; i < n_sectors; i++)
+   /* Initialise the sector_search_order hint table, including the
+      entries we aren't going to use. */
+   for (i = 0; i < MAX_N_SECTORS; i++)
       sector_search_order[i] = -1;
 
    /* Initialise the fast cache. */
index b02296636e4c17235cc23aba37fc5393668a3b7b..837487419bb9ecf8109f4f28b9aca8829311501c 100644 (file)
@@ -63,7 +63,7 @@ extern void VG_(init_tt_tc)       ( void );
 /* Limits for number of sectors the TC is divided into.  If you need a larger
    overall translation cache, increase MAX_N_SECTORS. */ 
 #define MIN_N_SECTORS 2
-#define MAX_N_SECTORS 32
+#define MAX_N_SECTORS 24
 
 /* Default for the nr of sectors, if not overriden by command line.
    On Android, space is limited, so try to get by with fewer sectors.
index 09d891aea74580accbec289059cdcad0ea338380..9a17a0eb047e934587d9a74799cb0878baa1ba14 100644 (file)
@@ -471,10 +471,6 @@ Tue Jul  2 12:15:07 CEST 2013
         MIPS64; has patch; assigned to Petar
         MAYBE 3.9 (query Petar)
 
-322254 *Show threadname together with tid if set by application
-        Contains plausible looking patch (what's with XML output??)
-        FIX 3.9 (commit)
-
 322256  Provide more callstacks on memory pool related errors
         Contains plausible patch; needs looking at
         Severity: low  Audience: low
@@ -576,10 +572,6 @@ Tue Jul  2 12:15:07 CEST 2013
         Hmm, looks like a real bug.
         Severity: med  Audience: low
 
-324421 *Support for fanotify API on ARM architecture
-        Has simple patch; should apply.
-        FIX 3.9 (trivial patch)
-
 324486  WARNING: unhandled syscall: 310
         == 166355
         Hmm, tricky, sys_unshare.
index acbb165df372d824faa8ad2dd6ae223685365a34..8aa7f3277748f3d5fffdbbeef12824413e4d6f51 100644 (file)
@@ -1857,18 +1857,20 @@ need to use them.</para>
       <option><![CDATA[--num-transtab-sectors=<number> [default: 6 or 16] ]]></option>
     </term>
     <listitem>
-      <para>Valgrind translates and instruments your program code. The
-      translations are stored in a translation cache organized in
-      sectors. If the cache is full, the sector containing the older
-      translations is emptied and recycled. If these old translations
-      are needed again, Valgrind must re-translate and re-instrument
-      the corresponding program code. If the "executed instructions"
-      working set of a program is big, increasing the number of
-      sectors may improve the performance by reducing the number of
-      re-translations needed.  A sector is lazily allocated but once
-      allocated, it permanently uses several MB depending
-      on the tool (about 40 MB per sector for memcheck).
-      Use the option <option>--stats=yes</option> to obtain precise
+      <para>Valgrind translates and instruments your program's machine
+      code in small fragments. The translations are stored in a
+      translation cache that is divided into a number of sections
+      (sectors). If the cache is full, the sector containing the
+      oldest translations is emptied and recycled. If these old
+      translations are needed again, Valgrind must re-translate and
+      re-instrument the corresponding program code, which is
+      expensive.  If the "executed instructions" working set of a
+      program is big, increasing the number of sectors may improve
+      performance by reducing the number of re-translations needed.
+      Sectors are allocated on demand.  Once allocated, a sector can
+      never be freed, and occupies considerable space, on the tool
+      (about 40 MB per sector for Memcheck).  Use the
+      option <option>--stats=yes</option> to obtain precise
       information about the memory used by a sector and the allocation
       and recycling of sectors.</para>
    </listitem>
index abd100eea80b538f8eff21af8b5c629a5c792ee1..12d7cce91dff8174c9aa7d101e69e0cf09b0c740 100644 (file)
@@ -89,7 +89,7 @@ usage: valgrind [options] prog-and-args
     --merge-recursive-frames=<number>  merge frames between identical
            program counters in max <number> frames) [0]
     --num-transtab-sectors=<number> size of translated code cache [16]
-           more sectors may increase the performance, but use more memory.
+           more sectors may increase performance, but use more memory.
     --show-emwarns=no|yes     show warnings about emulation limits? [no]
     --require-text-symbol=:sonamepattern:symbolpattern    abort run if the
                               stated shared object doesn't have the stated
index 0ca629e600135ed9e443e34a16380345ba31b18e..c3e3d3c97237afc2480d3755b0cf6baeb155433e 100644 (file)
@@ -89,7 +89,7 @@ usage: valgrind [options] prog-and-args
     --merge-recursive-frames=<number>  merge frames between identical
            program counters in max <number> frames) [0]
     --num-transtab-sectors=<number> size of translated code cache [16]
-           more sectors may increase the performance, but use more memory.
+           more sectors may increase performance, but use more memory.
     --show-emwarns=no|yes     show warnings about emulation limits? [no]
     --require-text-symbol=:sonamepattern:symbolpattern    abort run if the
                               stated shared object doesn't have the stated