299 Commits

Author SHA1 Message Date
Julian Seward
d5afec1f4b Make ULong_width(0) return 1 instead of 1431655765. This stops
cachegrind segfaulting if it can't open its output file.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4973
2005-11-01 02:20:19 +00:00
Julian Seward
ebb032b983 Don't assume the first statement is an IRMark, since it could instead
be part of a self-check.  Instead, copy verbatim any IR preamble
preceding the first IMark.  This stops cachegrind asserting on
self-checking translations.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4967
2005-10-23 12:06:55 +00:00
Julian Seward
1a90cce793 Oops, un-break cachegrind regtesting following r4951.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4953
2005-10-20 00:30:30 +00:00
Julian Seward
9f24dcde2a Clarify the P4 warning message a bit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4951
2005-10-19 23:49:45 +00:00
Julian Seward
fb8743cd20 rm unused var
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4950
2005-10-19 23:49:20 +00:00
Julian Seward
1813e8fdcd Change the core-tool interface so that tools are fully aware of both
the guest extents for the presented translation and also its original
un-redirected guest address.  These changes are needed in particular
to make cachegrind's code cache management work properly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4943
2005-10-18 12:04:18 +00:00
Nicholas Nethercote
953321d26a A small Cachegrind cleanup: previously it was copying some things (eg.
instr_size and instr_addr) into Ir events, then later copying those into
instrInfo nodes.  Now it just allocates the instrInfo nodes earlier and
copies them in directly.  This is a bit more concise and easier to
understand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4937
2005-10-16 00:17:37 +00:00
Nicholas Nethercote
4d3a1be8d1 Cachegrind cleanups:
- Remove some unnecessary assertions.
- Add in some new ones.
- Make things more concise and readable by factoring out things like
  "cgs->events[i+1]" into things like "ev2" in flushEvents().



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4936
2005-10-15 22:07:28 +00:00
Nicholas Nethercote
c3302079e9 OSet-ified Cachegrind:
- The instrInfoTable was a VgHashTable, now it's an OSet.  
- The CC table was a custom 3-level hash table, now it's an OSet.  This
  is easier to understand and there's no worrying about whether the hash
  array sizes are big enough.  It also has the nice property that the
  results in the cachegrind.out.<pid> file are now sorted, so they're a bit
  easier to read.

I did some testing and the performance difference appears to be negligible;
CC table and InstrInfo table lookups and traversal aren't that critical.
  


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4933
2005-10-15 17:46:18 +00:00
Nicholas Nethercote
e5cec4f567 Tiny comment/code layout tweaks; no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4913
2005-10-12 16:45:17 +00:00
Julian Seward
6ae26c97c8 Get rid of bbSeenBefore and associated logic: it appears to be
irrelevant.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4912
2005-10-12 16:16:03 +00:00
Julian Seward
4a7b975b76 rm trigram stuff.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4904
2005-10-12 10:29:40 +00:00
Julian Seward
5740bf2f53 Redo the way cachegrind generates instrumentation code, so that it can
deal with any IR that happens to show up.  This makes it work on ppc32
and should fix occasionally-reported bugs on x86/amd64 where it bombs
due to having to deal with multiple date references in a single
instruction.

The new scheme is based around the idea of a queue of memory events
which are outstanding, in the sense that no IR has yet been generated
to do the relevant helper calls.  The presence of the queue --
currently 16 entries deep -- gives cachegrind more scope for combining
multiple memory references into a single helper function call.  As a
result it runs 3%-5% faster than the previous version, on x86.

This commit also changes the type of the tool interface function
'tool_discard_basic_block_info' and clarifies its meaning.  See
comments in include/pub_tool_tooliface.h.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4903
2005-10-12 10:09:23 +00:00
Nicholas Nethercote
e02a407d1f Convert some native types to our types.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4899
2005-10-10 16:49:01 +00:00
Nicholas Nethercote
47996d3a09 Update cache simulator for 64 bit addresses. This probably won't have
caused many inaccuracies so far because it only matters if addresses
above the 4GB line are used.  Thanks to Josef W for the patch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4898
2005-10-10 16:18:09 +00:00
Julian Seward
cc8ccbbfb4 This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive).  That branch is now dead.
Please do not commit anything else to it.

