Fix a failed assertion on retranslation of rep or cmov instructions.
Bug description: Very similar to cachegrind, callgrind stores
metainformation per guest instruction; this meta information is
given when calling into the simulator. In contrast to cachegrind,
callgrind keeps this info when the source is discarded, and checks
on retranslation whether the same meta info is generated.
This check sometimes fails: E.g. for rep x86 instructions, 2 simulator
calls
are usually generated for one x86 instruction (the instruction fetch and
a
data access), thus overwriting the data_size meta information for one
x86
instruction first with 0, and afterwards e.g. with 1. The check on
retranslation
fails because of this. The fix is to only write/check data_size values
>0.
Julian Seward [Fri, 26 May 2006 11:31:15 +0000 (11:31 +0000)]
Replace the obviously-bogus piece of inline asm with a probably
equally bogus new version. In fact if I actually understood the
magical "earlyclobber" (&) asm constraint this would probably be
unnecessary, but I don't. Ah well.
Julian Seward [Fri, 26 May 2006 00:50:41 +0000 (00:50 +0000)]
Disable tests none/tests/amd64/faultstatus, none/tests/x86/faultstatus
and none/tests/x86/int. They always fail, the tested functionality
isn't going to get fixed in a hurry, and it's just generally annoying.
Julian Seward [Fri, 26 May 2006 00:13:21 +0000 (00:13 +0000)]
Read extra args for all tests from $EXTRA_REGTEST_OPTS, which is
useful (eg) for running tests with --sanity-level= set. Print a
big warning before and after the tests if it is set.
Tom Hughes [Mon, 22 May 2006 11:20:15 +0000 (11:20 +0000)]
When moving an address range add the new range before marking the old
one as free otherwise the filename referred to by the temporary copy
of the segment may be dropped from the segment name table when the old
range is freed even though the new range is going to use it.
Julian Seward [Sat, 20 May 2006 01:13:38 +0000 (01:13 +0000)]
Change the default load address on all platforms to be 7/8s of a G.
This should make V work on any address space setup in which at least
the first 1 G of address space is usable.
Julian Seward [Sun, 7 May 2006 14:37:03 +0000 (14:37 +0000)]
Increase scheduling quantum to 100k basic blocks. Nowadays even
modest cpus can run 5-10M memcheck'd bbs per second and the previous
limit of 50k gives a 100Hz switch rate, which causes cache pollution
(a known performance problem) and other context-switch overheads.
Julian Seward [Wed, 3 May 2006 22:13:57 +0000 (22:13 +0000)]
Vectorise copy_address_range_perms for common cases. This gives about
40% speedup on artificial programs which just do realloc() and nothing
else, and about a 3-4% speedup on starting kpresenter-1.5.0 and
loading a 16-slide presentation.
Make VG_(run_innerloop) visible for outer Valgrinds
with self hosting. Without this, the symbol has
size 0 and type NOT, and is ignored by the symbol loader.
Callgrind: Improve self-hosting with outer callgrind tool
This adds an option to change the default handling of jumps
between functions. Usually, a jump between functions is
interpreted as call, because such jumps are typically
generated by compilers on tail recursion optimization, and
we want to present this as call to the user. Thus, such
a jump pushes a call onto callgrinds shadow stack.
The option "--pop-on-jump" changes this to pop+push the
shadow callstack: then, a jump between functions is seen
as a return to the caller and a new call.
The default behaviour is _bad_ for using callgrind with
self-hosting. Valgrinds inner loop VG_(run_innerloop)
jumps to generated code, and this code jumps back to
the inner loop. Thus, every executed BB adds 2 calls
to an ever increasing shadow call stack, leading to
memory consumption increasing with runtime :-(
So: For self-hosting valgrind with an outer callgrind,
always use option "--pop-on-jump" for the outer callgrind.
Fix completely bogus asm, which didn't work when compiled with gcc-4.1.0
since it trashed the regs that gcc assigned for %0 and %1 before reading
them. local_sys_write_stderr() for the 3 other targets suffer from the
same problem.
Another fix for interactive control, together with
the --base option, which allows to specify another
directory for dumps and control/result files.
With "--base=/tmp/foo", we want control/result files
in "/tmp", and not in a directory "/tmp/foo/".
- callgrind_control was not working, because it checks the
"command syntax version" to be at most 1 before doing anything.
But callgrind used Valgrinds version for this (3.2.0). Now we
define a separate version COMMAND_VERSION for the syntax format
of control and result files.
Strictly, such a version is not needed for interaction of
callgrind and the script callgrind_control itself, as they are
delivered in the same package. But there are also external
controlling tools (most notable KCachegrind)
- Some systems make it difficult for callgrind_control to
automatically detect running callgrind processes. To make
interactivity work, one has to provide the cwd with -w.
For commands expecting a result from callgrind, this result
was delivered in the wrong result file.
- Fix indentation in one section of Cachegrind
- In the same section, use VG_(percentify) to avoid overflow when computing
information for -v printing.
Recent GCCs (3.4+ at least) optimize static unused functions out, so
making VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE static and
attribute unused proved to be much better than always compiling it as
exported weak function. (Jakub Jelinek)
Add a suppression for yet another glibc string function: __strcpy_chk.
We really ought intercept/replace this, and that would be easy, except
__strcpy_chk uses __chk_fail and I haven't figured out what that
is/does.