76 Commits

Author SHA1 Message Date
Julian Seward
e8dd1efe84 Implement --weird-hacks=truncate-writes to limit the size of write syscalls
to 4096, to possibly avoid deadlocks under very rare circumstances.
Is fully documented and commented.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@479
2002-06-30 12:44:54 +00:00
Nicholas Nethercote
e95cef5f3c Removed line about Cachegrind being experimental.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@472
2002-06-27 15:45:09 +00:00
Julian Seward
130d8c068d Disable debug printing on BB discard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@427
2002-06-14 11:08:07 +00:00
Julian Seward
f18008337f Patrick Ohly's --alignment= patch, to increase alignment of malloc'd
blocks if needed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@422
2002-06-14 10:17:05 +00:00
Julian Seward
c797c7e5f9 First round of manual update for 1.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@417
2002-06-13 20:37:25 +00:00
Julian Seward
37ad57a2b5 Namespace police woz here
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@408
2002-06-13 11:11:05 +00:00
Julian Seward
cf4a890c45 Inconsequential cleanups to recent cachesim hacking.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@407
2002-06-13 10:25:56 +00:00
Nicholas Nethercote
9dd7bf5c81 Whoops, forgot to add this last time.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@406
2002-06-12 08:49:04 +00:00
Nicholas Nethercote
7c06858a4f vg_annotate.in:
- fixed a bug that was breaking the --threshold option.

vg_cachesim.c:
    - fixed a bug that meant instructions that didn't have a line number in the
      debug info were being written in cachegrind.out with whatever was the
      last known line number.  Now using 0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@403
2002-06-10 15:31:16 +00:00
Nicholas Nethercote
f598db43e4 A few minor improvements.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@402
2002-06-10 10:24:05 +00:00
Nicholas Nethercote
9e8a864df1 Updated Cachegrind section for the CPUID-addition/vg_cachegen-removal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@401
2002-06-08 14:06:37 +00:00
Nicholas Nethercote
b859182c44 Removed the need for the user to generate a cache simulation -- now do
automatic cache configuration detection using the CPUID instruction.
This can be overridden from the command-line if necessary.

vg_include.h:
    - added the cache_t type and UNDEFINED_CACHE macro

    - added command line args (of type cache_t) allowing manual override of
      I1/D1/L2 configuration

    - added log2(), which is generally useful

vg_main.c, valgrind.in, cachegrind.in:
    - added handling of the new --{I1,D1,L2}=<size>,<assoc>,<line_size>
      options

vg_cachesim.c:
    - lots of stuff for auto-detecting cache configuration with CPUID.
      Only handles Intel and AMD chips at the moment, and possibly not all of
      them.  Falls back onto defaults if anything goes wrong, and the configs
      can be manually overridden from the command line anyway.

    - now not printing cache summary stats if verbosity == 0.  Still writing
      cachegrind.out, though.

vg_cachesim_gen.c:
    - new file containing stuff shared by the I1/D1/L2 simulations

vg_cachesim_{I1,D1,L2}:
    - removed most of it;  each now just calls a macro defined in
      vg_cachesim_gen.c

vg_cachegen:
    - has been cvs removed as it is no longer needed.

Makefile.am:
    - added vg_cachesim_gen.c

    - removed vg_cachegen

configure.in:
    - removed vg_cachegen


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@400
2002-06-08 13:36:03 +00:00
Nicholas Nethercote
77dca1afe5 Cache simulator now handles basic block discards correctly. When
VG_(cachesim_discard_notify) is called, the cost centre array for the basic
block is removed from the table, and its counts are aggregated into a single
"discard" cost centre, and the cost centre array is free'd.

The aggregate discard cost centre is given the filename:function_name
"(discarded):(discarded)".  Mentioned this in the manual.