For the most part the merge was not troublesome.  The main areas of
uncertainty are:

- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
  and include it in a couple of places.  Building etc seems to still
  work, but I haven't tried building the documentation.

- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
  stuff was moved from -generic to -linux after the branch was created.
  I think that is satisfactorily glued back together now.

- Regtests: although this appears to work, no .out files appear, which
  is strange, and makes it hard to diagnose regtest failures.  In
  particular memcheck/tests/x86/scalar.stderr.exp remains in a 
  conflicted state.

- amd64 is broken (slightly), and ppc32 will be unbuildable.  I'll
  attend to the former shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789
2005-09-27 19:20:21 +00:00
Nicholas Nethercote
ae68dcc13f actually, they're unsigned
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4766
2005-09-25 17:59:16 +00:00
Nicholas Nethercote
531b28734e Print longs as longs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4765
2005-09-25 17:57:47 +00:00
Nicholas Nethercote
ca38159b2d Don't print the client's argv[i] if it's null, and related changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4629
2005-09-13 00:46:27 +00:00
Nicholas Nethercote
50c158d0ef Fixes for #110657, based on Jakub Jelinek's patch:
- filter out L3 warning messages so they don't break Cachegrind's regtests
- handle lack of mq support gracefully in mq.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4429
2005-08-16 02:30:24 +00:00
Nicholas Nethercote
ec77b92b98 Cachegrind should not assert when it encounters a client request.
BACKPORT TO 3_0_X



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4391
2005-08-12 23:47:51 +00:00
Nicholas Nethercote
8515143ce8 Get rid of some stupidity:
- Added some useful hash table functions (vanilla lookup() and remove()).
  [Actually, I accidentally added them with my previous commit]
  
  Replaced various simple uses of VG_(HT_get_node) with these new functions. 

- Passing record_freemismatch_error() the MAC_Chunk of the freed heap block.
  So now we don't need to call describe_addr() to re-find that block, which
  means that we can remove the MAC_Chunk from the malloc_list earlier, rather
  than having to do a lookup and then later remove it with the stupid removal
  handle returned by VG_(HT_get_node)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4379
2005-08-11 00:47:10 +00:00
Nicholas Nethercote
05cf8f1611 Replace out-of-date email address.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4322
2005-08-04 19:26:54 +00:00
Nicholas Nethercote
65ee9be4ef Fixed a bug in Cachegrind: it was adding instrumentation after
conditional jumps, so if those jumps were taken, the instrumentation
wasn't executed.  This was causing the I-cache access counts to be
underestimated.  

This commit puts the instrumentation before the jumps, except for the
odd case of REP instructions, giving the same behaviour as 2.4.0.
Based on a patch from Josef Weidendorfer.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4309
2005-08-02 23:07:02 +00:00
Tom Hughes
d9d05342fb Ignore prefetch information when decoding Intel cache details. Patch
from Josef Weidendorfer <Josef.Weidendorfer@gmx.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4286
2005-07-27 22:59:50 +00:00
Nicholas Nethercote
63f82da63d fix breakage/wibbles
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4261
2005-07-25 23:30:24 +00:00
Julian Seward
6789f6542e A commit which is almost all trivial change.
- m_main: if --log-file-qualifier applies, do not add ".pid"
  at the end of the name

- Fix the logic which detected whether the just-devised name
  already existed.  This was broken (by me) because it could not
  distinguish the reasons for failing to open the logfile.

  Doing this required changing the return type of VG_(open)
  from Int to SysRes (to make failure reasons visible) and 
  that's the cause of most of the changes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4228
2005-07-23 09:18:34 +00:00
Nicholas Nethercote
2e3199022e Add a CPUID case, thanks to Josef W.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4210
2005-07-20 04:32:44 +00:00
Julian Seward
cdf83f1302 Don't bomb cachegrind at startup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4131
2005-07-08 09:45:43 +00:00
Nicholas Nethercote
e5ad110351 Remove dead function.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4101
2005-07-03 18:45:37 +00:00
Nicholas Nethercote
e67b65d0eb Changed m_hashtable.c to allow the size of the hash table to be specified
when it is created.  Fortunately this didn't affect code outside this
module except for the calls to VG_(HT_construct)().

