128 Commits

Author SHA1 Message Date
Julian Seward
669d87bcc1 Support sys_readahead on Linux.
(Sean Bartell, wingedtachikoma@gmail.com)  Fixes #247894.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11394
2010-10-04 20:03:27 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Tom Hughes
2a70cf0b01 Add support for the getcpu system call on x86, ppc32 and ppc64. There
is no support for amd64 because there is no getcpu system call on that
platform - it is always done as a vsyscall in user space.

Based on patch from Aleksander Salwa. Closes #223758.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11054
2010-02-23 10:02:55 +00:00
Julian Seward
e6c318c531 When creating a child thread, initially set its os_state.threadgroup
to have the same value as the parent.  This avoids exit races leading
to hangs and strange behaviour in heavily multithreaded apps, in the
situation where threads are rapidly being created, and at the same
time an existing thread does sys_exit_group so as to terminate the
entire process.  Thanks to Konstantin S for chasing this down to a
small test case.  Fixes #226116.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11053
2010-02-22 11:03:10 +00:00
Julian Seward
6a9a4015c7 Various minor fixups to make ppc32/64-linux work again following
recent ARM-Linux merge.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10992
2010-01-02 13:24:58 +00:00
Tom Hughes
3174f947e2 Add support for accept4 system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10955
2009-11-25 12:05:41 +00:00
Tom Hughes
25a99cd1eb Wire up vhangup system call on amd64/ppc32/ppc64 linux platforms.
Patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10954
2009-11-25 11:54:56 +00:00
Tom Hughes
8d4c124ebb Add support for fallocate system call on 32 bit (x86/ppc32) linux
systems based on patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10953
2009-11-25 11:51:05 +00:00
Tom Hughes
27f8eb0f4a Clean up support for sync_file_range system call and add second version used
by ppc platforms based on patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10952
2009-11-25 11:29:14 +00:00
Tom Hughes
e46ec05df6 Re-enable old support for adjtimex system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10948
2009-11-24 16:38:21 +00:00
Tom Hughes
40fa55a53b Add support for rt_tgsigqueueinfo system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10947
2009-11-24 16:08:40 +00:00
Tom Hughes
0d0f835353 Add support for sched_rr_get_interval system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10946
2009-11-24 16:03:19 +00:00
Tom Hughes
128df057cb Handle the dup3 system call. Closes #215448.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10945
2009-11-23 08:19:20 +00:00
Bart Van Assche
c8d8e1fd86 Compiles again -- added trailing comma's that were missing from r10907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10919
2009-10-29 09:01:39 +00:00
Tom Hughes
33d5189e1a Add support for preadv and pwritev. Fixes #212149.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10914
2009-10-28 10:04:11 +00:00
Tom Hughes
65a7de3e74 Wire up inotify_init1 on ppc32-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10912
2009-10-27 21:42:46 +00:00
Tom Hughes
141ec942a1 Add support for the perf_counter_open system call. Fixes #211498.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10907
2009-10-27 09:19:26 +00:00
Tom Hughes
d32144bb8d Update linux system calls lists to match 2.6.31.5 kernel.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10906
2009-10-27 09:01:43 +00:00
Julian Seward
e7dde85a24 Merge coregrind/ changes from branches/MESSAGING_TIDYUP r10464.
This commit tidies up and rationalises what could be called the
"messaging" system -- that part of V to do with presenting output to
the user.  In particular it brings significant improvements to XML
output.

Changes are:

* XML and normal text output now have separate file descriptors,
  which solves longstanding problems for XML consumers caused by
  the XML output getting polluted by unexpected non-XML output.

* This also means that we no longer have to hardwire all manner
  of output settings (verbosity, etc) when XML is requested.

* The XML output format has been revised, cleaned up, and made
  more suitable for use by error detecting tools in general
  (various Memcheck-specific features have been removed).  XML
  output is enabled for Ptrcheck and Helgrind, and Memcheck is
  updated to the new format.