Only tested with tests/discard.c.  Seems to work well for that case though :)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@385
2002-06-05 14:41:10 +00:00
Nicholas Nethercote
6cae67ce51 Added compile-time option to print instruction addresses for each line in
cachegrind.out.  Increases file size by a fair bit, but useful for debugging
stabs errors <sigh>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@384
2002-06-05 09:39:31 +00:00
Nicholas Nethercote
703acc24b7 Tiny documentation wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@383
2002-06-05 09:21:51 +00:00
Julian Seward
a487ef1ce7 A new kind of error: PThread errors. Used to report detected misuse in
the pthread_* API.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@379
2002-06-04 22:54:20 +00:00
Julian Seward
9b734f2384 Markup bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@352
2002-06-01 23:56:38 +00:00
Julian Seward
1ece8474f2 Update author attributions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@350
2002-06-01 23:43:49 +00:00
Julian Seward
162b23f120 Update for sigaltstack
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@312
2002-05-22 23:56:33 +00:00
Julian Seward
53c56fd4d1 Implement semaphore functions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@295
2002-05-19 00:13:34 +00:00
Julian Seward
96b04d4f30 Fix fork/exec stuff so it works again. We have to mangle LD_LIBRARY_PATH
as well as LD_PRELOAD, so as to make our libpthread.so go out of scope
when a child which we don't want to trace, is exec'd.  Otherwise the
child can wind up being connected to our libpthread.so but not to
valgrind.so, which is an unworkable combination; you have to be connected
to both or neither.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@291
2002-05-18 13:14:17 +00:00
Julian Seward
e45ef9f6cc Add clarification of the purpose of the malloc/free mismatch checks
(Pascal Massimino)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@289
2002-05-18 11:09:19 +00:00
Julian Seward
6610ca19b3 Remove existing non-working support for self-modifying code, and instead
add a simple compromise, in which the client can notify valgrind
that certain code address ranges are invalid and should be retranslated.
This is done using the VALGRIND_DISCARD_TRANSLATIONS macro in valgrind.h.

At the same time take the opportunity to close the potentially fatal
loophole that translations for executable segments were not being
discarded when those segments were munmapped.  They are now.

Documentation updated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@274
2002-05-16 11:06:21 +00:00
Nicholas Nethercote
ab8de9f4f7 Fix incredibly stupid bug.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@270
2002-05-15 14:30:55 +00:00
Nicholas Nethercote
8cbe9082c5 Expanded --sort option to take threshold args with the event names. Lets you
do things like "show functions covering 99% of all D2mr events *and* 99% of all
D2mw events" - before you could only choose the threshold for one.

Useful for me, but probably no-one else.  Still mentioned it in the docs,
though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@269
2002-05-13 20:27:54 +00:00
Frédéric Gobry
460d2313d2 Use $(srcdir) to specify the location of the linker script
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@268
2002-05-13 07:50:45 +00:00
Julian Seward
d6920d2b5c Fix spelling mistake: wierd*hacks --> weird*hacks
Also add a testcase.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@265
2002-05-12 10:52:16 +00:00
Julian Seward
2943666eb5 In order to catch timeout events on fds which are readable and which
have been ioctl(TCSETA)'d with a VTIMEout, we appear to need to ask if
the fd is writable, for some reason.  Ask me not why.  Since this is
strange and potentially troublesome we only do it if the user asks
specially, by specifying --wierd-hacks=ioctl-VTIME.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@264
2002-05-12 03:00:17 +00:00
Julian Seward
59ff40a36c Insert hacks, only partially successful, to make 'make distcheck' work
with the new vg_libpthread.vs linker script.  Problem is that builds
where builddir != srcdir don't work now.  Don't know how to fix.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@253
2002-05-10 03:03:57 +00:00
Julian Seward
aa02efa1a0 More symbol versioning stuff
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@250
2002-05-10 01:52:58 +00:00
Julian Seward
ee775d8b61 Add a version script so as to create the right versioned symbols for
libpthread.so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@249
2002-05-10 01:42:33 +00:00
Nicholas Nethercote
74bb5ef434 Minor corrections about cache profiling cost centres.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@243
2002-05-09 15:43:33 +00:00
Nicholas Nethercote
53d40a27da vg_symtab2.c:
- No longer aborting when encountering a N_SOL symbol after the 65535th
      line in a file, just printing a warning/apology that annotations/messages
      might be wrong.

      This is a pain to fix properly, since it requires first guessing when a
      line number overflow happens, then switching to one or more other files,
      then switching back.

manual: wibble


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@225
2002-05-07 10:26:57 +00:00
Julian Seward
b8da65e6bd External namespace cleanup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@210
2002-05-03 22:29:04 +00:00
Nicholas Nethercote
ea2c63ce9e Removed description of cachegrind.out file format, since it's now in the tech
docs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@199
2002-05-03 17:54:51 +00:00
Nicholas Nethercote
ece0587a11 Added section to tech docs on how cachegrind works, including the
cachegrind.out file format.

