For --profile-flags=, weight the counts by the number of guest insns
in each IRSB, rather than considering each IRSB to have a weight of 1.
This probably gives more representative profiles, especially post
t-chain merge, which made inter-SB transitions more or less free
compared to what they were before.
Be lenient if the machine model could not be determined. Assume it's
a new machine as opposed to a too old machine.
Patch by Christian Borntraeger (borntraeger@de.ibm.com) with additional
commentary. Fixes 298394.
Consolidate and update information about dependencies of
VG_(machine_get_hwcaps) for all architectures in pub_core_machine.h
and avoid double maintenance.
Last optimisation for the day: change VG_(stats__n_xindirs) in such a
way that the fast-path through VG_(disp_cp_xindir) only has to
increment a 32 bit counter, saving memory bandwidth on 32 bit
platforms compared to a 64-bit inc. The overall numbers of XIndirs
can still be 64 bit though.
add some .globl or used attribute to avoid link failures with gold linker + LTO
When doing experiment with gcc 4.7.0 and link time optimisation,
encountered link failures on amd64 which were solved by adding
.globl and used attribute.
=> added .globl in similar places for arm/x86/ppc32/s390.
Did not touch darwin (which asm seems somewhat different).
Change permission mask for FIFOs and shared memory to 0600 instead of 0666
Following a discussion about which user can debug which VAlgrind gdbserver:
The default umask will remove the "other" and "group" write bits.
Without the w bits, nothing works in any case.
Moreover, if the vgdb process does not belong to the user running the
V gdbserver, connections are also not possible.
=> remove useless/confusing bits.
patch fixing 297991: mmap changing a file descriptor current position
Bug caused by the following problem:
for each mmap, Valgrind reads the 1st 1024 bytes to detect
if this is an mmap-ed file containing debug info to decode.
Reading this 1Kb is done with VG_(pread). VG_(pread) should be
the equivalent of syscall pread but on linux, it is implemented as
a seek+read.
The patch implements VG_(pread) in terms of the underlying pread syscall.
Test mmap_fcntl_bug.c completed to also verify the fd current position
before and after the mmap.
tested on linux x86/amd64/ppc32/ppc64/s390.
(not tested on Darwin)
(manually tested on arm-android)
TCHAIN: avoid calls to search_transtab and return to scheduer by first using tt_fast
This slightly improves some perf tests (e.g. heap).
Some not explained "real time" slow down of bz2 between trunk/svn tchain
and this patch analyzed with callgrind/cachegrind.
realtime slowdown attributed to Pentium 4 self modifying code unfriendly cache.
(callgrind/cachegrind cache simulation do not understand self modifying
code).
Android's libc includes advertise a "malloc_usable_size", but the
libc.so contains no such symbol; rather a "dlmalloc_usable_size"
(great, huh :-) So intercept that too, on Android.
outer/inner setup: new perf/vg_perf options to run perf tests + support translation chaining in inner.
* perf/vg_perf:
Similarly to tests/vg_regtest, perf/vg_perf now accepts the 3
optional arguments:
--outer-valgrind
--outer-tool
--outer-args
This allows easy analysis or comparison of performance between
different Valgrind versions (e.g. using callgrind, or cachegrind/cg_diff).
* See README_DEVELOPERS for more details.
* vg_regtest modified so as to use the 'in-place' build of inner, rather
than the installed version.
* added option --smc-check=all-non-file to vg_perf and vg_regtest
outer default arguments (needed when evaluating a Valgrind which does
translation chaining).
TCHAIN: remove caused_discard* argument to VG_(translate)
This is the followup to rev 12488.
With this revision, translation chaining is not done
if the translation with 'from address' is not existing
anymore (discarded or erased).
The assumption documented in 12488 comment has been checked by:
* first reproduce a crash in Firefox when always setting
caused discard to False
* then upgrade to rev 12488
* with this upgrade, no crash anymore.
=> this verifies that the caused discard logic is properly
replaced by revision 12488.
Fix assert due to gdbserver discarding translation
The fix consists in checking if the translation
of the 'from' address is still existing.
Patch also contains a big comment explaining why it is
safe to discard/erase the current translation being
executed.
In a follow-up patch, the Bool in VG_(translate) will
be removed :
Bool VG_(translate) ( /*OUT*/Bool* caused_discardP,
(if experiment confirms the hypothesis that it is
safe to discard current translation).
drd, free() intercept: Swap freeing and cleaning memory.
Note: since the big lock is held while the malloc() and free() intercepts are
running, and since mmap() is treated by Valgrind as a non-blocking system call,
this code change is not expected to result in a behavior change of drd.
Further fix 297078 : implement conversion between vki and gdb real time sig nr.
* gdbserver_tests/nlpasssigalrm
modify test so as to test also a real time signal
* coregrind/m_gdbserver/signals.c
- implement translation between gdb real time signal numbers
and vki real time signal numbers
- ensure non-convertible signals are giving an error
Fix bug 297078 gdbserver signal handling problems caused by diff vki nr/gdb nr and
non reset of "C-ontinued" signal
* To allow vki signame to be used in debuglog:
- pub_core_signals.h : added prototype for Char *VG_(signame)
- m_signals.c : changed static const Char *signame(Int sigNo)
to const Char *VG_(signame)(Int sigNo)
* valgrind-low.c : when the signal to report to gdb has
been reported, clear it so that it is not reported anymore
afterwards.
* m_gdbserver.c: when checking in pass_signals if signal
can be passed without gdb interaction, do a conversion
from vki nr to gdb nr when indexing
(as pass_signals[] is indexed by gdb_nr).
* various gdbserver files:
- used vki_ prefix for some args and variables to clarify
- better debuglog tracing
* modified nlpasssigalrm.vgtest to test SIGCHLD signal
handling followed by a break (to see SIGTRAP is properly
given to gdb).
Julian Seward [Tue, 27 Mar 2012 10:19:39 +0000 (10:19 +0000)]
/* Do expensive interpretation for Iop_Add32 and Iop_Add64 on
Darwin. 10.7 is mostly built with LLVM, which uses these for
bitfield inserts, and we get a lot of false errors if the cheap
interpretation is used, alas. Could solve this much better if
we knew which of such adds came from x86/amd64 LEA instructions,
since these are the only ones really needing the expensive
interpretation, but that would require some way to tag them in
the _toIR.c front ends, which is a lot of faffing around. So
for now just use the slow and blunt-instrument solution. */
Pertains to, although does not completely solve, #242137.
Julian Seward [Tue, 27 Mar 2012 10:06:31 +0000 (10:06 +0000)]
Add a nasty kludge in the handling of mmap on Darwin. Does not apply
to any other platforms. Prevent mmap(ANON) from returning zero (zero
with success, that is) since (a) some programs are observed to be
spooked by getting zero from a successful call to mmap, and (b) it's
pretty stupid from the point of view of program safety and possibly
security, since it causes page zero to become accessible. So don't.
Bart Van Assche [Sun, 25 Mar 2012 17:51:59 +0000 (17:51 +0000)]
Check whether the big lock is held before invoking pre_thread_ll_create.
If the pre_thread_ll_create tracking function would be invoked without the
big lock being held, that would trigger a race condition in the tools that
implement this tracking function.
Have check_makẹfile_consistency run at the end of make regtest
This ensures that a missing file in the Makefile is detected,
without blocking the tests.
add test-plo-no.stderr.exp-s390x-mvc in EXTRA_DIST.
Note: such missing files in EXTRA_DIST are found
by check_makefile_consistency.
However, to avoid blocking the tests, the return code
of check_makefile_consistency is ignored, but the errors
it detects are pages before the end of the make regtest output.
=> it might be a good idea to move the check_makefile_consistency
as the last step of regtest: target, and not ignore its return code.
This means:
trials tests will not block make regtest
such errors will be noticed.
For the moment, just fixed the missing file in EXTRA_DIST
Modify test so that scheduling events are generated.
Even without fair scheduling, this ensures the progress
of each thread.
This avoids the test looping forever in an outer/inner
setup.
Florian Krohm [Sun, 18 Mar 2012 01:51:12 +0000 (01:51 +0000)]
Add spreadsheet that lists all s390 opcodes in the following format:
1. column: mnemonic
2. column: description
3. column: implementation status
4. column: comments, if any
Prepared by Divya Vyas (divyvyas@linux.vnet.ibm.com).
(for x86 and amd64): Change the type of the shadow regs for floating point registers
Similar to r12444 (see Log below), but this is doing it for x86 and amd64.
The xmm registers are using uint32 or uint64 for their float
union components. For the i387 80 bits float registers, as there is
no uint80, a struct uint16 + uint64 is defined.
Log:
Change the type of the shadow regs for floating point registers
to be uint64. Previously the value in such a shadow reg would
be interpreted by gdb as a floating point value which would
produce non-sensible output for e.g p/x $f1s1.
This patch covers the power and arm architectures.
Florian Krohm [Wed, 14 Mar 2012 01:15:59 +0000 (01:15 +0000)]
Change the type of the shadow regs for floating point registers
to be uint64. Previously the value in such a shadow reg would
be interpreted by gdb as a floating point value which would
produce non-sensible output for e.g p/x $f1s1.
This patch covers the power and arm architectures.
Fix leak in debuginfo.c
di->soname was not freed, so was leaked when debug info is removed.
free(soname) added in free_Debuginfo, after having verified
and then ensured that all soname are allocated in dinfo.