* One side effect is that the behaviour of VG_(message) has been
  made to be consistent with printf: it no longer automatically
  adds a newline at the end of the output.  This means multiple
  calls to it can be used to build up a single line message; or a
  single call can write a multi-line message.  The ==pid==
  preamble is automatically inserted at each newline.

* VG_(message)(Vg_UserMsg, ..args..) now has the abbreviated form
  VG_(UMSG)(..args..); ditto VG_(DMSG) for Vg_DebugMsg and
  VG_(EMSG) for Vg_DebugExtraMsg.  A couple of other useful
  printf derivatives have been added to pub_tool_libcprint.h,
  most particularly VG_(vcbprintf).

* There's a small change in the core-tool interface to do with
  error handling: VG_(needs_tool_errors) has a new method
  void (*before_pp_Error)(Error* err)  which, if non-NULL, is
  called just before  void (*pp_Error)(Error* err).  This is to
  give tools the chance to look at errors before any part of them
  is printed, so they can print any XML preamble they like.

* coregrind/m_errormgr.c has been overhauled and cleaned up, and
  is a bit simpler and more commented.  In particular pp_Error
  and VG_(maybe_record_error) are significantly changed.

The diff is huge, but mostly very boring.  Most of the changes
are of the form

-   VG_(message)(Vg_UserMsg, "this is a message %d", n);
+   VG_(message)(Vg_UserMsg, "this is a message %d\n", n);

Unfortunately as a result of this, it touches a large number
of source files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10465
2009-07-15 14:48:32 +00:00
Nicholas Nethercote
f00335141b Handle fallocate() on 64-bit platforms. Fixes bug 185794.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10456
2009-07-15 03:08:35 +00:00
Nicholas Nethercote
400b917577 Handle epoll_create1. Patch from Sam Varshavchik. Fixes bug 188427.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10427
2009-07-10 12:02:03 +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
7b2a259bea DARWIN sync: pread64 and pwrite64 wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9971
2009-05-19 06:50:37 +00:00
Nicholas Nethercote
131ab00744 Merged non-Darwin-specific parts of r9397,r9423,r9490, 9461, 9462 from the
DARWIN branch.  A big ugly DARWIN/trunk sync commit, mostly to do with
changing the representation of SysRes and vki_sigset_t.  Functionality of
the trunk shouldn't be changed by it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9876
2009-05-18 02:12:08 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
87b5e49494 Merge a large chunk of r8949 (the part that moved fcntl and ioctl wrappers
out of syswrap-generic into syswrap-linux) from the DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9219
2009-02-22 23:00:30 +00:00
Nicholas Nethercote
3bfae3eec1 Merged r9185 (fix up getsockopt mess) from the DARWIN branch, minus the
Darwin-specific parts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9186
2009-02-17 00:23:30 +00:00
Tom Hughes
f1ac1fd992 Add signalfd4 support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8930
2009-01-09 16:42:51 +00:00
Tom Hughes
2ebda825b1 Add support ioprio_get and wire up ioprio_set on all platforms.
Fixes bug #177819.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8826
2008-12-15 08:58:29 +00:00
Tom Hughes
4d4d4c10fe Add support for eventfd2 (and wire up pipe2 on PPC platforms).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8815
2008-12-10 09:28:56 +00:00
Julian Seward
e3cccbaf9a Fix integer-pointer comparisons in new spu_ wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8735
2008-11-06 09:22:50 +00:00
Julian Seward
af77aae9cd Support sys_spu_run and sys_spu_create on ppc32-linux. Patch by
Kenneth Skovhede.  Fixes #167288.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8731
2008-11-05 11:36:59 +00:00
Bart Van Assche
86ff87c102 Enabled capget and capset system calls for amd64, ppc32 and ppc64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8554
2008-08-27 17:41:56 +00:00
Julian Seward
832a3d400b Tidy up the wrappers for pread64 and pwrite64, and make these two
syscalls available on ppc64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8519
2008-08-07 20:29:55 +00:00
Bart Van Assche
783f123bab Enabled support for the sched_setparam() system call on the amd64, ppc32 and ppc64 platforms (was already enabled on x86).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8405
2008-07-09 07:39:09 +00:00
Bart Van Assche
8e96150945 Merged FORMATCHECK branch (r8368) to trunk.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369
2008-07-07 06:49:24 +00:00
Bart Van Assche
bd28f145d5 Moved support for Linux-specific system call sys_init_module from generic to Linux wrappers. Added wrapper for sys_delete_module system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8266
2008-06-21 16:28:24 +00:00
Bart Van Assche
7d072b3b4a Enabled timerfd() and timerfd_create() support for ppc32 and ppc64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8051
2008-05-12 18:16:14 +00:00
Julian Seward
3c25a48a0c Temporarily work around compilation failures caused by non-definition
of __NR_timerfd, pending proper resolution.  See
http://bugs.kde.org/show_bug.cgi?id=160907



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7983
2008-05-01 21:22:38 +00:00
Julian Seward
4cae5c3ed5 Merge branches/OTRACK_BY_INSTRUMENTATION into the trunk. This adds
support to Memcheck for tracking the origin of uninitialised values,
if you use the --track-origins=yes flag.