Tiny change in user manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@198
2002-05-03 17:51:10 +00:00
Nicholas Nethercote
c501c4beaf vg_symtab2.c:
- Can now handle file sizes > 65536 lines, despite the stabs format only
      storing line numbers in a short.  Do this heuristically, by looking for
      line number sequences that go from 65000-odd to 0-odd within the same
      file.

      This required changing the RiLoc.lineno field to 20 bytes, which gives a
      maximum file length of 1,000,000-odd lines, whichs seems reasonable.

      In order to keep RiLoc at 12 bytes (important because there are lots of
      them) this required stealing four bits from the RiLoc.size field,
      reducing it to 12 bits.  This isn't too bad because the size is unlikely
      to be larger than 4096 bytes -- we were already ignoring any ones larger
      than 10,000 bytes because they were suspicious anyway (and see next
      point).

    - Tightened up the sanity checking on line address ranges.  Previously any
      range that looked suspicious (eg. > 10000 bytes, or not within the bound
      of the segment info) was simply ignored(!)  Now it prints a warning when
      this happens and truncates the size to 1 to be safe;  also there are some
      extra assertions for totally space-cadet numbers.

      (At first these checks were all assertions, but I tried a version of GNU
      gas that produces a small handful of dodgy stabs entries;  warnings
      seemed a reasonable compromise.)

vg_cachesim.c:
    - Removed the requirement that both types of cost centre (iCC, idCC) have
      instr_addr as their second word.  Less fragile -- now the only
      requirement is that they both have their type tag as their first byte.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@197
2002-05-03 16:41:05 +00:00
Nicholas Nethercote
6503fcaf5a Added "L2 refs line" (an oversight).
Fixed minor output summary spacing wibble.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@196
2002-05-02 13:56:34 +00:00
Julian Seward
892eb8f8fc Remove comments about Mozilla 1.0RC1 crashing, since that's not a Valgrind
bug, and explain, for the benefit of Mozilla hackers, how to make 1.0RC1
work on Valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@195
2002-05-02 03:57:00 +00:00
Dirk Mueller
303554e3ad fix for auto-annotating C++ method names (they have :'s in it)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@191
2002-05-01 21:52:05 +00:00
Julian Seward
50ca1d2fc2 Fix free and free-mismatch err so the top frame in the bt isn't skipped.
Put a better example of free-mismatch error in the manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@190
2002-05-01 21:46:38 +00:00
Julian Seward
6b485c7718 Bring manual up-to-date and add stuff about pthread support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@189
2002-05-01 12:38:06 +00:00
Julian Seward
55019fd863 Don't want to see these guys with just -v. There get to be bazillions
of them after a while.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@184
2002-05-01 02:32:10 +00:00
Julian Seward
ebe11593f2 Build and install 'cachegrind' along with 'valgrind'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@181
2002-05-01 01:25:45 +00:00
Julian Seward
c786245133 Edit cache stuff, minorly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@180
2002-05-01 01:24:52 +00:00
Nicholas Nethercote
1818ed0e51 vg_symtab2.c:
Discovered sometimes a SLINE stabs entry is the last one (which broke an
    assertion).  In such a case, we must guess the line's instruction address
    range -- I've guessed 4, arbitrarily.

vg_cachegen.in, vg_cachesim_{I1,D1,L2}.c:
    Discovered a bad bug in the cache simulation:  when determining if a
    references straddles two memory blocks, to find the end of the range I was
    adding 'size' to the base address, rather than 'size - 1'.  This was
    causing way too many straddled references, which would inflate the miss
    counts.

vg_cachesim.c:
    Minor stuff


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@176
2002-04-30 13:44:01 +00:00
Nicholas Nethercote
bf347fb8e0 Added note about bts/btr/btc causing bogus cache read counts.
Added to todo list note about files with > 65536 lines.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@175
2002-04-30 12:46:22 +00:00
Nicholas Nethercote
ee24852e5a Right-justifying event names instead of left-justifying; easier to read when
large numbers are involved and the columns are wide.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@174
2002-04-30 11:34:54 +00:00
Julian Seward
6c89523e81 Relax assertion to avoid this: vg_cachesim.c:402
(compute_BBCC_array_size): Assertion `!is_STORE && !is_FPU_R &&
!is_FPU_W' failed.

I don't know if this is correct, but I can run kate having done so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@171
2002-04-30 10:18:48 +00:00
Julian Seward
7558b43cf5 Config/build/install vg_annotate and vg_cachegen correctly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@169
2002-04-29 17:27:07 +00:00