As a result, we save some memory because not all tables have to be as big
as the ones needed for malloc/free tracking.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4100
2005-07-03 17:53:11 +00:00
Nicholas Nethercote
fbf8653c8b Removed the remnants of the attempt at an ARM port, because it had
bit-rotted badly and was clogging up the code.

I put the useful remnants in docs/porting-to-ARM in case anyone ever
wants to try porting to ARM again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4092
2005-07-02 23:13:59 +00:00
Nicholas Nethercote
1d9d123bac Don't need a foo_SOURCES line if the program has only a single source file
named foo.c.

Now again using the right flags for building fpu_lazy_eflags.c, too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4086
2005-07-02 18:24:58 +00:00
Nicholas Nethercote
d50a75cd1a Fixed 'make dist'. In particular, all the arch/platform-specific files
get included in the distro now, not just the ones for the arch/platform
that the distro tarball is built on.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4085
2005-07-02 17:36:11 +00:00
Julian Seward
1cfc0e7971 Track Vex API change (r1239, introduction of endianness-indications in
IR loads and stores.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4072
2005-06-30 23:33:37 +00:00
Julian Seward
217e0415ca Add missing #include.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4070
2005-06-30 23:20:30 +00:00
Nicholas Nethercote
1273f0df14 Combine the percentify() functions from Cachegrind and m_transtab into
a single more general one exported from m_libcprint.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4034
2005-06-26 18:43:40 +00:00
Donna Robinson
23523d0ca9 Added some more targets to the docs.
Removed 'the' from 'the default' in 'parial' opt to be consistent
Added opt info for --avoid-strlen-errors (was missing)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4017
2005-06-25 14:43:05 +00:00
Nicholas Nethercote
d463dd2292 Removed the VGA_/VGO_/VGP_ prefixes for arch/OS/platform-specific
things.  These made sense when the arch/OS/platform-specific code was in
one module, but as that code got mixed in with generic code the boundary
between generic and non-generic blurred, and the distinction made less
sense.  So let's get rid of them.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Donna Robinson
b655e45a8e argh! there were loads of the little beggars ....
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3999
2005-06-23 00:17:51 +00:00
Nicholas Nethercote
2b8699a483 Remove VG_(getcwd_alloc)(), which can be done otherwise pretty easily.
This halves m_libcfile's dependence on m_mallocfree.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3995
2005-06-21 23:44:58 +00:00
Cerion Armour-Brown
d5f7c8aed3 Finally, valgrind on ppc32.
Plenty still to do, but simple programs like ls seem to run ok

Thanks, Paul, for having your ppc port of valgrind 2.4 to work from!




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3969
2005-06-20 15:51:07 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
f4871f2c72 Move CPUID functions into their own module, m_cpuid.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3940
2005-06-18 18:31:26 +00:00
Julian Seward
90e98b737e Updates to the rest of the debuginfo module to track directory names.
The only interesting part is a change of signature of
VG_(get_filename_linenum) so that callers can optionally request
directory info too.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3909
2005-06-13 17:39:06 +00:00
Nicholas Nethercote
1d0e2e6e41 Created m_machine, for various machine-related things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3903
2005-06-13 04:21:38 +00:00
Nicholas Nethercote
e3abdc62d5 Finished the modularisation of vg_mylibc.c, which meant it could be removed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3894
2005-06-12 02:43:17 +00:00
Nicholas Nethercote
bde51e1575 Put arch-specific Cachegrind code in files in the main cachegrind/
directory, instead of subdirectories.  This is simpler and consistent
with how the rest of system is now structured.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3865
2005-06-10 04:46:19 +00:00
Nicholas Nethercote
face101a47 Modularised file and socket libc stuff in m_libcfile.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3844
2005-06-04 20:03:55 +00:00
Nicholas Nethercote
eb2d0a7d06 Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages.  This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842
2005-06-04 19:16:06 +00:00