201 Commits

Author SHA1 Message Date
Nicholas Nethercote
d8fc746ba4 64-bit cleanness: Yet more UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2910
2004-11-03 18:10:37 +00:00
Nicholas Nethercote
c4cf15dc21 Arch-abstraction:
- Added include/x86-linux/ and include/linux/ subdirectories, with Makefile.am
  files.

- Overhauled the definitions of kernel types.  include/vg_kerneliface.h is now
  three files, include/linux/vki.h, include/x86-linux/vki_arch.h, and
  include/x86-linux/vki_arch_posixtypes.h.  These files separate the
  common/Linux and x86/Linux parts cleanly.  All code is copied verbatim from
  the relevant kernel headers, except that VKI_/vki_ prefixes are added as
  necessary to distinguish them from glibc types.  (This is done consistently,
  unlike previously when some types did not have the prefixes.)

  All code is clearly marked to show which particular header file it came from,
  and the Linux version used.  (I used 2.6.8.1, the most recent stable release,
  for all of them.)

  A few of the types changed;  this is because they changed between the older
  versions of Linux and the current 2.6.8.1.  I checked that all these changes
  were ok with respect to backwards compatibility for our purposes.

- vg_unsafe.h has been removed;  we are no longer including any kernel headers,
  as we have our own copies for everything.  This is because installed kernel
  headers are not reliable, and often cause compilation problems. (bug
  #92420 is a recent example)

- Removed some no-longer-needed header-presence tests from configure.in.

- Some code in the rest of Valgrind was changed to account for some slight
  changes in the names of our VKI_/vki_ kernel constants and types.

- Updated README_MISSING_SYSCALL_OR_IOCTL accordingly.

- Fixed off-by-one error with VKI_GDT_ENTRY_TLS_MAX (merged from stable branch)

The end result is that the kernel types situation should be much clearer, and
similar files can be created relatively easily for other architectures as
necessary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2884
2004-10-31 18:48:21 +00:00
Nicholas Nethercote
78b8e2c67f Arch-abstraction:
- things I forgot to do when moving the insn_* tests...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2810
2004-10-19 19:07:32 +00:00
Nicholas Nethercote
66adb12133 Arch-abstraction:
- Moved all the insn_* tests into x86/ subdirectories.  What are the chances of
  me getting this right on the first attempt?


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2809
2004-10-19 18:54:11 +00:00
Nicholas Nethercote
e2f30c46bc Forgot to cvs remove this when I moved it to x86/.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2807
2004-10-19 17:49:39 +00:00
Nicholas Nethercote
eaa7a649e8 Whoops, forgot this file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2805
2004-10-19 17:30:25 +00:00
Nicholas Nethercote
03517b9c00 Arch-abstraction:
- Move x86-specific regtests for Cachegrind into an x86/ subdir.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2804
2004-10-19 17:00:59 +00:00
Nicholas Nethercote
f4d320e3c4 Arch-abstraction:
- Rewrote tests/cputest.c so that it can apply to different kinds of
  processors.  The idea being that any arch-specific tests have a cpu_test:
  label in their .vgtest file, so they'll only get executed if the right
  machine is being used.
- Rewrote a bunch of .vgtest files accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2802
2004-10-19 16:29:30 +00:00
Nicholas Nethercote
19ab8eeec7 Add a new CPUID cache configuration for more recent Pentiums.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2746
2004-10-13 11:30:14 +00:00
Tom Hughes
880d78e9c3 Put back missing space...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2731
2004-10-06 13:50:12 +00:00
Tom Hughes
fe77cbbf89 Cope with arguments over 510 characters in length when writing the
cachegrind output file.

CCMAIL: 90834-done@bugs.kde.org


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2730
2004-10-06 13:49:36 +00:00
Nicholas Nethercote
6bfdfff36c Arch-abstraction:
- previous Cachegrind rearrangement broke "make distcheck";  this commit
  fixed it again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2699
2004-09-11 18:27:43 +00:00
Nicholas Nethercote
67d6dc6e2b Arch-abstraction:
- In Cachegrind, abstract out x86-specific use of CPUID to find cache
  configuration.  Required adding a cachegrind/x86/ directory, and fiddling
  a bit with the build system.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2698
2004-09-11 16:45:27 +00:00
Nicholas Nethercote
49eea042c1 Arch-abstraction: introduce constants for min and max instruction sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2660
2004-09-04 15:28:37 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
acd57ac595 Use Makefile.am includes. This gets rid of 110 lines of repetitive Makefile.am
cruft, yay!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2641
2004-09-01 23:20:49 +00:00
Nicholas Nethercote
0db27515b1 Putting "dist_" in front of a "_DATA" variable means it is included in "make
dist".  This avoids the need to put it in "EXTRA_DIST", and saves a few lines
in all the docs Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2614
2004-08-25 11:40:07 +00:00
Nicholas Nethercote
a2b3609df7 Small step in factoring out arch-specific code: replace
__attribute((regparm(n))) with REGPARM(n) everywhere.  REGPARM() is defined in
vg_skin.h, but will eventually be defined separately for each arch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2601
2004-08-23 15:06:23 +00:00
Nicholas Nethercote
1bd17a3d0f Remove a bunch of unnecessary -DVG_LIBDIR="\"$(libdir)"\" arguments in
Makefile.am files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2597
2004-08-23 14:02:03 +00:00
Nicholas Nethercote
9efd786362 Add some missing 'static' annotations. Thanks to Josef W for spotting them.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2573
2004-08-07 15:54:53 +00:00
Tom Hughes
8582802cb3 Add instruction tests for the LFENCE/MFENCE/SFENCE instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2523
2004-07-25 15:18:21 +00:00
Nicholas Nethercote
0af73c4f28 Type name wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2518
2004-07-21 08:49:02 +00:00
Nicholas Nethercote
798fa0f8fa comment typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2514
2004-07-20 13:29:02 +00:00
Nicholas Nethercote
755111b88d Slightly change, with J's approval, startup copyright messages to better
reflect reality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2489
2004-07-16 17:44:00 +00:00
Tom Hughes
81368d791a Only print a warning about not having identified the cache if we have
actually failed to recognise it...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2460
2004-07-07 07:16:14 +00:00
Nicholas Nethercote
6991ae3a73 minor
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2459
2004-07-06 22:46:41 +00:00
Nicholas Nethercote
4c7cf81a28 Completely overhauled Cachegrind's data structures. With the new
scheme, there are two main structures:

1. The CC table holds a cost centre (CC) for every distinct source code
   line, as found using debug/symbol info.  It's arranged by files, then
   functions, then lines.

2. The instr-info-table holds certain important pieces of info about
   each instruction -- instr_addr, instr_size, data_size, its line-CC.
   A pointer to the instr's info is passed to the simulation functions,
   which is shorter and quicker than passing the pieces individually.

This is nice and simple.  Previously, there was a single data structure
(the BBCC table) which mingled the two purposes (maintaining CCs and
caching instruction info).  The CC stuff was done at the level of
instructions, and there were different CC types for different kinds of
instructions, and it was pretty yucky.  The two simple data structures
together are much less complex than the original single data structure.

As a result, we have the following general improvements:

- Previously, when code was unloaded all its hit/miss counts were stuck
  in a single "discard" CC, and so that code would not be annotated.  Now
  this code is profiled and annotatable just like all other code.

- Source code size is 27% smaller.  cg_main.c is now 1472 lines, down
  from 2174.  Some (1/3?) of this is from removing the special handling
  of JIFZ and general compaction, but most is from the data structure
  changes.  Happily, a lot of the removed code was nasty.

- Object code size (vgskin_cachegrind.so) is 15% smaller.

- cachegrind.out.pid size is about 90+% smaller(!)  Annotation time is
  accordingly *much* faster.  Doing cost-centres at the level of source
  code lines rather than instructions makes a big difference, since
  there's typically 2--3 instructions per source line.  Even better,
  when debug info is not present, entire functions (and even files) get
  collapsed into a single "???" CC.  (This behaviour is no different
  to what happened before, it's just the collapsing used to occur in the
  annotation script, rather than within Cachegrind.)  This is a huge win
  for stripped libraries.

- Memory consumption is about 10--20% less, due to fewer CCs.

- Speed is not much changed -- the changes were not in the intensive
  parts, so the only likely change is a cache improvement due to using
  less memory.  SPEC experiments go -3 -- 10% faster, with the "average"
  being unchanged or perhaps a tiny bit faster.

I've tested it reasonably thoroughly, it seems extremely similar result
as the old version, which is highly encouraging.  (The results aren't
quite the same, because they are so sensitive to memory layout;  even
tiny changes to Cachegrind affect the results slightly.)

Some particularly nice changes that happened:

- No longer need an instrumentation prepass;  this is because CCs are not
  stored grouped by BB, and they're all the same size now.  (This makes
  various bits of code much simpler than before).