This currently causes some Memcheck regression tests to fail, because
they now print an extra line of advisory text in their output.  This
will be fixed.

The core-tool interface is slightly changed.  The version number for
the interface needs to be incremented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7982
2008-05-01 20:24:26 +00:00
Bart Van Assche
c6d4c09e7c Added support for timerfd_create(), timerfd_gettime() and timerfd_settime() system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7942
2008-04-27 12:56:06 +00:00
Bart Van Assche
46fd0e3040 Enabled syslog and create_module system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7920
2008-04-26 10:57:07 +00:00
Bart Van Assche
e31611fb5c Added support for epoll_pwait(), utimensat(), eventfd(), timerfd() and signalfd(). Fixes bug 160907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7917
2008-04-26 07:45:10 +00:00
Tom Hughes
34d1e3b268 Always call ML_(generic_POST_sys_shmat) when a shmat call succeeds, even
if the memory was attached at address zero. Fixes bug #157665.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7399
2008-02-11 14:47:05 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Julian Seward
7cebb7d626 Include headers for VG_(register_stack) calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7396
2008-02-11 11:23:12 +00:00
Tom Hughes
2e55cfac69 Make the clone system call wrappers call VG_(register_stack) to record
the new thread's stack, then make the stack unwinder use that information
to make a better guess at the stack bounds.

This helps avoid crashes trying to unwind the stack under wine when
the starting point is a routine without a proper stack frame.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7383
2008-02-08 15:17:07 +00:00
Julian Seward
15295992a0 Handle sys_getitimer on ppc32-linux and ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7193
2007-11-20 19:59:51 +00:00
Julian Seward
06666933d9 Merge (from branches/THRCHECK) the following two changes to the core-tool
interface:

r6805: Modify two thread-notification events in the core-tool
interface.  This removes track_post_thread_create and
track_post_thread_join.  The core can only see low level thread
creation and exiting, and has no idea about pthread-level concepts
like "pthread_create" and "pthread_join", so these are a bit
ambiguous.

Replace them with track_pre_thread_ll_create, which is notified before
a new thread makes any memory references, and
track_pre_thread_ll_exit, which is notified just before the new thread
exits, that is, after it has made its last memory reference.

r6823: Core-tool interface: give 'needs_tool_errors' an extra Boolean
indicating whether or not the core should print thread id's on error
messages.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7123
2007-11-09 23:21:44 +00:00
Nicholas Nethercote
802b418634 Fix some copyright notices:
- extend some to 2007
- use njn@valgrind.org instead of njn25@cam.ac.uk
- use "tool" instead of "skin"


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6703
2007-04-15 22:15:57 +00:00