85 Commits

Author SHA1 Message Date
Christian Borntraeger
ad1814e451 s390x machines z196 and zec12 have 4 levels of caches. Adopt the test suite
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13106
2012-11-07 07:57:01 +00:00
Florian Krohm
a9b2103cf2 This patch is the first installment of the cache info reorganisation.
It's reorg only. No new cache autodetection stuff has been added.

coregrind
pub_tool_cpuid.h is removed as it is no longer exposed to tools.
Its contents has moved to pub_core_cpuid.h.
New file: coregrind/m_cache.c to contain the autodetect code for
cache configurations and define other cache characteristics that
cannot be autodetected (i.e. icaches_maintain_coherence). Most of 
cg-arch/x86-amd64.c was moved here. The cache detection code for
x86-64 needs to be fixed to properly initialise VexCacheInfo. It
currently has cachegrind bias.
m_cache.c exports a single function (to coregrind): 
   VG_(machine_get_cache_info)(VexArchInfo *vai)
This function is called from VG_(machine_get_hwcaps) after hwcaps have
been detected.

cachegrind
Remove cachegrind/cg-{ppc32,ppc43,arm,mips32,s390x,x86-amd64}.c
With the exception of x86/mamd64 those were only establishing a
default cache configuration and that is so small a code snippet that
a separate file is no longer warranted. So, the code was moved to
cg-arch.c. Code was added to extract the relevant info from 
x86-amd64.
New function maybe_tweak_LLc which captures the code to massage the
LLc cache configuration into something the simulator can handle. This
was originally in cg-x86-amd64.c but should be used to all architectures.
Changed warning message about missing cache auto-detect feature
to be more useful. Adapted filter-stderr scripts accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13028
2012-10-07 19:47:04 +00:00
Florian Krohm
dc87cc40e8 s390: Fix the default cache configuration. As z10-EC has an L3
cache, use that instead of the L2 -- bringing the code in synch
with documentation. 
Also improve the warning message to be more meaningful.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12911
2012-08-29 02:50:56 +00:00
Julian Seward
3e344c57f6 Merge in a port for mips32-linux, by Petar Jovanovic and Dejan Jevtic,
mips-valgrind@rt-rk.com, Bug 270777.

Valgrind: changes to existing files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12616
2012-06-07 09:13:21 +00:00
Florian Krohm
46b85eeb12 Require automake-1.10 for proper handling of include file dependencies
in .S files. Also included here is some cleanup, including a reversion
of r10378. Fixes bugzilla #197914.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12555
2012-05-06 03:37:25 +00:00
Bart Van Assche
aea944631e Remove an obsolete regression test output file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12139
2011-10-12 17:29:23 +00:00
Josef Weidendorfer
04003f215d Suppress warning about associativity change for tests
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11840
2011-06-27 17:26:19 +00:00
Julian Seward
6107fd666c Add a port to IBM z/Architecture (s390x) running Linux -- Valgrind
side components. (Florian Krohm <britzel@acm.org> and Christian
Borntraeger <borntraeger@de.ibm.com>).  Fixes #243404.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11604
2011-03-07 16:05:35 +00:00
Julian Seward
2b84460a22 Fix up printing of the can't-autodetect-params message and the
filtering out thereof, so as to make Cachegrind and Callgrind
pass their regressiont tests on ARM-Linux.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11433
2010-10-12 10:14:43 +00:00
Julian Seward
1a187bd147 Update stderr filters so that regtests pass on machines with 3-level caches.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11411
2010-10-07 13:33:28 +00:00
Nicholas Nethercote
60d9b410d4 Change Cachegrind/Callgrind to talk about the LL (last-level) cache instead
of the L2 cache.  This is to accommodate machines with three levels of
cache.  We still only simulate two levels, the first and the last.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11404
2010-10-06 22:46:31 +00:00
Nicholas Nethercote
86be4a7cf3 Update .exp files for r10783.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10784
2009-08-12 00:14:44 +00:00
Nicholas Nethercote
512909dd91 Fix 'make check' for automake-1.7. Fixes bugs 197898 and 197901.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10378
2009-06-25 23:46:23 +00:00
Nicholas Nethercote
b05a2a18d7 This commit merges the BUILD_TWEAKS branch onto the trunk. It has the
following improvements:

- Arch/OS/platform-specific files are now included/excluded via the
  preprocessor, rather than via the build system.  This is more consistent
  (we use the pre-processor for small arch/OS/platform-specific chunks
  within files) and makes the build system much simpler, as the sources for
  all programs are the same on all platforms.