- The actions to take when a BB translation is discarded (due to the
  translation table getting full) are much easier -- just chuck all the
  instr-info nodes for the BB, without touching the CCs.

- Dumping the cachegrind.out.pid file at the end is much simpler, just
  because the CC data structure is much neater.

Some other, specific changes:

- Removed the JIFZ special handling, which never did what it was
  intended to do and just complicated things.  This changes the results
  for REP-prefixed instructions very slightly, but it's not important.

- Abbreviated the FP/MMX/SSE crap by being slightly laxer with size
  checking -- not an issue, since this checking was just a pale
  imitation of the stricter checking done in codegen anyway.

- Removed "fi" and "fe" handling from cg_annotate, no longer needed due
  to neatening of the CC-table.

- Factorised out some code a bit, so fewer monolithic slabs,
  particularly in SK_(instrument)().

- Just improved formatting and compacted code in general in various
  places.

- Removed the long-commented-out sanity checking code at the bottom.

Phew.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2458
2004-07-06 21:54:20 +00:00
Nicholas Nethercote
6cf57dabba Remove unused variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2457
2004-07-03 20:27:39 +00:00
Nicholas Nethercote
0362ed10c0 Fix meaningless typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2456
2004-07-02 15:28:34 +00:00
Tom Hughes
a2a0946b8a Make VPATH builds work so that valgrind can be built in a different
directory from the source tree. This resolves bug 83040.

