mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
Change the --smc-check default value to =all-non-file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15601
This commit is contained in:
parent
5d3dfe7224
commit
6bf68780dc
@ -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"
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -1 +1,2 @@
|
||||
prog: bigcode
|
||||
vgopts: --smc-check=stack
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
prog: bigcode
|
||||
args: 0
|
||||
vgopts: --smc-check=stack
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user