- vg_cachesim.c
- vg_cachesim_{I1,D1,L2}.c
- vg_annotate.in
- vg_cachegen.in
Changes to existing files:
- valgrind/valgrind.in, added option:
--cachesim=no|yes [no]
- Makefile/Makefile.am:
* added vg_cachesim.c to valgrind_so_SOURCES var
* added vg_cachesim_I1.c, vg_cachesim_D1.c, vg_cachesim_L2.c to
noinst_HEADERS var
* added vg_annotate, vg_cachegen to 'bin_SCRIPTS' var, and added empty
targets for them
- vg_main.c:
* added two offsets for cache sim functions (put in positions 17a,17b)
* added option handling (detection of --cachesim=yes which turns off of
--instrument);
* added calls to cachesim initialisation/finalisation functions
- vg_mylibc: added some system call wrappers (for chmod, open_write, etc) for
file writing
- vg_symtab2.c:
* allow it to read symbols if either of --instrument or --cachesim is
used
* made vg_symtab2.c:vg_what_{line,fn}_is_this extern, renaming it as
VG_(what_line_is_this) (and added to vg_include.h)
* completely rewrote the read loop in vg_read_lib_symbols, fixing
several bugs. Much better now, although probably not perfect. It's
also relatively fragile -- I'm using the "die immediately if anything
unexpected happens" approach.
- vg_to_ucode.c:
* in VG_(disBB), patching in x86 instruction size into extra4b field of
JMP instructions at the end of basic blocks if --cachesim=yes.
Shifted things around to do this; also had to fiddle around with
single-step stuff to get this to work, by not sticking extra JMPs on
the end of the single-instruction block if there was already one
there (to avoid breaking an assertion in vg_cachesim.c). Did a
similar thing to avoid an extra JMP on huge basic blocks that are
split.
- vg_translate.c:
* if --cachesim=yes call the cachesim instrumentation phase
* made some functions extern and renamed:
allocCodeBlock() --> VG_(allocCodeBlock)()
freeCodeBlock() --> VG_(freeCodeBlock)()
copyUInstr() --> VG_(copyUInstr)()
(added to vg_include.h too)
- vg_include.c: declared
* cachesim offsets
* exports of vg_cachesim.c
* added four new profiling events (increasing VGP_M_CCS to 24 -- I kept
the spare ones)
* added comment about UInstr.extra4b field being used for instr size in
JMPs for cache simulation
- docs/manual.html:
* Added --cachesim option to section 2.5.
* Added cache profiling stuff as section 7.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@168
it extensively are probably badly designed -- they are polling.
- VG_(deliver_signals): return a Bool indicating if any signals
really were delivered. Used only to try and reduce excessive
frequency of system sanity checks.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@135
it has tremendous performance problems.
* Implement pthread_key_{create,delete} and pthread_{set,get}specific.
* Implement pthread_cond_timedwait. A nuisance.
* New timer infrastructure, based on the RDTSC instruction. This
allows fast, accurate time measurement without swamping the host with
gettimeofday() syscalls.
There's something definitely screwy about the scheduler, making opera
run slowly and mozilla run unbelievably slowly. To be investigated.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@119
when running multithreaded. Can still cause crashes (assertion failures)
when GDB exits. I think it that's due to my use of libc's system()
call; should roll my own.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@111
by the scheduler, not by generated code. So pass in the relevant
ThreadState*; don't get it from VG_(get_current_tid)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@101
Fall back to a compromise position, which makes my mutex implementation
initialiser- and structure-compatible with LinuxThreads, and ditto the
upcoming condition var implementation. In particular this means that
((ThreadId)0) is an invalid thread ID, so vg_threads[0] is never used,
and vg_threads[1] specially denotes the "main" thread.
Remove the scheme of having a linked list of threads waiting on
each mutex. It is too difficult to get the right semantics for
when a signal is delivered to a thread blocked in pthread_mutex_lock().
Instead, use the old scheme of each thread stating with its .waited_on_mx
field, which mutex it is waiting for. This makes pthread_mutex_unlock()
less efficient, but at least it all works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@100
for implementation of condition variables.
* Use the native pthread_mutex_t directly; we no longer have our own
VgMutex type nor a fixed array of them.
* Give ThreadState a new field q_next :: ThreadId, used to make a
linked list of threads waiting on a mutex, or condition variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@99
Various enhancements:
* Make the error message system more thread-aware.
* Fix stupid bug in do_pthread_create causing incorrect initial
%ESP values sometimes.
* Fix various other minor things needed to make opera work.
Performance of threaded apps is pretty terrible. This needs
looking into.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@98
VG_(unimplemented). In future this will not be enabled by default due
to the danger of recursion of assertion failures.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@92
of pthread event tracing. And allow this info to be passed across to
the client, where vg_libpthread.c uses it to also control verbosity.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@91
on the client-request subsystem, and disabling it is no longer a
sensible thing to do.
Also: in the manual, mention flags --trace-sched= and --trace-pthread=.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@79
Turns out these insns are also available as Grp8 extensions, with
literal bit-offset values. Nuisance. I've #if 0'd out the old code
which implements them since am too lazy to fix them properly, and I
can't find any cases of their use anyway. I'll wait until someone
yelps.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@75
request to shutdown valgrind are done with the client request
mechanism too. This is much better than having to check all
call/return addresses.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@57
for pthread_* support. Major changes:
* Valgrind now contains a (skeletal!) user-space pthreads
implementation. The exciting bits are in new file vg_scheduler.c.
This contains thread management and scheduling, including nasty crud
to do with making some syscalls (read,write,nanosleep) nonblocking.
Also implementation of pthread_ functions: create join
mutex_{create,destroy,lock,unlock} and cancel.
* As a side effect of the above, major improvements to signal handling
and to the client-request machinery. This is now used to intercept
malloc/free etc too; the hacky way this is done before is gone.
Another side effect is that vg_dispatch.S is greatly simplified.
Also, the horrible hacks to do with delivering signals to threads
blocked in syscalls are gone, since the new mechanisms cover this case
easily.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@52
--check-addrVs=no. The default behaviour, =yes, is the original
behaviour. So far this is undocumented.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@32
UInstrs accordingly. Fixes a bug in the simulated CPU in which the
results of f{u}comi{p} FPU insns were ignored, potentially leading to
wrong program behaviour. This will only have happened to people using
P6/P7/K7 class CPUs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@30