- Vast amounts of cut+paste Makefile.am code has been factored out.  If a
  new platform is implemented, you need to add 11 extra Makefile.am lines.
  Previously it was over 100 lines.

- Vex has been autotoolised.  Dependency checking now works in Vex (no more
  incomplete builds).  Parallel builds now also work.  --with-vex no longer
  works;  it's little use and a pain to support.  VEX/Makefile is still in
  the Vex repository and gets overwritten at configure-time;  it should
  probably be renamed Makefile-gcc to avoid possible problems, such as
  accidentally committing a generated Makefile.  There's a bunch of hacky
  copying to deal with the fact that autotools don't handle same-named files
  in different directories.  Julian plans to rename the files to avoid this
  problem.

- Various small Makefile.am things have been made more standard automake
  style, eg. the use of pkginclude/pkglib prefixes instead of rolling our
  own.

- The existing five top-level Makefile.am include files have been
  consolidated into three.

- Most Makefile.am files now are structured more clearly, with comment
  headers separating sections, declarations relating to the same things next
  to each other, better spacing and layout, etc.

- Removed the unused exp-ptrcheck/tests/x86 directory.

- Renamed some XML files.

- Factored out some duplicated dSYM handling code.

- Split auxprogs/ into auxprogs/ and mpi/, which allowed the resulting
  Makefile.am files to be much more standard.

- Cleaned up m_coredump by merging a bunch of files that had been
  overzealously separated.

The net result is 630 fewer lines of Makefile.am code, or 897 if you exclude
the added Makefile.vex.am, or 997 once the hacky file copying for Vex is
removed.  And the build system is much simpler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10364
2009-06-24 00:37:09 +00:00
Nicholas Nethercote
07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +00:00
Nicholas Nethercote
536e5133ef DARWIN sync: cachegrind filter change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9962
2009-05-19 06:00:04 +00:00
Nicholas Nethercote
32bd1a00c2 Merge r9610 (AM_CCASFLAGS tweaks for test Makefiles) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9611
2009-04-24 20:17:07 +00:00
Nicholas Nethercote
3b383dab10 Merged r9602 and r9603 (make cpuid pass on Darwin, rename .s files to .S)
from the DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9604
2009-04-24 07:12:39 +00:00
Nicholas Nethercote
d834611463 Merge r9600 (separate VG_ and ML_ definitions for C and asm files) from the
DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9601
2009-04-24 04:57:07 +00:00
Nicholas Nethercote
7b65c22fbc Some more test/build cleanups missed in prior commits.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9227
2009-02-23 01:18:06 +00:00
Nicholas Nethercote
a6448a3006 Test files were being passed multiple arch options (eg. "-m32 -m64") when
built.  This worked fine on the x86/Linux and AMD64/Linux but broke
ppc*/Linux.  This commit fixes the problem.  Thanks to Bart for spotting it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9222
2009-02-22 23:38:10 +00:00
Nicholas Nethercote
c8d150dbaa Various build system clean-ups and simplifications:
- Created Makefile.tool-tests.am, put standard AM_CFLAGS et al for tests in
  it.
- A number of tests are shared between Helgrind and DRD.  They used to be
  built in both directories.  Now they are only built in helgrind/tests/,
  and the DRD .vgtest files just point to the executable in helgrind/tests/.
  Most of these (about 30) had the source files in helgrind/tests/;  I moved
  the three that were in drd/tests/ into helgrind/tests/ for consistency.
- Fixed rwlock_test, which was failing to run due to a wrong name in the
  .vgtest file.
- Removed remnants of unused 'hello' test for Memcheck.
- Avoided redundant flag specification in various places, esp.
  memcheck/tests/Makefile.am.
- Removed unnecessary _AIX guards in some Linux-only tests.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9202
2009-02-19 09:52:05 +00:00
Josef Weidendorfer
3a5719678f Cachegrind/Callgrind: allow for cache sizes other than only powers of two
The number of sets, ie. number of cache lines divided by associativity,
and the cache line size still have to be powers of two.
This change is needed for default cache parameters used on some Intel
Core 2 and Atom processors.

Includes cachegrind manual update and explicit tests with 24KB D1/3MB L2
Reverts addition of 6MB warning to {cachegrind,callgrind}/tests/filter_stderr

Backporting to VALGRIND_3_4_BRANCH needs r8912

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9080
2009-01-26 22:56:14 +00:00
Nicholas Nethercote
ed322feb84 Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
  configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
  #defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
  in them.
