]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change the --smc-check default value to =all-non-file.
authorJulian Seward <jseward@acm.org>
Mon, 31 Aug 2015 13:05:35 +0000 (13:05 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 31 Aug 2015 13:05:35 +0000 (13:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15601

coregrind/m_main.c
coregrind/m_options.c
docs/xml/manual-core.xml
none/tests/cmdline1.stdout.exp
none/tests/cmdline2.stdout.exp
perf/bigcode.c
perf/bigcode1.vgperf
perf/bigcode2.vgperf

index a95ff9feff5030bf15e48d13a177356b27c97d40..cd9cad10cc83f3df4419aa7fa114560982c5db72 100644 (file)
@@ -160,7 +160,7 @@ static void usage_NORETURN ( Bool debug_help )
 "    --allow-mismatched-debuginfo=no|yes  [no]\n"
 "                              for the above two flags only, accept debuginfo\n"
 "                              objects that don't \"match\" the main object\n"
-"    --smc-check=none|stack|all|all-non-file [stack]\n"
+"    --smc-check=none|stack|all|all-non-file [all-non-file]\n"
 "                              checks for self-modifying code: none, only for\n"
 "                              code found in stacks, for all code, or for all\n"
 "                              code except that from file-backed mappings\n"
index 4248e9b99836cde4c851eca6097e8b30315b862f..b9b7b17c70f407b2ae25582618c228e5e3629baa 100644 (file)
@@ -129,7 +129,7 @@ UInt   VG_(clo_max_threads)    = MAX_THREADS_DEFAULT;
 Word   VG_(clo_main_stacksize) = 0; /* use client's rlimit.stack */
 Word   VG_(clo_valgrind_stacksize) = VG_DEFAULT_STACK_ACTIVE_SZB;
 Bool   VG_(clo_wait_for_gdb)   = False;
-VgSmc  VG_(clo_smc_check)      = Vg_SmcStack;
+VgSmc  VG_(clo_smc_check)      = Vg_SmcAllNonFile;
 UInt   VG_(clo_kernel_variant) = 0;
 Bool   VG_(clo_dsymutil)       = False;
 Bool   VG_(clo_sigill_diag)    = True;
index 80a3e664757c390fc5e396a14dba71b342c8e443..3a9e720c4082d657bdec7da52df4811d53a0122b 100644 (file)
@@ -1704,7 +1704,7 @@ need to use them.</para>
 
   <varlistentry id="opt.smc-check" xreflabel="--smc-check">
     <term>
-      <option><![CDATA[--smc-check=<none|stack|all|all-non-file> [default: stack] ]]></option>
+      <option><![CDATA[--smc-check=<none|stack|all|all-non-file> [default: all-non-file] ]]></option>
     </term>
     <listitem>
       <para>This option controls Valgrind's detection of self-modifying
@@ -1720,15 +1720,16 @@ need to use them.</para>
       file-backed mappings.
 
       Note that the default option will catch the vast majority
-      of cases.  The main case it will not catch is programs such as JIT
-      compilers that dynamically generate code <emphasis>and</emphasis>
-      subsequently overwrite part or all of it.  Running with
+      of cases, including the case where a JIT
+      compiler dynamically generates code <emphasis>and</emphasis>
+      subsequently overwrites part or all of it.  Running with
       <varname>all</varname> will slow Valgrind down noticeably.
       Running with
       <varname>none</varname> will rarely speed things up, since very little
-      code gets put on the stack for most programs.  The
+      code gets dynamically generated in most programs.  The
       <function>VALGRIND_DISCARD_TRANSLATIONS</function> client
       request is an alternative to <option>--smc-check=all</option>
+      and <option>--smc-check=all-non-file</option>
       that requires more programmer effort but allows Valgrind to run
       your program faster, by telling it precisely when translations
       need to be re-made.
@@ -1749,14 +1750,14 @@ need to use them.</para>
       takes advantage of this observation, limiting the overhead of
       checking to code which is likely to be JIT generated.</para>
 
-      <para>Some architectures (including ppc32, ppc64, ARM and MIPS)
+      <para>Some architectures (including POWER/PPC, ARM and MIPS)
       require programs which create code at runtime to flush the
       instruction cache in between code generation and first use.
       Valgrind observes and honours such instructions.  Hence, on
-      ppc32/Linux, ppc64/Linux and ARM/Linux, Valgrind always provides
+      those targets, Valgrind always provides
       complete, transparent support for self-modifying code.  It is
-      only on platforms such as x86/Linux, AMD64/Linux, x86/Darwin and
-      AMD64/Darwin that you need to use this option.</para>
+      only on platforms such as x86/Linux, AMD64/Linux, x86/Darwin,
+      AMD64/Darwin and S390/Linux that you need to use this option.</para>
     </listitem>
   </varlistentry>
 
index d7219ced931d68e0b9d6a37a7f3718ae57d4e584..3617545e3fbe647c458bb37b0944b6fd0c2a7b7e 100644 (file)
@@ -74,7 +74,7 @@ usage: valgrind [options] prog-and-args
     --allow-mismatched-debuginfo=no|yes  [no]
                               for the above two flags only, accept debuginfo
                               objects that don't "match" the main object
-    --smc-check=none|stack|all|all-non-file [stack]
+    --smc-check=none|stack|all|all-non-file [all-non-file]
                               checks for self-modifying code: none, only for
                               code found in stacks, for all code, or for all
                               code except that from file-backed mappings
index 4ea258d300a9ad5f16068ffd9879c8b62e5aeaa2..88110ec3702a6d0866b11269e410a8545f6b3a2e 100644 (file)
@@ -74,7 +74,7 @@ usage: valgrind [options] prog-and-args
     --allow-mismatched-debuginfo=no|yes  [no]
                               for the above two flags only, accept debuginfo
                               objects that don't "match" the main object
-    --smc-check=none|stack|all|all-non-file [stack]
+    --smc-check=none|stack|all|all-non-file [all-non-file]
                               checks for self-modifying code: none, only for
                               code found in stacks, for all code, or for all
                               code except that from file-backed mappings
index 8e12d7bff768b7f43ec7488382c2f819fa623fdf..ae31cbb17c31f0e43b2ffcc0230a388b3223a303 100644 (file)
@@ -8,6 +8,19 @@
 // to make a difference), but under Valgrind the one running more code is
 // significantly slower due to the extra translation time.
 
+// 31 Aug 2015: this only "works" on x86/amd64/s390 by accident; the
+// test is essentially kludged.  This "generates" code into memory
+// (the mmap'd area) and the executes it.  But historically and even
+// after this commit (r15601), the test has been run without 
+// --smc-check=all or all-non-file.  That just happens to work because
+// the "generated" code is never modified, so there's never a
+// translated-vs-reality coherence problem.  Really we ought to run
+// with the new-as-of-r15601 default --smc-check=all-non-file, but that
+// hugely slows it down and makes the results non-comparable with
+// pre r15601 results, so instead the .vgperf files now specify the
+// old default value --smc-check=stack explicitly.
+
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
index 2fdcb4c3a0c5eda225a174d99fd11dac8371b36c..ea5440f80bd3d68deb4e3865081bce33812a1dbe 100644 (file)
@@ -1 +1,2 @@
 prog: bigcode
+vgopts: --smc-check=stack
index e4a42c9890c187e6e5746fed83f21e62ef78d438..d7de3a18f2abe00a84c9b504b9027d0c9b85527a 100644 (file)
@@ -1,2 +1,3 @@
 prog: bigcode
 args: 0
+vgopts: --smc-check=stack