Based on patch from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2450
2004-06-29 09:45:37 +00:00
Tom Hughes
3561ea08ca Added VG_(cpuid) to replace the various bits of inline assembler used
to query the CPU characteristics as the use of four implicit registers
causes havoc when GCC tries to inline and optimise the assembler.

Fix to bug #79696.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2421
2004-06-16 20:51:45 +00:00
Nicholas Nethercote
2fc96dcc06 Add a "delete:" line to the regression test .vgtest files, to clean up any file
created by the test.  Added appropriate lines to the Cachegrind and Massif
tests.  Should prevent large numbers of files clogging up directories.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2372
2004-04-17 17:25:08 +00:00
Tom Hughes
91e78b3482 Added more floating point instruction tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2347
2004-03-31 22:47:52 +00:00
Tom Hughes
3330a9f65b Added more floating point instruction tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2343
2004-03-28 10:33:51 +00:00
Tom Hughes
2f1fb3e5f9 Added tests for floating point multiple and divide instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2340
2004-03-28 00:30:57 +00:00
Tom Hughes
cd101bf7b2 Extended instruction test system to handle x87 floating point instructions
and started working on adding tests for the x87 instruction set.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2338
2004-03-27 18:02:37 +00:00
Tom Hughes
57b01439e0 Move the handling of PSHUFW from the SSE code to the MMX code so that
it will work on older Athlons which only have MMXEXT support.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2319
2004-03-15 16:43:58 +00:00
Jeremy Fitzhardinge
82aaa16ef9 Fix "make distcheck", and also make sure that the generated archive
contains everything needed to "make regtest".  Bump the version.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2308
2004-03-12 10:51:39 +00:00
Tom Hughes
5c5cc2d261 Fix expected standard error output for mmxext tests to resolve
differences in the amount of whitespace left with different skins.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2303
2004-03-09 08:50:02 +00:00
Jeremy Fitzhardinge
5c00880d69 Use Tom's instruction set tests on all tools which do instrumentation, so
we can make it's OK for all instructions.  Helgrind is badly broken in this
test (bug 69856).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2301
2004-03-09 01:44:11 +00:00
Nicholas Nethercote
32b992d36a Fix a bug in Cachegrind: when invalidating BBs, the lookup in the BBCC_table
sometimes failed, causing an assertion failure.  This is because the debug
info for the code address, which is used in the lookup,
can change -- eg. "myprint.c:myprint()" is found at instrumentation, but by the
time the invalidation occurs, it's changed to "myprint.c:???".  So it now falls
back to a slow exhaustive search of the table.

This was causing cachegrind/tests/dlclose to fail, and should hopefully fix
bug #72781.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2218
2004-01-21 16:12:55 +00:00
Nicholas Nethercote
c756c590cf Convert "skin" to "tool" in various places; almost entirely within comments,
nothing that will affect code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2217
2004-01-21 15:08:04 +00:00
Nicholas Nethercote
5630025b84 Patch from Tom Hughes, for bug 72643:
Patch to improve SSE/SS2 support

  This patch should implement most of the missing SSE/SSE2 opcodes. About
  the only ones it doesn't do are the MASKMOVxxx ones as they are quite
  horrible and involved an implicit reference to EDI so I need to think
  about them a bit more.

  The patch also includes a set of tests for the MMX/SSE/SSE2 opcodes to
  validate that they have the same effect under valgrind as they do when
  run normally. In one or two cases this wasn't actually the case even
  for some of the implemented opcodes, so I fixed those as well ;-)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2202
2004-01-19 19:14:18 +00:00
Nicholas Nethercote
30427d2857 Removed files I meant to with the last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2189
2004-01-06 16:08:31 +00:00
Julian Seward
cafeef8e48 Support for FXSAVE/FXRSTOR (Tom Hughes). Fixes #71180.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2183
2004-01-04 23:30:55 +00:00
Nicholas Nethercote
a2ce0a19a6 Folded cg_sim_{gen,I1,D1,L2}.c into cg_sim.c, which makes a lot more sense and
is shorter.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2178
2004-01-04 16:56:57 +00:00
Nicholas Nethercote
07b8e3438b Updated copyright dates for 2004. Also added a couple of missing headers and
footers to some new files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2177
2004-01-04 16:43:23 +00:00
Jeremy Fitzhardinge
918c3a7b7e This jumbo-checkin is the Full Virtualization checkin. This eliminates
Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.

This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind.  It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.

This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward.  See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118
2003-12-16 02:05:15 +00:00
Nicholas Nethercote
d6d804d382 Updated all "report bugs to..." messages to point to valgrind.kde.org; also
updated the docs to refer to valgrind.kde.org instead of the old website.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2055
2003-11-20 16:20:55 +00:00
Nicholas Nethercote
095472ed9c Fix regtest for change of error message.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2045
2003-11-19 20:09:53 +00:00