- The ones that are in all-caps have a _CAPS suffix.

So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer.  The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.

cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities.  In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits.  Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones.  (This is partially merged from the DARWIN branch.)

configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.

valgrind.pc.in: try to make this more accurate.  I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031
2009-01-22 21:56:32 +00:00
Nicholas Nethercote
cace8b55cd - No longer using VG_ARCH_ALL to determine the DIST_SUBDIRS used for
arch/OS/platform-specific tool test dirs, instead writing it by hand.
  This is important because up until now if we had any arch-specific test
  dirs, we needed such dirs for all archs.  Now that we also have
  OS-specific and platform-specific test dirs, we don't want to have
  (mostly) empty dirs for every arch/OS/platform.

- Correspondingly, removed several empty directories under memcheck/tests/
  and cachegrind/tests that are no longer needed.

- Also removed VG_ARCH_ALL from configure.in.

- Also used an arch-specific guard rather than a platform-specific one where
  appropriate in cachegrind/tests/Makefile.am.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9017
2009-01-22 01:13:16 +00:00
Nicholas Nethercote
dafa3d1d8c trunk/memcheck/tests/Makefile.am
trunk/memcheck/tests/vcpu_bz2.c
trunk/memcheck/tests/vcpu_bz2.vgtest
    vcpu_bz2.c was (I think) an "svn copy" of perf/bz2.c.  Because it's a
    copy, the two can get out of sync, which was a problem with Greg
    Parker's Darwin patch.  So we remove vcpu_bz2.c, and make
    vcpu_bz2.vgtest invoke perf/bz2 directly.

trunk/cachegrind/tests/wrap5.c
trunk/cachegrind/tests/Makefile.am
trunk/cachegrind/tests/wrap5.vgtest
    wrap5.c was likewise an "svn copy" of memcheck/tests/wrap5.c, so we do
    the equivalent thing with it.

trunk/Makefile.am
    Fix a typo.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8919
2009-01-08 06:07:05 +00:00
Nicholas Nethercote
2916a0d98f callgrind/tests/filter_stderr
cachegrind/tests/filter_stderr
    Filter out an additional warning, so the tests pass on machines with a
    6MB L2 cache.

cachegrind/cg-x86.c
cachegrind/cg-amd64.c
    These two files were almost identical.  cg-amd64.c now just #includes
    cg-x86.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8912
2009-01-07 02:34:06 +00:00
Julian Seward
e16417ddf7 Add branch-misprediction profiling to Cachegrind. When the (new) flag
--branch-sim=yes is specified, Cachegrind simulates a simple indirect
branch predictor and a conditional branch predictor.  The latter
considers both the branch instruction's address and the behaviour of
the last few conditional branches.  Return stack prediction is not
modelled.

The new counted events are: conditional branches (Bc), mispredicted
conditional branches (Bcm), indirect branches (Bi) and mispredicted
indirect branches (Bim).  Postprocessing tools (cg_annotate, cg_merge)
handle the new events as you would expect.  Note that branch
simulation is not enabled by default as it gives a 20%-25% slowdown,
so you need to ask for it explicitly using --branch-sim=yes.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6733
2007-05-08 09:20:25 +00:00
Julian Seward
713b2d46c0 Merge r6086:
Makefile.am changes for AIX5.  Almost all boilerplate stuff fitting in
with the existing factorisation scheme.  The only change of interest
is that configure.in now generates automake symbols of name
VGP_platform and VGO_os, whereas previously it just made VG_platform
which was a bit inconsistent with the VGP/VGO/VGA scheme used in C
code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6242
2006-10-17 00:56:43 +00:00
Julian Seward
15519cf976 Test to check that cachegrind's BB_info management system isn't
confused by function wrapping.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5579
2006-01-22 01:08:40 +00:00
Julian Seward
dd3b4bf6f2 amd64-linux adjustments as a followup to r5493.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5494
2006-01-04 02:55:03 +00:00
Julian Seward
32f134b8c1 Somewhat rehash the biarch-build machinery so as to (1) formalise the
distinction between primary and secondary build targets, and (2) make
it independent of the default behaviour of gcc (iow, what gcc does
when you specify neither -m32 nor -m64).

As a result, an out-of-the-box build on ppc64-linux now builds a
system which is basically for 64-bit PowerPC, but also has the ability
to run 32-bit ppc-linux binaries (exactly the same arrangement as you
get when building on amd64-linux).

There are various twists and turns.  multiple-architectures.txt is
updated all the gory details.

This will break amd64 builds until such time as
<tool>/tests/{amd64,x86}/Makefile.am are fixed up (shortly).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5493
2006-01-04 01:20:28 +00:00
Nicholas Nethercote
fe3cc3bdf9 Change hp2ps to output .ps files in the same dir that the .hp input files
are in.  This fixes bug #117686.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5287
2005-12-05 20:45:59 +00:00
Julian Seward
f75620d58a Add directories missed in r5250 (ppc64 first checkin).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5251
2005-11-29 13:53:48 +00:00
Julian Seward
8ba9a34088 Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250
2005-11-29 13:05:56 +00:00
Nicholas Nethercote
bc6e62240e Change the cannot-detect-cache-config message on PPC32 so we can filter
for it more precisely and thus tell if the auto-detection ever fails on
x86/AMD64.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5173
2005-11-17 19:28:18 +00:00
Julian Seward
847c90dbfd Filter out I-have-no-idea-what-your-caches-are message, so these tests
don't fail on ppc32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5159
2005-11-17 10:56:08 +00:00
Tom Hughes
0d655cf263 Add -m32 for assembly code when possible.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5089
2005-11-11 14:57:12 +00:00
Tom Hughes
8cc5ae14db Allow 32 bit x86 tests to run on amd64 machines.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5087
2005-11-11 14:33:43 +00:00
Nicholas Nethercote
3035e5abee Cachegrind was aborting if it hit a client request. Now it doesn't.
This fixes #116057, I think.  I added a regtest so it won't regress again.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5072
2005-11-10 15:20:37 +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
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
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
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
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
Julian Seward
4b0b87e6fd cachegrind/tests/myprintf needs -fPIC on amd64
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3414
2005-03-23 13:11:14 +00:00
Nicholas Nethercote
ee117f37d1 Reinstated Cachegrind. Seems to be working ok -- numbers compare pretty
well with those for the CVS version... the I1 accesses are noticeably
higher, but everything else is nearly the same.

There's some ugliness in spots, partly due to shortcomings with Vex.  And
CPUID auto-detection is currently disabled, because cpuid is disabled in
general.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3389
2005-03-20 00:20:06 +00:00
Julian Seward
7c542ccd39 Add new files resulting from merging in the 2.4.0 line. Many of these
seem to be simply duplication of the x86 instruction set tests into
the addrcheck and helgrind trees.  I'm not sure what this duplication
achieves.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3264
2005-03-10 23:23:45 +00:00
Nicholas Nethercote
10b4595add Added beginnings of an AMD64 port, so lots of new files and directories.
It compiles, but aborts immediately if you try to run it.

I didn't include ldt.c;  I'm not sure how the LDT is used on AMD64.  It can be
added later if necessary.

While doing this, did some 64-bit cleanness fixes:
- Added necessary intermediate casts to ULong to avoid warnings when converting
  ThreadId to void* and vice versa, in vg_scheduler.c.
- Fixed VALGRIND_NON_SIMD_CALL[0123] to use 'long' as the return type.
- Fixed VALGRIND_PRINTF{,BACKTRACE} to use unsigned longs instead of unsigned
  ints, as needed.
- Converted some offsets in vg_symtab2.h from "Int" to "OffT".
- Made strlen, strncat, etc, use SizeT instead of 'unsigned int' for the length
  parameter.
- Couple of other minor things.

I had to insert some "#ifdef __amd64__" and "#ifndef __amd64__" guards in
places.  In particular, in vg_mylibc.c, some of our syscall wrappers aren't
appropriate for AMD64 because the syscall numbering is a bit different in
places.  This difference will have to be abstracted out somehow.

Also rewrote the sys_fcntl and sys_fcntl64 wrappers, as required for AMD64.

Also moved the ipc wrapper into x86, since it's not applicable for
AMD64.  However, it is applicable (I think) for ARM, so it would be nice
to work out a way to share syscall wrappers between some, but not all,
archs.  Hmm.  Also now using the real IPC constants rather than magic
numbers in the wrapper.

Other non-AMD64-related fixes:
- ARM: fixed syscall table by accounting for the fact that syscall
  numbers don't start at 0, but rather at 0x900000.
- Converted a few places to use ThreadId instead of 'int' or 'Int' for
  thread IDs.
- Added both AMD64 and ARM (which I'd forgotten) entries to valgrind.spec.in.
- Tweaked comments in various places.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3136
2004-11-29 13:54:10 +00:00