You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(17) |
2
(15) |
3
(36) |
4
(24) |
5
(36) |
|
6
(18) |
7
(16) |
8
(18) |
9
(19) |
10
(18) |
11
(37) |
12
(18) |
|
13
(13) |
14
(21) |
15
(27) |
16
(10) |
17
(16) |
18
(25) |
19
(21) |
|
20
(11) |
21
(14) |
22
(6) |
23
(15) |
24
(27) |
25
(3) |
26
(9) |
|
27
(16) |
28
(24) |
29
(21) |
30
(43) |
31
(42) |
|
|
|
From: Tom H. <th...@cy...> - 2005-03-31 10:36:48
|
Nightly build on honda ( x86_64, Fedora Core 3 ) started at 2005-03-31 11:33:20 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 87 stderr failures, 24 stdout failures ================= memcheck/tests/addressable (stdout) memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stdout) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stdout) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stdout) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stdout) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stdout) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stdout) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stdout) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stdout) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/metadata (stdout) memcheck/tests/metadata (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/new_override (stdout) memcheck/tests/new_override (stderr) memcheck/tests/overlap (stdout) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stdout) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_exit_group (stderr) memcheck/tests/scalar_fork (stderr) memcheck/tests/scalar_supp (stderr) memcheck/tests/scalar_vfork (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stdout) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/threadederrno (stdout) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stdout) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stdout) addrcheck/tests/addressable (stdout) addrcheck/tests/addressable (stderr) addrcheck/tests/badrw (stderr) addrcheck/tests/fprw (stderr) addrcheck/tests/leak-0 (stderr) addrcheck/tests/leak-cycle (stderr) addrcheck/tests/leak-regroot (stderr) addrcheck/tests/leak-tree (stderr) addrcheck/tests/overlap (stdout) addrcheck/tests/overlap (stderr) addrcheck/tests/toobig-allocs (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) corecheck/tests/res_search (stdout) corecheck/tests/res_search (stderr) massif/tests/toobig-allocs (stderr) none/tests/blockfault (stderr) none/tests/faultstatus (stderr) none/tests/resolv (stdout) none/tests/resolv (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: Julian S. <js...@ac...> - 2005-03-31 10:32:47
|
This strikes me as a bit like the kernel-headers issue. Although 1 and
2 are attractive from the amount-of-work point of view, the only sane way
to decouple ourselves from the assumptions/difficulties of pre-supplied
kernel headers on random distros Mutant-Linux (etc) was to ship our own.
And so it will be here. Using glibc brings two problems:
* We then have to figure out all the bad ways glibc and valgrind
can interact, be sure we've discovered them all, implement workarounds
for them all, ensure those workarounds don't give rise to more
such problems, and ensure those workarounds don't mess up
maintainability too much.
* What happens on platforms where there is no glibc? MacOSX
and the BSDs? Solaris?
> Currently we use glibc in a number of modules: vg_main.c, ume.c, stage1.c,
> vg_stabs.c, vg_symtab2.c, $PLATFORM/core_platform.h, $ARCH/state.c,
> vg_pthreadmodel.c, vg_skiplist.c.
It's worth distinguishing between "uses an external header" and
"uses glibc-supplied functions". The first is not such a big
deal (eg, #include <elf.h>). The second is more of a problem.
I had a go at enumerating what we are using in the files Nick
mentioned. Nick, are you sure you found all files using libc
stuff? Anyway:
vg_skiplist: random -- trivially replaced
vg_pthreadmodel: pthread.h, for pthread types
-- seems unavoidable if we want to do pthread modelling
x86/state.c: ptrace, in ptrace_setregs_from_tst
-- not sure what this is for; it does not look to me like
"primary functionality" though
x86-linux/core_platform.h: setjmp.h (setjmp, longjmp, jmp_buf)
-- we need a setjmp/longjmp facility. 1.0.X used GCC's
__builtin_setjmp/__builtin_longjmp to avoid this
dependency; am surprised it is back.
vg_symtab2.c: elf.h, for ELF types/structs/consts, no fns
-- seems fairly harmless, conceivably we could copy the headers
if need be
vg_stabs.c: a.out.h, for stabs types/structs/consts, no fns
-- ditto
stage1.c: not sure this is a problem
-- stage1 can use what it likes since stage2 completely
gets rid of it at startup.
vg_ume.c:
fprintf exit open perror read close sscanf strchr malloc
assert pread strerror memcmp memset free mmap strdup printf
geteuid getegid getgroups stderr errno
These all look like stuff we either do supply ourselves or
could easily do
vg_main.c:
fork ptrace kill fprintf mmap munmap snprintf fstat malloc
read close getenv printf strlen memcmp free access strdup strchr
opendir strerror readdir strncmp closedir dlopen dlerror dlsym
dlclose abort
Apart from ptrace (what's that for? is it essential) the
dl* functions are the only worrying ones.
Most of the glibc functions we use, we already have or can easily
supply. The only stuff which is worrying is:
setjmp / longjmp
dlopen/dlsym/dlclose
ptrace, possibly
Assuming ptrace is fairly harmless (wrapper round the syscall) then
the real worriers are dlopen/dlsym/dlclose and possibly setjmp/longjmp.
J
|
|
From: <sv...@va...> - 2005-03-31 10:20:04
|
Author: tom
Date: 2005-03-31 11:19:59 +0100 (Thu, 31 Mar 2005)
New Revision: 3491
Modified:
trunk/nightly/bin/nightly
Log:
Rework the nightly build script to stop as soon as one of the build
steps fails instead of carrying on with the other steps - this should
help ensure that the log fragment sent out contains useful information.
A second change is to ensure that if the regression tests complete
then the full results are included in the email - if they don't
complete then just the last 20 lines of output are sent as before.
Modified: trunk/nightly/bin/nightly
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/nightly/bin/nightly 2005-03-31 09:09:07 UTC (rev 3490)
+++ trunk/nightly/bin/nightly 2005-03-31 10:19:59 UTC (rev 3491)
@@ -4,6 +4,22 @@
# Use: two args, first is path to top of ValgrindABT tree
# second is name of machine
=20
+runcmd () {
+ echo -n " $1 ... " >> log.short
+ shift
+
+ (eval "$*") >> log.verbose 2>&1
+
+ if [ $? =3D=3D 0 ]
+ then
+ echo "done" >> log.short
+ return 0
+ else
+ echo "failed" >> log.short
+ return 1
+ fi
+}
+
ABT_TOP=3D$1
ABT_MACHINE=3D$2
=20
@@ -24,35 +40,35 @@
echo "Nightly build on" $ABT_MACHINE "(" $ABT_DETAILS ") started at" $AB=
T_START >> log.verbose
echo >> log.verbose
=20
-echo -n " Checking out vex source tree ... " >> log.short
-svn co svn://svn.valgrind.org/vex/trunk vex 2>&1 >> log.verbose
-echo "done" >> log.short
+runcmd "Checking out vex source tree " \
+ "svn co svn://svn.valgrind.org/vex/trunk vex" && \
+\
+runcmd "Building vex " \
+ "cd vex && pwd && make clean version all" && \
+\
+runcmd "Checking out valgrind source tree" \
+ "svn co svn://svn.valgrind.org/valgrind/trunk valgrind" && \
+\
+runcmd "Configuring valgrind " \
+ "cd valgrind && ./autogen.sh && ./configure --prefix=3D$ABT_TOP/=
Inst --with-vex=3D$ABT_TOP/vex" && \
+\
+runcmd "Building valgrind " \
+ "cd valgrind && make install" && \
+\
+runcmd "Running regression tests " \
+ "cd valgrind && make regtest"
=20
-echo -n " Building vex ... " >> log.short
-(cd vex && make clean version all 2>&1 ) >> log.verbose
-echo "done" >> log.short
+egrep -q '^=3D=3D [0-9]+ tests' log.verbose && (
+ echo >> log.short
+ echo "Regression test results follow" >> log.short
+ echo >> log.short
+ awk '/^=3D=3D [0-9]+ tests/, /^$/ { print }' log.verbose >> log.short
+) || (
+ echo >> log.short
+ echo "Last 20 lines of log.verbose follow" >> log.short
+ echo >> log.short
+ tail -20 log.verbose >> log.short
+)
=20
-echo -n " Checking out valgrind source tree ... " >> log.short
-svn co svn://svn.valgrind.org/valgrind/trunk valgrind 2>&1 >> log.verbos=
e
-echo "done" >> log.short
-
-echo -n " Configuring valgrind ... " >> log.short
-(cd valgrind && ./autogen.sh 2>&1 && ./configure --prefix=3D`pwd`/Inst =
--with-vex=3D`pwd`/../vex 2>&1 ) >> log.verbose
-echo "done" >> log.short
-
-echo -n " Building valgrind ... " >> log.short
-(cd valgrind && make install 2>&1 ) >> log.verbose
-echo "done" >> log.short
-
-echo -n " Running regression tests ... " >> log.short
-(cd valgrind && make regtest 2>&1 ) >> log.verbose
-echo "done" >> log.short
-
-echo >> log.short
-echo "Last 20 lines of log.verbose follow" >> log.short
-echo >> log.short
-tail -20 log.verbose >> log.short
-
$ABT_TOP/conf/$ABT_MACHINE.sendmail "$ABT_START nightly build ($ABT_MACH=
INE, $ABT_DETAILS)" \
$ABT_TOP/log.short
-
|
|
From: <sv...@va...> - 2005-03-31 09:09:10
|
Author: tom
Date: 2005-03-31 10:09:07 +0100 (Thu, 31 Mar 2005)
New Revision: 3490
Modified:
trunk/coregrind/vg_syscalls.c
trunk/coregrind/x86-linux/syscalls.c
Log:
Implement the gettid system call which seems to have got lost in the merg=
e.
Modified: trunk/coregrind/vg_syscalls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_syscalls.c 2005-03-31 07:59:35 UTC (rev 3489)
+++ trunk/coregrind/vg_syscalls.c 2005-03-31 09:09:07 UTC (rev 3490)
@@ -2956,6 +2956,12 @@
RES =3D 1;
}
=20
+PRE(sys_gettid, 0)
+{
+ PRINT("sys_gettid ()");
+ PRE_REG_READ0(long, "gettid");
+}
+
static void common_post_getrlimit(ThreadId tid, UWord a1, UWord a2)
{
POST_MEM_WRITE( a2, sizeof(struct vki_rlimit) );
Modified: trunk/coregrind/x86-linux/syscalls.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/x86-linux/syscalls.c 2005-03-31 07:59:35 UTC (rev 348=
9)
+++ trunk/coregrind/x86-linux/syscalls.c 2005-03-31 09:09:07 UTC (rev 349=
0)
@@ -1246,7 +1246,7 @@
GENXY(__NR_fcntl64, sys_fcntl64), // 221
GENX_(222, sys_ni_syscall), // 222
GENX_(223, sys_ni_syscall), // 223
- // (__NR_gettid, sys_gettid), // 224 */Linux
+ GENX_(__NR_gettid, sys_gettid), // 224 */Linux
=20
// (__NR_readahead, sys_readahead), // 225 */(Linux?)
GENX_(__NR_setxattr, sys_setxattr), // 226
|
|
From: Tom H. <to...@co...> - 2005-03-31 09:08:39
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> I presume you'll have an updated patch after a bit more iteration?
I've got an updated patch now - it's getting a bit large so I've
gzipped it and put it on the web at:
http://www.compton.nu/kal.patch.gz
It builds on x86 and amd64. There is still work to be done removing
the vki structures from the kal interface but the error handling is
there and the stub routines in mylibc have been removed.
I had to move the tool header file to the main includes directory
so the tools could see it.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-03-31 07:59:56
|
Author: tom
Date: 2005-03-31 08:59:35 +0100 (Thu, 31 Mar 2005)
New Revision: 3489
Modified:
trunk/helgrind/hg_main.c
Log:
Update helgrind to use the new mechanism to declare it's interface
routines to the core so that it will at least build.
Modified: trunk/helgrind/hg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/helgrind/hg_main.c 2005-03-31 04:52:26 UTC (rev 3488)
+++ trunk/helgrind/hg_main.c 2005-03-31 07:59:35 UTC (rev 3489)
@@ -1802,10 +1802,7 @@
static Int freechunkptr =3D 0;
static HG_Chunk *freechunks[N_FREED_CHUNKS];
=20
-/* Use a small redzone (paranoia) */
-SizeT VG_(vg_malloc_redzone_szB) =3D 8;
=20
-
/* Allocate a user-chunk of size bytes. Also allocate its shadow
block, make the shadow block point at the user block. Put the
shadow chunk on the appropriate list, and set all memory
@@ -3281,13 +3278,37 @@
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(details_avg_translation_sizeB) ( 115 );
=20
- VG_(needs_core_errors)();
- VG_(needs_tool_errors)();
- VG_(needs_data_syms)();
- VG_(needs_client_requests)();
- VG_(needs_command_line_options)();
- VG_(needs_shadow_memory)();
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
=20
+ VG_(needs_core_errors) ();
+ VG_(needs_tool_errors) (TL_(eq_Error),
+ TL_(pp_Error),
+ TL_(update_extra),
+ TL_(recognised_suppression),
+ TL_(read_extra_suppression_info),
+ TL_(error_matches_suppression),
+ TL_(get_error_name),
+ TL_(print_extra_suppression_info));
+ VG_(needs_data_syms) ();
+ VG_(needs_client_requests) (TL_(handle_client_request));
+ VG_(needs_command_line_options)(TL_(process_cmd_line_option),
+ TL_(print_usage),
+ TL_(print_debug_usage));
+ VG_(needs_shadow_memory) ();
+
+ VG_(malloc_funcs) (TL_(malloc),
+ TL_(__builtin_new),
+ TL_(__builtin_vec_new),
+ TL_(memalign),
+ TL_(calloc),
+ TL_(free),
+ TL_(__builtin_delete),
+ TL_(__builtin_vec_delete),
+ TL_(realloc),
+ 8 );
+
VG_(init_new_mem_startup) (& eraser_new_mem_startup);
=20
/* stack ones not decided until VG_(post_clo_init)() */
|
|
From: <sv...@va...> - 2005-03-31 04:52:52
|
Author: njn
Date: 2005-03-31 05:52:26 +0100 (Thu, 31 Mar 2005)
New Revision: 3488
Modified:
trunk/coregrind/core.h
trunk/coregrind/gen_toolint.pl
trunk/coregrind/vg_needs.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_translate.c
Log:
Rename VG_(tool_interface), which is overly general and a bit verbose, as
VG_(tdict). Also make the typing more meaningful in vg_mallocfuncs_info.
And (barely) start removing the use of "TL_" names in the core.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/core.h 2005-03-31 04:52:26 UTC (rev 3488)
@@ -481,17 +481,17 @@
=20
struct vg_mallocfunc_info {
/* things vg_replace_malloc.o needs to know about */
- Addr tl_malloc;
- Addr tl_calloc;
- Addr tl_realloc;
- Addr tl_memalign;
- Addr tl___builtin_new;
- Addr tl___builtin_vec_new;
- Addr tl_free;
- Addr tl___builtin_delete;
- Addr tl___builtin_vec_delete;
+ void* (*tl_malloc) (ThreadId tid, SizeT n);
+ void* (*tl___builtin_new) (ThreadId tid, SizeT n);
+ void* (*tl___builtin_vec_new) (ThreadId tid, SizeT n);
+ void* (*tl_memalign) (ThreadId tid, SizeT align, SizeT n);
+ void* (*tl_calloc) (ThreadId tid, SizeT nmemb, SizeT n);
+ void (*tl_free) (ThreadId tid, void* p);
+ void (*tl___builtin_delete) (ThreadId tid, void* p);
+ void (*tl___builtin_vec_delete)(ThreadId tid, void* p);
+ void* (*tl_realloc) (ThreadId tid, void* p, SizeT size);
=20
- Addr arena_payload_szB;
+ SizeT (*arena_payload_szB) (ArenaId aid, void* payload);
=20
Bool clo_sloppy_malloc;
Bool clo_trace_malloc;
Modified: trunk/coregrind/gen_toolint.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/gen_toolint.pl 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/gen_toolint.pl 2005-03-31 04:52:26 UTC (rev 3488)
@@ -34,7 +34,7 @@
my $post;
my $generate;
=20
-my $struct =3D "VG_(tool_interface)";
+my $struct =3D "VG_(tdict)";
=20
my %pfxmap =3D ("track" =3D> "TL_",
"tool" =3D> "TL_",
Modified: trunk/coregrind/vg_needs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_needs.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_needs.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -45,9 +45,9 @@
void(*fini)(Int)
)
{
- VG_(tool_interface).tool_post_clo_init =3D post_clo_init;
- VG_(tool_interface).tool_instrument =3D instrument;
- VG_(tool_interface).tool_fini =3D fini;
+ VG_(tdict).tool_post_clo_init =3D post_clo_init;
+ VG_(tdict).tool_instrument =3D instrument;
+ VG_(tdict).tool_fini =3D fini;
}
=20
/*--------------------------------------------------------------------*/
@@ -167,7 +167,7 @@
)
{
VG_(needs).basic_block_discards =3D True;
- VG_(tool_interface).tool_discard_basic_block_info =3D discard;
+ VG_(tdict).tool_discard_basic_block_info =3D discard;
}
=20
void VG_(needs_tool_errors)(
@@ -182,14 +182,14 @@
)
{
VG_(needs).tool_errors =3D True;
- VG_(tool_interface).tool_eq_Error =3D eq;
- VG_(tool_interface).tool_pp_Error =3D pp;
- VG_(tool_interface).tool_update_extra =3D update;
- VG_(tool_interface).tool_recognised_suppression =3D recog;
- VG_(tool_interface).tool_read_extra_suppression_info =3D read_extra;
- VG_(tool_interface).tool_error_matches_suppression =3D matches;
- VG_(tool_interface).tool_get_error_name =3D name;
- VG_(tool_interface).tool_print_extra_suppression_info =3D print_extra=
;
+ VG_(tdict).tool_eq_Error =3D eq;
+ VG_(tdict).tool_pp_Error =3D pp;
+ VG_(tdict).tool_update_extra =3D update;
+ VG_(tdict).tool_recognised_suppression =3D recog;
+ VG_(tdict).tool_read_extra_suppression_info =3D read_extra;
+ VG_(tdict).tool_error_matches_suppression =3D matches;
+ VG_(tdict).tool_get_error_name =3D name;
+ VG_(tdict).tool_print_extra_suppression_info =3D print_extra;
}
=20
void VG_(needs_command_line_options)(
@@ -199,9 +199,9 @@
)
{
VG_(needs).command_line_options =3D True;
- VG_(tool_interface).tool_process_cmd_line_option =3D process;
- VG_(tool_interface).tool_print_usage =3D usage;
- VG_(tool_interface).tool_print_debug_usage =3D debug_usage;
+ VG_(tdict).tool_process_cmd_line_option =3D process;
+ VG_(tdict).tool_print_usage =3D usage;
+ VG_(tdict).tool_print_debug_usage =3D debug_usage;
}
=20
void VG_(needs_client_requests)(
@@ -209,7 +209,7 @@
)
{
VG_(needs).client_requests =3D True;
- VG_(tool_interface).tool_handle_client_request =3D handle;
+ VG_(tdict).tool_handle_client_request =3D handle;
}
=20
void VG_(needs_syscall_wrapper)(
@@ -218,8 +218,8 @@
)
{
VG_(needs).syscall_wrapper =3D True;
- VG_(tool_interface).tool_pre_syscall =3D pre;
- VG_(tool_interface).tool_post_syscall =3D post;
+ VG_(tdict).tool_pre_syscall =3D pre;
+ VG_(tdict).tool_post_syscall =3D post;
}
=20
void VG_(needs_sanity_checks)(
@@ -228,8 +228,8 @@
)
{
VG_(needs).sanity_checks =3D True;
- VG_(tool_interface).tool_cheap_sanity_check =3D cheap;
- VG_(tool_interface).tool_expensive_sanity_check =3D expen;
+ VG_(tdict).tool_cheap_sanity_check =3D cheap;
+ VG_(tdict).tool_expensive_sanity_check =3D expen;
}
=20
=20
@@ -248,15 +248,15 @@
SizeT client_malloc_redzone_szB
)
{
- VG_(tool_interface).malloc_malloc =3D malloc;
- VG_(tool_interface).malloc___builtin_new =3D __builtin_new;
- VG_(tool_interface).malloc___builtin_vec_new =3D __builtin_vec_new=
;
- VG_(tool_interface).malloc_memalign =3D memalign;
- VG_(tool_interface).malloc_calloc =3D calloc;
- VG_(tool_interface).malloc_free =3D free;
- VG_(tool_interface).malloc___builtin_delete =3D __builtin_delete;
- VG_(tool_interface).malloc___builtin_vec_delete =3D __builtin_vec_del=
ete;
- VG_(tool_interface).malloc_realloc =3D realloc;
+ VG_(tdict).malloc_malloc =3D malloc;
+ VG_(tdict).malloc___builtin_new =3D __builtin_new;
+ VG_(tdict).malloc___builtin_vec_new =3D __builtin_vec_new;
+ VG_(tdict).malloc_memalign =3D memalign;
+ VG_(tdict).malloc_calloc =3D calloc;
+ VG_(tdict).malloc_free =3D free;
+ VG_(tdict).malloc___builtin_delete =3D __builtin_delete;
+ VG_(tdict).malloc___builtin_vec_delete =3D __builtin_vec_delete;
+ VG_(tdict).malloc_realloc =3D realloc;
=20
VG_(set_client_malloc_redzone_szB)( client_malloc_redzone_szB );
}
Modified: trunk/coregrind/vg_scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_scheduler.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_scheduler.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -1026,17 +1026,17 @@
case VG_USERREQ__GET_MALLOCFUNCS: {
struct vg_mallocfunc_info *info =3D (struct vg_mallocfunc_info *)arg[1=
];
=20
- info->tl_malloc =3D (Addr)TL_(malloc);
- info->tl_calloc =3D (Addr)TL_(calloc);
- info->tl_realloc =3D (Addr)TL_(realloc);
- info->tl_memalign =3D (Addr)TL_(memalign);
- info->tl___builtin_new =3D (Addr)TL_(__builtin_new);
- info->tl___builtin_vec_new =3D (Addr)TL_(__builtin_vec_new);
- info->tl_free =3D (Addr)TL_(free);
- info->tl___builtin_delete =3D (Addr)TL_(__builtin_delete);
- info->tl___builtin_vec_delete =3D (Addr)TL_(__builtin_vec_delete);
+ info->tl_malloc =3D VG_(tdict).malloc_malloc;
+ info->tl_calloc =3D VG_(tdict).malloc_calloc;
+ info->tl_realloc =3D VG_(tdict).malloc_realloc;
+ info->tl_memalign =3D VG_(tdict).malloc_memalign;
+ info->tl___builtin_new =3D VG_(tdict).malloc___builtin_new;
+ info->tl___builtin_vec_new =3D VG_(tdict).malloc___builtin_vec_new;
+ info->tl_free =3D VG_(tdict).malloc_free;
+ info->tl___builtin_delete =3D VG_(tdict).malloc___builtin_delete;
+ info->tl___builtin_vec_delete =3D VG_(tdict).malloc___builtin_vec_dele=
te;
=20
- info->arena_payload_szB =3D (Addr)VG_(arena_payload_szB);
+ info->arena_payload_szB =3D VG_(arena_payload_szB);
=20
info->clo_sloppy_malloc =3D VG_(clo_sloppy_malloc);
info->clo_trace_malloc =3D VG_(clo_trace_malloc);
Modified: trunk/coregrind/vg_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_translate.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_translate.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -100,8 +100,7 @@
dcall =3D unsafeIRDirty_0_N( =
\
1/*regparms*/, =
\
"track_" #kind "_mem_stack_" #syze, =
\
- VG_(tool_interface) =
\
- .track_##kind##_mem_stack_##syze, =
\
+ VG_(tdict).track_##kind##_mem_stack_##syze, =
\
mkIRExprVec_1(IRExpr_Tmp(curr)) =
\
); =
\
dcall->nFxState =3D 1; =
\
|
|
From: <sv...@va...> - 2005-03-31 04:37:49
|
Author: njn
Date: 2005-03-31 05:37:24 +0100 (Thu, 31 Mar 2005)
New Revision: 3487
Modified:
trunk/addrcheck/ac_main.c
trunk/cachegrind/cg_main.c
trunk/corecheck/cc_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/gen_toolint.pl
trunk/coregrind/vg_default.c
trunk/coregrind/vg_main.c
trunk/coregrind/vg_malloc2.c
trunk/coregrind/vg_needs.c
trunk/include/tool.h.base
trunk/lackey/lk_main.c
trunk/massif/ms_main.c
trunk/memcheck/mac_malloc_wrappers.c
trunk/memcheck/mac_shared.h
trunk/memcheck/mc_main.c
trunk/none/nl_main.c
Log:
This change reduces the number of calls to dlsym() when loading tools fro=
m a
lot to one. This required two basic changes.
1. Tools are responsible for telling the tool about any functions they
provide that the tool may call. This includes basic functions like
TL_(instrument)(), functions that assist core services such as
TL_(pp_Error)(), and malloc-replacement-related functions like
TL_(malloc)(). =20
2. Tools that replace malloc now specify the size of the heap block redzo=
nes
through an arg to the VG_(malloc_funcs)() function, rather than with a
variable VG_(vg_malloc_redzone_szB).
One consequence of these changes is that VG_(tool_init_dlsym)() no longer
needs to be generated by gen_toolint.pl.
There are a number of further improvements that could follow on from this=
one.
- Avoid the confusingly different definitions of the TL_() macro in the
core vs. for tools. Indeed, the functions provided by the tools now do=
n't
need to use the TL_() macro at all, as they can have arbitrary names.
- Remove a lot of the auto-generated stuff in vg_toolint.c and vg_toolint=
.h
(indeed, it might be possible to not auto-generate these at all, which
would be nice).
- The handling of VgToolInterface is currently split across vg_needs.c an=
d
vg_toolint.c, which isn't nice.
Modified: trunk/addrcheck/ac_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/addrcheck/ac_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/addrcheck/ac_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -1318,14 +1318,39 @@
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(details_avg_translation_sizeB) ( 135 );
=20
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
+
VG_(needs_core_errors) ();
- VG_(needs_tool_errors) ();
+ VG_(needs_tool_errors) (TL_(eq_Error),
+ TL_(pp_Error),
+ TL_(update_extra),
+ TL_(recognised_suppression),
+ TL_(read_extra_suppression_info),
+ TL_(error_matches_suppression),
+ TL_(get_error_name),
+ TL_(print_extra_suppression_info));
VG_(needs_libc_freeres) ();
- VG_(needs_command_line_options)();
- VG_(needs_client_requests) ();
- VG_(needs_sanity_checks) ();
+ VG_(needs_command_line_options)(TL_(process_cmd_line_option),
+ TL_(print_usage),
+ TL_(print_debug_usage));
+ VG_(needs_client_requests) (TL_(handle_client_request));
+ VG_(needs_sanity_checks) (TL_(cheap_sanity_check),
+ TL_(expensive_sanity_check));
VG_(needs_shadow_memory) ();
=20
+ VG_(malloc_funcs) (TL_(malloc),
+ TL_(__builtin_new),
+ TL_(__builtin_vec_new),
+ TL_(memalign),
+ TL_(calloc),
+ TL_(free),
+ TL_(__builtin_delete),
+ TL_(__builtin_vec_delete),
+ TL_(realloc),
+ MALLOC_REDZONE_SZB );
+
MAC_( new_mem_heap) =3D & ac_new_mem_heap;
MAC_( ban_mem_heap) =3D & ac_make_noaccess;
MAC_(copy_mem_heap) =3D & ac_copy_address_range_state;
Modified: trunk/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/cachegrind/cg_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -1132,9 +1132,15 @@
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(details_avg_translation_sizeB) ( 155 );
=20
- VG_(needs_basic_block_discards)();
- VG_(needs_command_line_options)();
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
=20
+ VG_(needs_basic_block_discards)(TL_(discard_basic_block_info));
+ VG_(needs_command_line_options)(TL_(process_cmd_line_option),
+ TL_(print_usage),
+ TL_(print_debug_usage));
+
/* Get working directory */
tl_assert( VG_(getcwd_alloc)(&base_dir) );
=20
Modified: trunk/corecheck/cc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/corecheck/cc_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/corecheck/cc_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -40,13 +40,15 @@
"Copyright (C) 2002-2005, and GNU GPL'd, by Nicholas Nethercote.")=
;
VG_(details_bug_reports_to) (VG_BUGS_TO);
=20
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
+
VG_(needs_core_errors)();
=20
/* No core events to track */
}
=20
-VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0)
-
void TL_(post_clo_init)(void)
{
}
@@ -61,6 +63,8 @@
{
}
=20
+VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0)
+
/*--------------------------------------------------------------------*/
/*--- end cc_main.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/Makefile.am 2005-03-31 04:37:24 UTC (rev 3487)
@@ -124,7 +124,6 @@
$(PERL) $(srcdir)/gen_toolint.pl callwrap < $(srcdir)/toolfuncs.def=
> $@ || rm -f $@
$(PERL) $(srcdir)/gen_toolint.pl missingfuncs < $(srcdir)/toolfuncs.def=
>> $@ || rm -f $@
$(PERL) $(srcdir)/gen_toolint.pl initfunc < $(srcdir)/toolfuncs.def=
>> $@ || rm -f $@
- $(PERL) $(srcdir)/gen_toolint.pl initdlsym < $(srcdir)/toolfuncs.def=
>> $@ || rm -f $@
$(PERL) $(srcdir)/gen_toolint.pl structdef < $(srcdir)/toolfuncs.def=
>> $@ || rm -f $@
=20
vg_toolint.h: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def ./Makefi=
le
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/core.h 2005-03-31 04:37:24 UTC (rev 3487)
@@ -337,8 +337,6 @@
=20
extern VgNeeds VG_(needs);
=20
-extern void VG_(tool_init_dlsym)(void *dlhandle);
-
#include "vg_toolint.h"
=20
=20
@@ -392,6 +390,10 @@
SizeT nmemb, SizeT bytes_per_memb );
extern void* VG_(arena_realloc) ( ArenaId arena, void* ptr, SizeT size )=
;
=20
+/* Sets the size of the redzones at the start and end of heap blocks. T=
his
+ must be called before any of VG_(malloc) and friends are called. */
+extern void VG_(set_client_malloc_redzone_szB) ( SizeT rz_szB );
+
extern SizeT VG_(arena_payload_szB) ( ArenaId aid, void* payload );
=20
extern void VG_(sanity_check_malloc_all) ( void );
Modified: trunk/coregrind/gen_toolint.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/gen_toolint.pl 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/gen_toolint.pl 2005-03-31 04:37:24 UTC (rev 3487)
@@ -166,32 +166,6 @@
print "void VG_(init_$func)($ret (*func)($args));\n";
};
$headerguard=3D$output;
-} elsif ($output eq "initdlsym") {
- $pre =3D sub () {
- print <<EOF;
-#include <dlfcn.h>
-void VG_(tool_init_dlsym)(void *dlhandle)
-{
- void *ret;
-
-EOF
- };
- $post =3D sub () {
- print "}\n";
- };
- $generate =3D sub ($$$@) {
- my ($pfx, $ret, $func, @args) =3D @_;
- my $args =3D join ", ", getargtypes(@args);
-
- print <<EOF;
- ret =3D dlsym(dlhandle, "vgTool_$func");
- if (ret !=3D NULL)
- VG_(init_$func)(($ret (*)($args))ret);
-
-EOF
- };
-
- $passcomment =3D 0;
}
=20
die "Unknown output format \"$output\"" unless defined $generate;
Modified: trunk/coregrind/vg_default.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_default.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/vg_default.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -66,10 +66,6 @@
/*--- Replacing malloc et al ---*/
/*------------------------------------------------------------*/
=20
-/* Default redzone size for CLIENT arena of Valgrind's malloc() */
-__attribute__ ((weak))
-SizeT VG_(vg_malloc_redzone_szB) =3D 8;
-
Bool VG_(tl_malloc_called_deliberately) =3D False;
=20
/* If the tool hasn't replaced malloc(), this one can be called
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/vg_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -1172,7 +1172,7 @@
=20
/* Find and load a tool, and check it looks ok. Also looks to see if th=
ere's=20
* a matching vgpreload_*.so file, and returns its name in *preloadpath.=
*/
-static void load_tool( const char *toolname, void** handle_out,
+static void load_tool( const char *toolname,
ToolInfo** toolinfo_out, char **preloadpath_out )
{
Bool ok;
@@ -1181,7 +1181,6 @@
void* handle;
ToolInfo* toolinfo;
char* preloadpath =3D NULL;
- Int* vg_malloc_redzonep;
=20
// XXX: allowing full paths for --tool option -- does it make sense?
// Doesn't allow for vgpreload_<tool>.so.
@@ -1240,14 +1239,7 @@
goto bad_load;
}
=20
- // Set redzone size for V's allocator
- vg_malloc_redzonep =3D dlsym(handle, VG_STRINGIFY(VG_(vg_malloc_redzo=
ne_szB)));
- if ( NULL !=3D vg_malloc_redzonep ) {
- VG_(vg_malloc_redzone_szB) =3D *vg_malloc_redzonep;
- }
-
- vg_assert(NULL !=3D handle && NULL !=3D toolinfo);
- *handle_out =3D handle;
+ vg_assert(NULL !=3D toolinfo);
*toolinfo_out =3D toolinfo;
*preloadpath_out =3D preloadpath;
return;
@@ -2419,7 +2411,6 @@
Int need_help =3D 0; // 0 =3D no, 1 =3D --help, 2 =3D --help-deb=
ug
struct exeinfo info;
ToolInfo *toolinfo =3D NULL;
- void *tool_dlhandle;
Addr client_eip;
Addr sp_at_startup; /* client's SP at the point we gained control=
. */
UInt * client_auxv;
@@ -2492,7 +2483,7 @@
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
//--------------------------------------------------------------
- load_tool(tool, &tool_dlhandle, &toolinfo, &preload);
+ load_tool(tool, &toolinfo, &preload);
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Can use VG_(malloc)() and VG_(arena_malloc)() only after load_tool=
()
@@ -2569,13 +2560,12 @@
//--------------------------------------------------------------
// Init tool: pre_clo_init, process cmd line, post_clo_init
// p: setup_client_stack() [for 'VG_(client_arg[cv]']
- // p: load_tool() [for 'tool']
+ // p: load_tool() [for 'toolinfo']
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
// p: parse_procselfmaps [so VG segments are setup so tool c=
an
// call VG_(malloc)]
//--------------------------------------------------------------
(*toolinfo->tl_pre_clo_init)();
- VG_(tool_init_dlsym)(tool_dlhandle);
VG_(sanity_check_needs)();
=20
// If --tool and --help/--help-debug was given, now give the core+too=
l
Modified: trunk/coregrind/vg_malloc2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_malloc2.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/vg_malloc2.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -378,6 +378,29 @@
}
}
=20
+static Bool init_done =3D False;
+static SizeT client_malloc_redzone_szB =3D 8; // default: be paranoid
+
+// Nb: this must be called before the client arena is initialised, ie.
+// before any memory is allocated.
+void VG_(set_client_malloc_redzone_szB)(SizeT rz_szB)
+{
+ if (init_done) {
+ VG_(printf)(
+ "\nTool error:\n"
+ " __FUNCTION__ cannot be called after the first allocation.\n"=
);
+ VG_(exit)(1);
+ }
+ // This limit is no special figure, just something not too big
+ if (rz_szB > 128) {
+ VG_(printf)(
+ "\nTool error:\n"
+ " __FUNCTION__ passed a too-big value (%llu)", (ULong)rz_szB);
+ VG_(exit)(1);
+ }
+ client_malloc_redzone_szB =3D rz_szB;
+}
+
/* This library is self-initialising, as it makes this more self-contain=
ed,
less coupled with the outside world. Hence VG_(arena_malloc)() and
VG_(arena_free)() below always call ensure_mm_init() to ensure things=
are
@@ -385,21 +408,10 @@
static
void ensure_mm_init ( void )
{
- static SizeT client_rz_szB;
- static Bool init_done =3D False;
- =20
if (init_done) {
- // Make sure the client arena's redzone size never changes. Could
- // happen if VG_(arena_malloc) was called too early, ie. before th=
e
- // tool was loaded.
- vg_assert(client_rz_szB =3D=3D VG_(vg_malloc_redzone_szB));
return;
}
=20
- /* No particular reason for this figure, it's just smallish */
- tl_assert(VG_(vg_malloc_redzone_szB) < 128);
- client_rz_szB =3D VG_(vg_malloc_redzone_szB);
-
/* Use checked red zones (of various sizes) for our internal stuff,
and an unchecked zone of arbitrary size for the client. Of
course the client's red zone can be checked by the tool, eg.=20
@@ -415,7 +427,7 @@
arena_init ( VG_AR_CORE, "core", 4, CORE_ARENA_MIN_SZB );
arena_init ( VG_AR_TOOL, "tool", 4, 1048576 );
arena_init ( VG_AR_SYMTAB, "symtab", 4, 1048576 );
- arena_init ( VG_AR_CLIENT, "client", client_rz_szB, 1048576 );
+ arena_init ( VG_AR_CLIENT, "client", client_malloc_redzone_szB, 10=
48576 );
arena_init ( VG_AR_DEMANGLE, "demangle", 12/*paranoid*/, 65536 );
arena_init ( VG_AR_EXECTXT, "exectxt", 4, 65536 );
arena_init ( VG_AR_ERRORS, "errors", 4, 65536 );
@@ -1354,8 +1366,8 @@
=20
Bool VG_(addr_is_in_block)( Addr a, Addr start, SizeT size )
{ =20
- return (start - VG_(vg_malloc_redzone_szB) <=3D a
- && a < start + size + VG_(vg_malloc_redzone_szB));
+ return (start - client_malloc_redzone_szB <=3D a
+ && a < start + size + client_malloc_redzone_szB);
}
=20
=20
Modified: trunk/coregrind/vg_needs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_needs.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/coregrind/vg_needs.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -36,6 +36,23 @@
Tool data structure initialisation
------------------------------------------------------------------ */
=20
+/*--------------------------------------------------------------------*/
+/* Setting basic functions */
+
+void VG_(basic_tool_funcs)(
+ void(*post_clo_init)(void),
+ IRBB*(*instrument)(IRBB*, VexGuestLayout*, IRType, IRType ),
+ void(*fini)(Int)
+)
+{
+ VG_(tool_interface).tool_post_clo_init =3D post_clo_init;
+ VG_(tool_interface).tool_instrument =3D instrument;
+ VG_(tool_interface).tool_fini =3D fini;
+}
+
+/*--------------------------------------------------------------------*/
+/* Setting details */
+
/* Init with default values. */
VgDetails VG_(details) =3D {
.name =3D NULL,
@@ -46,6 +63,23 @@
.avg_translation_sizeB =3D VG_DEFAULT_TRANS_SIZEB,
};
=20
+/* Use macro because they're so repetitive */
+#define DETAILS(type, detail) \
+ extern void VG_(details_##detail)(type detail) \
+ { \
+ VG_(details).detail =3D detail; \
+ }
+
+DETAILS(Char*, name)
+DETAILS(Char*, version)
+DETAILS(Char*, description)
+DETAILS(Char*, copyright_author)
+DETAILS(Char*, bug_reports_to)
+DETAILS(UInt, avg_translation_sizeB)
+
+/*--------------------------------------------------------------------*/
+/* Setting needs */
+
VgNeeds VG_(needs) =3D {
.core_errors =3D False,
.tool_errors =3D False,
@@ -115,44 +149,118 @@
#undef CHECK_NOT
}
=20
-/*--------------------------------------------------------------------*/
-/* Setting details */
-
/* Use macro because they're so repetitive */
-#define DETAILS(type, detail) \
- extern void VG_(details_##detail)(type detail) \
- { \
- VG_(details).detail =3D detail; \
- }
-
-DETAILS(Char*, name)
-DETAILS(Char*, version)
-DETAILS(Char*, description)
-DETAILS(Char*, copyright_author)
-DETAILS(Char*, bug_reports_to)
-DETAILS(UInt, avg_translation_sizeB)
-
-/*--------------------------------------------------------------------*/
-/* Setting needs */
-
-/* Use macro because they're so repetitive */
#define NEEDS(need) \
extern void VG_(needs_##need)(void) \
{ \
VG_(needs).need =3D True; \
}
=20
+// These ones don't require any tool-supplied functions
NEEDS(libc_freeres)
NEEDS(core_errors)
-NEEDS(tool_errors)
-NEEDS(basic_block_discards)
-NEEDS(command_line_options)
-NEEDS(client_requests)
-NEEDS(syscall_wrapper)
-NEEDS(sanity_checks)
NEEDS(data_syms)
NEEDS(shadow_memory)
=20
+void VG_(needs_basic_block_discards)(
+ void (*discard)(Addr, SizeT)
+)
+{
+ VG_(needs).basic_block_discards =3D True;
+ VG_(tool_interface).tool_discard_basic_block_info =3D discard;
+}
+
+void VG_(needs_tool_errors)(
+ Bool (*eq) (VgRes, Error*, Error*),
+ void (*pp) (Error*),
+ UInt (*update) (Error*),
+ Bool (*recog) (Char*, Supp*),
+ Bool (*read_extra) (Int, Char*, Int, Supp*),
+ Bool (*matches) (Error*, Supp*),
+ Char* (*name) (Error*),
+ void (*print_extra)(Error*)
+)
+{
+ VG_(needs).tool_errors =3D True;
+ VG_(tool_interface).tool_eq_Error =3D eq;
+ VG_(tool_interface).tool_pp_Error =3D pp;
+ VG_(tool_interface).tool_update_extra =3D update;
+ VG_(tool_interface).tool_recognised_suppression =3D recog;
+ VG_(tool_interface).tool_read_extra_suppression_info =3D read_extra;
+ VG_(tool_interface).tool_error_matches_suppression =3D matches;
+ VG_(tool_interface).tool_get_error_name =3D name;
+ VG_(tool_interface).tool_print_extra_suppression_info =3D print_extra=
;
+}
+
+void VG_(needs_command_line_options)(
+ Bool (*process)(Char*),
+ void (*usage)(void),
+ void (*debug_usage)(void)
+)
+{
+ VG_(needs).command_line_options =3D True;
+ VG_(tool_interface).tool_process_cmd_line_option =3D process;
+ VG_(tool_interface).tool_print_usage =3D usage;
+ VG_(tool_interface).tool_print_debug_usage =3D debug_usage;
+}
+
+void VG_(needs_client_requests)(
+ Bool (*handle)(ThreadId, UWord*, UWord*)
+)
+{
+ VG_(needs).client_requests =3D True;
+ VG_(tool_interface).tool_handle_client_request =3D handle;
+}
+
+void VG_(needs_syscall_wrapper)(
+ void(*pre) (ThreadId, UInt),
+ void(*post)(ThreadId, UInt, Int res)
+)
+{
+ VG_(needs).syscall_wrapper =3D True;
+ VG_(tool_interface).tool_pre_syscall =3D pre;
+ VG_(tool_interface).tool_post_syscall =3D post;
+}
+
+void VG_(needs_sanity_checks)(
+ Bool(*cheap)(void),
+ Bool(*expen)(void)
+)
+{
+ VG_(needs).sanity_checks =3D True;
+ VG_(tool_interface).tool_cheap_sanity_check =3D cheap;
+ VG_(tool_interface).tool_expensive_sanity_check =3D expen;
+}
+
+
+/* Replacing malloc() */
+
+extern void VG_(malloc_funcs)(
+ void* (*malloc) ( ThreadId, SizeT ),
+ void* (*__builtin_new) ( ThreadId, SizeT ),
+ void* (*__builtin_vec_new) ( ThreadId, SizeT ),
+ void* (*memalign) ( ThreadId, SizeT, SizeT ),
+ void* (*calloc) ( ThreadId, SizeT, SizeT ),
+ void (*free) ( ThreadId, void* ),
+ void (*__builtin_delete) ( ThreadId, void* ),
+ void (*__builtin_vec_delete) ( ThreadId, void* ),
+ void* (*realloc) ( ThreadId, void*, SizeT ),
+ SizeT client_malloc_redzone_szB
+)
+{
+ VG_(tool_interface).malloc_malloc =3D malloc;
+ VG_(tool_interface).malloc___builtin_new =3D __builtin_new;
+ VG_(tool_interface).malloc___builtin_vec_new =3D __builtin_vec_new=
;
+ VG_(tool_interface).malloc_memalign =3D memalign;
+ VG_(tool_interface).malloc_calloc =3D calloc;
+ VG_(tool_interface).malloc_free =3D free;
+ VG_(tool_interface).malloc___builtin_delete =3D __builtin_delete;
+ VG_(tool_interface).malloc___builtin_vec_delete =3D __builtin_vec_del=
ete;
+ VG_(tool_interface).malloc_realloc =3D realloc;
+
+ VG_(set_client_malloc_redzone_szB)( client_malloc_redzone_szB );
+}
+
/*--------------------------------------------------------------------*/
/*--- end vg_needs.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/include/tool.h.base
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/tool.h.base 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/include/tool.h.base 2005-03-31 04:37:24 UTC (rev 3487)
@@ -331,8 +331,8 @@
extern void* VG_(realloc) ( void* p, SizeT size );
=20
/* terminate everything */
-extern void VG_(exit)( Int status )
- __attribute__ ((__noreturn__));
+extern void VG_(exit)( Int status )
+ __attribute__ ((__noreturn__));
=20
/* terminate the calling thread - probably not what you want */
extern void VG_(exit_single)( Int status )
@@ -908,15 +908,6 @@
follow the following instructions. You can do it from scratch,
though, if you enjoy that sort of thing. */
=20
-/* Arena size for valgrind's own malloc(); default value is 0, but can
- be overridden by tool -- but must be done so *statically*, eg:
-
- SizeT VG_(vg_malloc_redzone_szB) =3D 4;
-
- It can't be done from a function like TL_(pre_clo_init)(). So it can=
't,
- for example, be controlled with a command line option, unfortunately.=
*/
-extern SizeT VG_(vg_malloc_redzone_szB);
-
/* Can be called from TL_(malloc) et al to do the actual alloc/freeing. =
*/
extern void* VG_(cli_malloc) ( SizeT align, SizeT nbytes );
extern void VG_(cli_free) ( void* p );
@@ -947,6 +938,16 @@
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
/* ------------------------------------------------------------------ */
+/* Basic tool functions */
+
+extern void VG_(basic_tool_funcs)(
+ void(*post_clo_init)(void),
+ IRBB*(*instrument)(IRBB* bb_in, VexGuestLayout* layout,=20
+ IRType gWordTy, IRType hWordTy ),
+ void(*fini)(Int)
+);
+
+/* ------------------------------------------------------------------ */
/* Details */
=20
/* Default value for avg_translations_sizeB (in bytes), indicating typic=
al
@@ -995,27 +996,110 @@
lot like being a member of a type class. */
=20
/* Want to report errors from tool? This implies use of suppressions, t=
oo. */
-extern void VG_(needs_tool_errors) ( void );
+extern void VG_(needs_tool_errors) (
+ // Identify if two errors are equal, or equal enough. `res' indicate=
s how
+ // close is "close enough". `res' should be passed on as necessary, =
eg. if
+ // the Error's `extra' part contains an ExeContext, `res' should be
+ // passed to VG_(eq_ExeContext)() if the ExeContexts are considered. =
Other
+ // than that, probably don't worry about it unless you have lots of v=
ery
+ // similar errors occurring.
+ Bool (*eq_Error)(VgRes res, Error* e1, Error* e2),
=20
+ // Print error context.
+ void (*pp_Error)(Error* err),
+
+ // Should fill in any details that could be postponed until after the
+ // decision whether to ignore the error (ie. details not affecting th=
e
+ // result of TL_(eq_Error)()). This saves time when errors are ignor=
ed.
+ // Yuk.
+ // Return value: must be the size of the `extra' part in bytes -- use=
d by
+ // the core to make a copy.
+ UInt (*update_extra)(Error* err),
+
+ // Return value indicates recognition. If recognised, must set skind=
using
+ // VG_(set_supp_kind)().
+ Bool (*recognised_suppression)(Char* name, Supp* su),
+
+ // Read any extra info for this suppression kind. Most likely for fi=
lling
+ // in the `extra' and `string' parts (with VG_(set_supp_{extra, strin=
g})())
+ // of a suppression if necessary. Should return False if a syntax er=
ror
+ // occurred, True otherwise.
+ Bool (*read_extra_suppression_info)(Int fd, Char* buf, Int nBuf, Supp=
* su),
+
+ // This should just check the kinds match and maybe some stuff in the
+ // `string' and `extra' field if appropriate (using VG_(get_supp_*)()=
to
+ // get the relevant suppression parts).
+ Bool (*error_matches_suppression)(Error* err, Supp* su),
+
+ // This should return the suppression name, for --gen-suppressions, o=
r NULL
+ // if that error type cannot be suppressed. This is the inverse of
+ // TL_(recognised_suppression)().
+ Char* (*get_error_name)(Error* err),
+
+ // This should print any extra info for the error, for --gen-suppress=
ions,
+ // including the newline. This is the inverse of
+ // TL_(read_extra_suppression_info)().
+ void (*print_extra_suppression_info)(Error* err)
+);
+
+
/* Is information kept about specific individual basic blocks? (Eg. for
cachegrind there are cost-centres for every instruction, stored at a
basic block level.) If so, it sometimes has to be discarded, because
.so mmap/munmap-ping or self-modifying code (informed by the
DISCARD_TRANSLATIONS user request) can cause one instruction address
to be used for more than one instruction in one program run... */
-extern void VG_(needs_basic_block_discards) ( void );
+extern void VG_(needs_basic_block_discards) (
+ // Should discard any information that pertains to specific basic blo=
cks
+ // or instructions within the address range given.
+ void (*discard_basic_block_info)(Addr a, SizeT size)
+);
=20
/* Tool defines its own command line options? */
-extern void VG_(needs_command_line_options) ( void );
+extern void VG_(needs_command_line_options) (
+ // Return True if option was recognised. Presumably sets some state =
to
+ // record the option as well.
+ Bool (*process_cmd_line_option)(Char* argv),
=20
+ // Print out command line usage for options for normal tool operation=
.
+ void (*print_usage)(void),
+
+ // Print out command line usage for options for debugging the tool.
+ void (*print_debug_usage)(void)
+);
+
/* Tool defines its own client requests? */
-extern void VG_(needs_client_requests) ( void );
+extern void VG_(needs_client_requests) (
+ // If using client requests, the number of the first request should b=
e equal
+ // to VG_USERREQ_TOOL_BASE('X', 'Y'), where 'X' and 'Y' form a suitab=
le two
+ // character identification for the string. The second and subsequen=
t
+ // requests should follow.
+ //
+ // This function should use the VG_IS_TOOL_USERREQ macro (in
+ // include/valgrind.h) to first check if it's a request for this tool=
. Then
+ // should handle it if it's recognised (and return True), or return F=
alse if
+ // not recognised. arg_block[0] holds the request number, any furthe=
r args
+ // from the request are in arg_block[1..]. 'ret' is for the return v=
alue...
+ // it should probably be filled, if only with 0.
+ Bool (*handle_client_request)(ThreadId tid, UWord* arg_block, UWord* =
ret)
+);
=20
/* Tool does stuff before and/or after system calls? */
-extern void VG_(needs_syscall_wrapper) ( void );
+// Nb: If either of the pre_ functions malloc() something to return, the
+// corresponding post_ function had better free() it!
+extern void VG_(needs_syscall_wrapper) (
+ void (* pre_syscall)(ThreadId tid, UInt syscallno),
+ void (*post_syscall)(ThreadId tid, UInt syscallno, Int res)
+);
=20
/* Are tool-state sanity checks performed? */
-extern void VG_(needs_sanity_checks) ( void );
+// Can be useful for ensuring a tool's correctness. TL_(cheap_sanity_ch=
eck)
+// is called very frequently; TL_(expensive_sanity_check) is called les=
s
+// frequently and can be more involved.
+extern void VG_(needs_sanity_checks) (
+ Bool(*cheap_sanity_check)(void),
+ Bool(*expensive_sanity_check)(void)
+);
=20
/* Do we need to see data symbols? */
extern void VG_(needs_data_syms) ( void );
@@ -1028,6 +1112,23 @@
extern float TL_(shadow_ratio);
=20
/* ------------------------------------------------------------------ */
+/* Malloc replacement */
+
+// The 'p' prefix avoids GCC complaints about overshadowing global names=
.
+extern void VG_(malloc_funcs)(
+ void* (*pmalloc) ( ThreadId tid, SizeT n ),
+ void* (*p__builtin_new) ( ThreadId tid, SizeT n ),
+ void* (*p__builtin_vec_new) ( ThreadId tid, SizeT n ),
+ void* (*pmemalign) ( ThreadId tid, SizeT align, SizeT n )=
,
+ void* (*pcalloc) ( ThreadId tid, SizeT nmemb, SizeT siz=
e1 ),
+ void (*pfree) ( ThreadId tid, void* p ),
+ void (*p__builtin_delete) ( ThreadId tid, void* p ),
+ void (*p__builtin_vec_delete) ( ThreadId tid, void* p ),
+ void* (*prealloc) ( ThreadId tid, void* p, SizeT new_siz=
e ),
+ SizeT client_malloc_redzone_szB
+);
+
+/* ------------------------------------------------------------------ */
/* Core events to track */
=20
/* Part of the core from which this call was made. Useful for determini=
ng
Modified: trunk/lackey/lk_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lackey/lk_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/lackey/lk_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -81,6 +81,10 @@
"Copyright (C) 2002-2005, and GNU GPL'd, by Nicholas Nethercote.")=
;
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(details_avg_translation_sizeB) ( 175 );
+
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
}
=20
void TL_(post_clo_init)(void)
@@ -280,7 +284,6 @@
=20
VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0)
=20
-
/*--------------------------------------------------------------------*/
/*--- end lk_main.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/ms_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/massif/ms_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -1159,8 +1159,6 @@
// Current directory at startup.
static Char* base_dir;
=20
-SizeT VG_(vg_malloc_redzone_szB) =3D 0;
-
void TL_(pre_clo_init)()
{=20
VG_(details_name) ("Massif");
@@ -1169,11 +1167,30 @@
VG_(details_copyright_author)("Copyright (C) 2003, Nicholas Nethercot=
e");
VG_(details_bug_reports_to) (VG_BUGS_TO);
=20
+ // Basic functions
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
+
// Needs
VG_(needs_libc_freeres)();
- VG_(needs_command_line_options)();
- VG_(needs_client_requests) ();
+ VG_(needs_command_line_options)(TL_(process_cmd_line_option),
+ TL_(print_usage),
+ TL_(print_debug_usage));
+ VG_(needs_client_requests) (TL_(handle_client_request));
=20
+ // Malloc replacement
+ VG_(malloc_funcs) (TL_(malloc),
+ TL_(__builtin_new),
+ TL_(__builtin_vec_new),
+ TL_(memalign),
+ TL_(calloc),
+ TL_(free),
+ TL_(__builtin_delete),
+ TL_(__builtin_vec_delete),
+ TL_(realloc),
+ 0 );
+
// Events to track
VG_(init_new_mem_stack_signal) ( new_mem_stack_signal );
VG_(init_die_mem_stack_signal) ( die_mem_stack_signal );
Modified: trunk/memcheck/mac_malloc_wrappers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_malloc_wrappers.c 2005-03-30 23:36:28 UTC (rev 348=
6)
+++ trunk/memcheck/mac_malloc_wrappers.c 2005-03-31 04:37:24 UTC (rev 348=
7)
@@ -41,9 +41,6 @@
static SizeT cmalloc_n_frees =3D 0;
static SizeT cmalloc_bs_mallocd =3D 0;
=20
-/* We want a 16B redzone on heap blocks for Addrcheck and Memcheck */
-SizeT VG_(vg_malloc_redzone_szB) =3D 16;
-
/* Function pointers for the two tools to track interesting events. */
void (*MAC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited ) =3D NU=
LL;
void (*MAC_(ban_mem_heap)) ( Addr a, SizeT len ) =3D NU=
LL;
@@ -221,7 +218,7 @@
return NULL;
} else {
return MAC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocMalloc=
,
+ MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocMalloc,
MAC_(malloc_list));
}
}
@@ -232,7 +229,7 @@
return NULL;
} else {
return MAC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocNew,
+ MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocNew,
MAC_(malloc_list));
}
}
@@ -243,7 +240,7 @@
return NULL;
} else {
return MAC_(new_block) ( tid, 0, n, VG_(clo_alignment),=20
- VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocNewVec=
,
+ MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocNewVec,
MAC_(malloc_list));
}
}
@@ -254,7 +251,7 @@
return NULL;
} else {
return MAC_(new_block) ( tid, 0, n, align,=20
- VG_(vg_malloc_redzone_szB), /*is_zeroed*/False, MAC_AllocMalloc=
,
+ MALLOC_REDZONE_SZB, /*is_zeroed*/False, MAC_AllocMalloc,
MAC_(malloc_list));
}
}
@@ -265,7 +262,7 @@
return NULL;
} else {
return MAC_(new_block) ( tid, 0, nmemb*size1, VG_(clo_alignment),
- VG_(vg_malloc_redzone_szB), /*is_zeroed*/True, MAC_AllocMalloc,
+ MALLOC_REDZONE_SZB, /*is_zeroed*/True, MAC_AllocMalloc,
MAC_(malloc_list));
}
}
@@ -326,19 +323,19 @@
void TL_(free) ( ThreadId tid, void* p )
{
MAC_(handle_free)(=20
- tid, (Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocMalloc );
+ tid, (Addr)p, MALLOC_REDZONE_SZB, MAC_AllocMalloc );
}
=20
void TL_(__builtin_delete) ( ThreadId tid, void* p )
{
MAC_(handle_free)(
- tid, (Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocNew);
+ tid, (Addr)p, MALLOC_REDZONE_SZB, MAC_AllocNew);
}
=20
void TL_(__builtin_vec_delete) ( ThreadId tid, void* p )
{
MAC_(handle_free)(
- tid, (Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocNewVec);
+ tid, (Addr)p, MALLOC_REDZONE_SZB, MAC_AllocNewVec);
}
=20
void* TL_(realloc) ( ThreadId tid, void* p, SizeT new_size )
@@ -397,19 +394,17 @@
=20
/* First half kept and copied, second half new,=20
red zones as normal */
- MAC_(ban_mem_heap) ( p_new-VG_(vg_malloc_redzone_szB),=20
- VG_(vg_malloc_redzone_szB) );
+ MAC_(ban_mem_heap) ( p_new-MALLOC_REDZONE_SZB, MALLOC_REDZONE_SZB =
);
MAC_(copy_mem_heap)( (Addr)p, p_new, mc->size );
MAC_(new_mem_heap) ( p_new+mc->size, new_size-mc->size, /*inited*/=
False );
- MAC_(ban_mem_heap) ( p_new+new_size, VG_(vg_malloc_redzone_szB) );
+ MAC_(ban_mem_heap) ( p_new+new_size, MALLOC_REDZONE_SZB );
=20
/* Copy from old to new */
for (i =3D 0; i < mc->size; i++)
((UChar*)p_new)[i] =3D ((UChar*)p)[i];
=20
/* Free old memory */
- die_and_free_mem ( tid, mc, prev_chunks_next_ptr,
- VG_(vg_malloc_redzone_szB) );
+ die_and_free_mem ( tid, mc, prev_chunks_next_ptr, MALLOC_REDZONE_S=
ZB );
=20
/* this has to be after die_and_free_mem, otherwise the
former succeeds in shorting out the new block, not the
Modified: trunk/memcheck/mac_shared.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_shared.h 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/memcheck/mac_shared.h 2005-03-31 04:37:24 UTC (rev 3487)
@@ -290,6 +290,8 @@
extern void MAC_(print_common_usage) ( void );
extern void MAC_(print_common_debug_usage) ( void );
=20
+/* We want a 16B redzone on heap blocks for Addrcheck and Memcheck */
+#define MALLOC_REDZONE_SZB 16
=20
/*------------------------------------------------------------*/
/*--- Variables ---*/
Modified: trunk/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/memcheck/mc_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -1873,14 +1873,39 @@
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(details_avg_translation_sizeB) ( 370 );
=20
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
+
VG_(needs_core_errors) ();
- VG_(needs_tool_errors) ();
+ VG_(needs_tool_errors) (TL_(eq_Error),
+ TL_(pp_Error),
+ TL_(update_extra),
+ TL_(recognised_suppression),
+ TL_(read_extra_suppression_info),
+ TL_(error_matches_suppression),
+ TL_(get_error_name),
+ TL_(print_extra_suppression_info));
VG_(needs_libc_freeres) ();
- VG_(needs_command_line_options)();
- VG_(needs_client_requests) ();
- VG_(needs_sanity_checks) ();
+ VG_(needs_command_line_options)(TL_(process_cmd_line_option),
+ TL_(print_usage),
+ TL_(print_debug_usage));
+ VG_(needs_client_requests) (TL_(handle_client_request));
+ VG_(needs_sanity_checks) (TL_(cheap_sanity_check),
+ TL_(expensive_sanity_check));
VG_(needs_shadow_memory) ();
=20
+ VG_(malloc_funcs) (TL_(malloc),
+ TL_(__builtin_new),
+ TL_(__builtin_vec_new),
+ TL_(memalign),
+ TL_(calloc),
+ TL_(free),
+ TL_(__builtin_delete),
+ TL_(__builtin_vec_delete),
+ TL_(realloc),
+ MALLOC_REDZONE_SZB );
+
MAC_( new_mem_heap) =3D & mc_new_mem_heap;
MAC_( ban_mem_heap) =3D & mc_make_noaccess;
MAC_(copy_mem_heap) =3D & mc_copy_address_range_state;
@@ -1893,7 +1918,6 @@
VG_(init_new_mem_mmap) ( & mc_new_mem_mmap );
=20
VG_(init_copy_mem_remap) ( & mc_copy_address_range_state );
- //VG_(init_change_mem_mprotect) ( & mc_set_perms );
=20
VG_(init_die_mem_stack_signal) ( & mc_make_noaccess );=20
VG_(init_die_mem_brk) ( & mc_make_noaccess );
Modified: trunk/none/nl_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/nl_main.c 2005-03-30 23:36:28 UTC (rev 3486)
+++ trunk/none/nl_main.c 2005-03-31 04:37:24 UTC (rev 3487)
@@ -39,6 +39,10 @@
"Copyright (C) 2002-2005, and GNU GPL'd, by Nicholas Nethercote.")=
;
VG_(details_bug_reports_to) (VG_BUGS_TO);
=20
+ VG_(basic_tool_funcs) (TL_(post_clo_init),
+ TL_(instrument),
+ TL_(fini));
+
/* No needs, no core events to track */
}
=20
|
|
From: Nicholas N. <nj...@cs...> - 2005-03-31 04:36:10
|
On Wed, 30 Mar 2005, Tom Hughes wrote: >> Instead, it would be better to put the Kal module/subsystem >> in its own directory, kal, and put all the arch/os specific bits >> just for Kal in there: >> >> kal/pub_core_kal.h -- services exported from kal; core but not >> tools may use these >> kal/pub_tool_kal.h -- services exported from kal; both core and >> tools may use these >> >> kal/kal-x86-linux.c -- x86-linux specific implementation >> kal/kal-amd64-linux.c -- amd64-linux specific implementation >> kal/any_other_name.c -- generic implementation Hmm... we were just discussing how having all the arch-specific code in one module/directory wasn't really the right thing to do -- that it's better to follow modules boundaries, and possibly have some arch-specific code in each module. Isn't there a similar situation here? Ie. really the module (or modules) here is our libc replacement or 'utility' module(s) or whatever you want to call it. In which case we shouldn't have a separate kal/ directory just for the arch-specific things. Does that make sense? N |
|
From: Robert W. <rj...@du...> - 2005-03-31 03:52:19
|
> AIUI, Julian favours (3), Jeremy favours either (1) or (2). I'm leaning=20 > towards (3). I was leaning towards (1) or (2), but after our last discussion on this I'm now in the (3) camp. External code =3D=3D figuring out what side effects it has, which is error-prone. Maintaining our own libc isn't easy, but it does give us a lot more control, and who said this had to be easy? Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: Nicholas N. <nj...@cs...> - 2005-03-31 03:38:52
|
On Wed, 30 Mar 2005, Jeremy Fitzhardinge wrote: >> Attached is a first cut at a kernel abstraction layer. > > I think we should just use the libc API for this, if not the system glibc. > Would uclibc be a good basis (http://www.uclibc.org/)? It would get us out > of the business of maintaining a C library as well. Perhaps we should stop, think about this, and make a decision before proceeding further, since there it's an important issue and there is some disagreement. Currently we use glibc in a number of modules: vg_main.c, ume.c, stage1.c, vg_stabs.c, vg_symtab2.c, $PLATFORM/core_platform.h, $ARCH/state.c, vg_pthreadmodel.c, vg_skiplist.c. The first three in that list use libc a lot, the others are more minor uses (some only for types and constants, I think). And we also have our own libc implementations of lots of functions. And we've got some external library code in Valgrind (the demangler). So we're using an awkward mix. I see three possibilities here. 1. Use glibc externally, as we do a little bit now. Pros: saves us implementation work. Especialy helpful with complex functions like dlopen() and dlsym() Cons: unclear impact on correctness. Eg. what happens if a library function calls malloc()? 2. Copy a libc into Valgrind, eg. uClibc. Pros: as for (1) Cons: lots of extra code, much of it unused 3. Implement our own libc. Pros: eliminates dependency on outside world, great for correctness guarantees Cons: implementation effort, esp. on different platforms. AIUI, Julian favours (3), Jeremy favours either (1) or (2). I'm leaning towards (3). I've undoubtedly oversimplified the issues involved and missed out some important details. Anyone care to add their two cents? I figure it's a good idea to discuss this and come to some sort of conclusion/agreement before too much implementation effort occurs. N |
|
From: <js...@ac...> - 2005-03-31 03:02:58
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-03-31 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: (skipping, prereq failed: ../../../tests/cputest x86-mmxext) insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 201 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/writev (stderr) corecheck/tests/fdleak_fcntl (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2005-03-31 02:55:20
|
Nightly build on dunsmere ( Fedora Core 3 ) started at 2005-03-31 03:20:07 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int sh: line 1: 7912 Segmentation fault VALGRINDLIB=/tmp/valgrind.14926/valgrind/.in_place /tmp/valgrind.14926/valgrind/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --addrcheck:leak-check=no --tool=none ./int >int.stdout.out 2>int.stderr.out pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 207 tests, 2 stderr failures, 1 stdout failure ================= memcheck/tests/scalar (stderr) memcheck/tests/scalar_supp (stderr) none/tests/tls (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-03-31 02:23:06
|
Nightly build on audi ( Red Hat 9 ) started at 2005-03-31 03:15:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow fpu_lazy_eflags: valgrind ./fpu_lazy_eflags insn_basic: valgrind ./insn_basic insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 206 tests, 1 stderr failure, 0 stdout failures ================= memcheck/tests/scalar (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-03-31 02:16:29
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2005-03-31 03:10:01 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 205 tests, 3 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-03-31 02:15:46
|
Nightly build on standard ( Red Hat 7.2 ) started at 2005-03-31 03:00:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 205 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/vgtest_ume (stderr) addrcheck/tests/leak-tree (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-03-31 02:11:49
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2005-03-31 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow == 205 tests, 17 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/distinguished-writes (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/vgtest_ume (stderr) addrcheck/tests/leak-0 (stderr) addrcheck/tests/leak-cycle (stderr) addrcheck/tests/leak-regroot (stderr) addrcheck/tests/leak-tree (stderr) make: *** [regtest] Error 1 |
|
From: Julian S. <js...@ac...> - 2005-03-30 23:39:13
|
> I'll fix that up and get it committed then. The x86 side should > really have the same change, but we can get away without it there > because the dynamic linker will do relocations at load time for > code that isn't really PIC but ought to be - the amd64 one won't > do that. Cool. I guess there's also a net performance loss putting the same change in x86. Yeh. I guess it can't, because insns with offsets don't carry 64-bit offsets. Or something. I just had a spin with konq and moz startups on amd64. Looks promising, mostly a lot of complaining about missing syscalls which ultimately causes moz to give up and konq to not be able to do anything due to not being able to communicate with dcopserver. Small KDE apps (kmines, kpat, kcalc) work, more or less. Unfortunately SuSE seem to have neglected to ship that most useful of KDE applications, ktuberling ;-) J |
|
From: <sv...@va...> - 2005-03-30 23:36:32
|
Author: tom Date: 2005-03-31 00:36:28 +0100 (Thu, 31 Mar 2005) New Revision: 3486 Modified: trunk/coregrind/amd64/dispatch.S Log: Make the dispatcher code position independent so that PIE mode works. Modified: trunk/coregrind/amd64/dispatch.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/amd64/dispatch.S 2005-03-30 19:31:18 UTC (rev 3485) +++ trunk/coregrind/amd64/dispatch.S 2005-03-30 23:36:28 UTC (rev 3486) @@ -60,8 +60,12 @@ pushq %r15 pushq %rdi =20 - /* 0(%rsp) holds cached copy of guest_state */ + movq VG_(dispatch_ctr)@GOTPCREL(%rip), %rsi + pushq (%rsi) =20 + /* 8(%rsp) holds cached copy of guest_state */ + /* 0(%rsp) holds cached copy of VG_(dispatch_ctr) */ + /* Set up the guest state pointer */ movq %rdi, %rbp =09 @@ -95,17 +99,19 @@ movq %rax, OFFSET_amd64_RIP(%rbp) =20 /* Are we out of timeslice? If yes, defer to scheduler. */ - subl $1, VG_(dispatch_ctr) + subl $1, 0(%rsp) jz counter_is_zero =20 /* try a fast lookup in the translation cache */ movq %rax, %rbx andq $VG_TT_FAST_MASK, %rbx - movq VG_(tt_fast)(,%rbx,8), %rcx + movq VG_(tt_fast)@GOTPCREL(%rip), %rcx + movq (%rcx,%rbx,8), %rcx cmpq %rax, (%rcx) jnz fast_lookup_failed /* increment bb profile counter */ - movq VG_(tt_fastN)(,%rbx,8), %rdx + movq VG_(tt_fastN)@GOTPCREL(%rip), %rdx + movq (%rdx,%rbx,8), %rdx incl (%rdx) =20 /* Found a match. Call tce[1], which is 8 bytes along, since @@ -118,13 +124,13 @@ %rbp indicates further details of the control transfer requested to the address in %rax. =09 - If rbp is unchanged (=3D=3D * 0(%rsp)), just jump next to %rax. + If rbp is unchanged (=3D=3D * 8(%rsp)), just jump next to %rax. =20 Otherwise fall out, back to the scheduler, and let it figure out what to do next. */ =20 - cmpq 0(%rsp), %rbp + cmpq 8(%rsp), %rbp jz dispatch_boring =20 jmp dispatch_exceptional @@ -157,6 +163,8 @@ jmp run_innerloop_exit_REALLY =20 run_innerloop_exit_REALLY: + movq VG_(dispatch_ctr)@GOTPCREL(%rip), %rsi + popq (%rsi) popq %rdi popq %r15 popq %r14 @@ -184,20 +192,20 @@ jz counter_is_zero =20 /* save %rax in %RIP and defer to sched */ - movq 0(%rsp), %rdi + movq 8(%rsp), %rdi movq %rax, OFFSET_amd64_RIP(%rdi) movq %rbp, %rax jmp run_innerloop_exit =20 fast_lookup_failed: /* %RIP is up to date here since dispatch_boring dominates */ - addl $1, VG_(dispatch_ctr) + addl $1, 0(%rsp) movq $VG_TRC_INNER_FASTMISS, %rax jmp run_innerloop_exit =20 counter_is_zero: /* %RIP is up to date here since dispatch_boring dominates */ - addl $1, VG_(dispatch_ctr) + addl $1, 0(%rsp) movq $VG_TRC_INNER_COUNTERZERO, %rax jmp run_innerloop_exit =20 |
|
From: <sv...@va...> - 2005-03-30 23:20:51
|
Author: sewardj
Date: 2005-03-31 00:20:47 +0100 (Thu, 31 Mar 2005)
New Revision: 1115
Modified:
trunk/priv/guest-amd64/toIR.c
trunk/priv/host-amd64/hdefs.c
trunk/priv/host-amd64/isel.c
Log:
Support a few more insns I ran across whilst trying to start up
konqueror (mostly successfully) and mozilla (promising but
unsuccessful).
Modified: trunk/priv/guest-amd64/toIR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-amd64/toIR.c 2005-03-30 23:19:46 UTC (rev 1114)
+++ trunk/priv/guest-amd64/toIR.c 2005-03-30 23:20:47 UTC (rev 1115)
@@ -3605,9 +3605,9 @@
case 4: /* MUL (unsigned widening) */
codegen_mulL_A_D ( sz, False, t1, dis_buf );
break;
-//.. case 5: /* IMUL */
-//.. codegen_mulL_A_D ( sz, True, t1, dis_buf );
-//.. break;
+ case 5: /* IMUL */
+ codegen_mulL_A_D ( sz, True, t1, dis_buf );
+ break;
case 6: /* DIV */
codegen_div ( sz, t1, False );
DIP("div%c %s\n", nameISize(sz), dis_buf);
@@ -8060,11 +8060,12 @@
goto decode_success;
}
=20
-//.. /* 0F 55 =3D ANDNPS -- G =3D (not G) and E */
-//.. if (sz =3D=3D 4 && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0x55) {
-//.. delta =3D dis_SSE_E_to_G_all_invG( sorb, delta+2, "andnps", I=
op_And128 );
-//.. goto decode_success;
-//.. }
+ /* 0F 55 =3D ANDNPS -- G =3D (not G) and E */
+ if (haveNo66noF2noF3(pfx) && sz =3D=3D 4=20
+ && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0x55) {
+ delta =3D dis_SSE_E_to_G_all_invG( pfx, delta+2, "andnps", Iop_And=
V128 );
+ goto decode_success;
+ }
=20
/* 0F 54 =3D ANDPS -- G =3D G and E */
if (haveNo66noF2noF3(pfx) && sz =3D=3D 4=20
@@ -8078,14 +8079,14 @@
//.. delta =3D dis_SSEcmp_E_to_G( sorb, delta+2, "cmpps", True, 4 =
);
//.. goto decode_success;
//.. }
-//..=20
-//.. /* F3 0F C2 =3D CMPSS -- 32F0x4 comparison from R/M to R */
-//.. if (insn[0] =3D=3D 0xF3 && insn[1] =3D=3D 0x0F && insn[2] =3D=3D=
0xC2) {
-//.. vassert(sz =3D=3D 4);
-//.. delta =3D dis_SSEcmp_E_to_G( sorb, delta+3, "cmpss", False, 4=
);
-//.. goto decode_success;
-//.. }
=20
+ /* F3 0F C2 =3D CMPSS -- 32F0x4 comparison from R/M to R */
+ if (haveF3no66noF2(pfx) && sz =3D=3D 4
+ && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0xC2) {
+ delta =3D dis_SSEcmp_E_to_G( pfx, delta+2, "cmpss", False, 4 );
+ goto decode_success;
+ }
+
/* 0F 2F =3D COMISS -- 32F0x4 comparison G,E, and set ZCP */
/* 0F 2E =3D UCOMISS -- 32F0x4 comparison G,E, and set ZCP */
if (haveNo66noF2noF3(pfx) && sz =3D=3D 4=20
@@ -8700,12 +8701,13 @@
goto decode_success;
}
=20
-//.. /* 0F 56 =3D ORPS -- G =3D G and E */
-//.. if (sz =3D=3D 4 && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0x56) {
-//.. delta =3D dis_SSE_E_to_G_all( sorb, delta+2, "orps", Iop_Or12=
8 );
-//.. goto decode_success;
-//.. }
-//..=20
+ /* 0F 56 =3D ORPS -- G =3D G and E */
+ if (haveNo66noF2noF3(pfx) && sz =3D=3D 4
+ && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0x56) {
+ delta =3D dis_SSE_E_to_G_all( pfx, delta+2, "orps", Iop_OrV128 );
+ goto decode_success;
+ }
+
//.. /* ***--- this is an MMX class insn introduced in SSE1 ---*** */
//.. /* 0F E0 =3D PAVGB -- 8x8 unsigned Packed Average, with rounding=
*/
//.. if (sz =3D=3D 4 && insn[0] =3D=3D 0x0F && insn[1] =3D=3D 0xE0) {
Modified: trunk/priv/host-amd64/hdefs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-amd64/hdefs.c 2005-03-30 23:19:46 UTC (rev 1114)
+++ trunk/priv/host-amd64/hdefs.c 2005-03-30 23:20:47 UTC (rev 1115)
@@ -3109,7 +3109,7 @@
//.. case Xsse_SQRTF: *p++ =3D 0x51; break;
case Asse_SUBF: *p++ =3D 0x5C; break;
//.. case Xsse_CMPEQF: *p++ =3D 0xC2; xtra =3D 0x100; break;
-//.. case Xsse_CMPLTF: *p++ =3D 0xC2; xtra =3D 0x101; break;
+ case Asse_CMPLTF: *p++ =3D 0xC2; xtra =3D 0x101; break;
//.. case Xsse_CMPLEF: *p++ =3D 0xC2; xtra =3D 0x102; break;
default: goto bad;
}
Modified: trunk/priv/host-amd64/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-amd64/isel.c 2005-03-30 23:19:46 UTC (rev 1114)
+++ trunk/priv/host-amd64/isel.c 2005-03-30 23:20:47 UTC (rev 1115)
@@ -2976,6 +2976,16 @@
addInstr(env, AMD64Instr_SseLdSt( True/*load*/, 16, dst, rsp0 )=
);
add_to_rsp(env, 16);
return dst;
+ } else=20
+ if (e->Iex.Const.con->Ico.V128 =3D=3D 0x000F) {
+ HReg tmp =3D newVRegI(env);
+ AMD64AMode* rsp0 =3D AMD64AMode_IR(0, hregAMD64_RSP());
+ addInstr(env, AMD64Instr_Imm64(0xFFFFFFFFULL, tmp));
+ addInstr(env, AMD64Instr_Push(AMD64RMI_Imm(0)));
+ addInstr(env, AMD64Instr_Push(AMD64RMI_Reg(tmp)));
+ addInstr(env, AMD64Instr_SseLdSt( True/*load*/, 16, dst, rsp0 )=
);
+ add_to_rsp(env, 16);
+ return dst;
} else {
goto vec_fail;
# if 0
@@ -3238,7 +3248,7 @@
//.. }
=20
//.. case Iop_CmpEQ32F0x4: op =3D Xsse_CMPEQF; goto do_32F0x4;
-//.. case Iop_CmpLT32F0x4: op =3D Xsse_CMPLTF; goto do_32F0x4;
+ case Iop_CmpLT32F0x4: op =3D Asse_CMPLTF; goto do_32F0x4;
//.. case Iop_CmpLE32F0x4: op =3D Xsse_CMPLEF; goto do_32F0x4;
case Iop_Add32F0x4: op =3D Asse_ADDF; goto do_32F0x4;
case Iop_Div32F0x4: op =3D Asse_DIVF; goto do_32F0x4;
|
|
From: <sv...@va...> - 2005-03-30 23:19:52
|
Author: sewardj
Date: 2005-03-31 00:19:46 +0100 (Thu, 31 Mar 2005)
New Revision: 1114
Modified:
trunk/priv/ir/iropt.c
Log:
Add a folding rule for Mul64.
Modified: trunk/priv/ir/iropt.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/ir/iropt.c 2005-03-30 18:40:23 UTC (rev 1113)
+++ trunk/priv/ir/iropt.c 2005-03-30 23:19:46 UTC (rev 1114)
@@ -1059,6 +1059,12 @@
(e->Iex.Binop.arg1->Iex.Const.con->Ico.U32
* e->Iex.Binop.arg2->Iex.Const.con->Ico.U32)));
break;
+ case Iop_Mul64:
+ e2 =3D IRExpr_Const(IRConst_U64(
+ (e->Iex.Binop.arg1->Iex.Const.con->Ico.U64
+ * e->Iex.Binop.arg2->Iex.Const.con->Ico.U64)));
+ break;
+
case Iop_MullS32: {
/* very paranoid */
UInt u32a =3D e->Iex.Binop.arg1->Iex.Const.con->Ico.U32;
|
|
From: Jeremy F. <je...@go...> - 2005-03-30 23:18:57
|
Nicholas Nethercote wrote:
> Giving the tool direct access to the VG_(tool_interface) struct
> doesn't seem like a good idea -- it exposes it to more than it needs
> to see.
Agreed.
> So this would simply separate structs corresponding to each of the
> multi-arg functions in the patch now. Only two of those functions are
> really bad -- VG_(needs_tool_errors)() has 8 args, VG_(malloc_funcs)()
> has 10. Do you think we need structs for the ones with only 1, 2 or 3
> args?
It would seem silly to have lots of little structures, but having two
calling styles isn't terribly pretty either (and one presumes that at
some point you'd need to convert a called-with-pointers function to a
called-with-a-struct function when the number of functions reaches a
certain point). I guess structures for the biggies and literal pointers
for the 1,2,3 cases, but I still think a simple one registry function
per function model is cleaner and more robust in the long term.
J
|
|
From: Tom H. <to...@co...> - 2005-03-30 23:16:17
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> That's just too ugly. For the time being, let's go with the
> "movq VG_(tt_fast)@GOTPCREL(%rip), %rcx" style fixes that
> Tom/Jeremy cooked up. Does the x86 side need similar modification
> or is that OK as-is ?
I'll fix that up and get it committed then. The x86 side should
really have the same change, but we can get away without it there
because the dynamic linker will do relocations at load time for
code that isn't really PIC but ought to be - the amd64 one won't
do that.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2005-03-30 22:51:12
|
Hmm. This is a pig of a problem. With r3484/r3485 I managed to get rid of one insn per fast-iteration, but being PIE still costs us. The "best" solution I can think of is to glom all the dispatcher- visible state (dispatch_ctr, fast[], fastN[]) into a single struct, and pass a pointer to that to run_innerloop. That pointer can be reloaded from the stack each time round the loop, so the extra cost is one insn/bb, which given that one insn was just got rid of, is free, at least in terms of insn counts. So the main difficulty -- apart from the uglyness of inventing a struct purely for this reason -- is how the assembly code can know the (literal) offsets of the struct components, without having to mess around with preprocessor programs to extract the offsets. That's just too ugly. For the time being, let's go with the "movq VG_(tt_fast)@GOTPCREL(%rip), %rcx" style fixes that Tom/Jeremy cooked up. Does the x86 side need similar modification or is that OK as-is ? > Yep, that looks about right. I wasn't too worried about adding a couple > of extra instructions here because BB-chaining should take most of the > load off this code (in 2.4); in 3, one presumes Vex's BB-fusing is about > as effective (or we need to look at doing chaining as well). Further ahead, it would be nice to reinstate bb-chaining. Vex's chasing results in bb count reductions on the order of 20%-30% compared to 2.4, which is a start, and gives indirect benefits in that the guest regs remains cached in host regs across the boundary. Nevertheless this leaves a lot of scope for chaining. For one thing, chaining removes the indirect and presumably unpredictable call that the dispatcher must make. J |
|
From: Julian S. <js...@ac...> - 2005-03-30 20:01:33
|
Thanks. Oops! Now fixed. J On Wednesday 30 March 2005 20:47, Maurice van der Pot wrote: > This is what I get when I visit www.valgrind.org: > > Parse error: parse error, unexpected T_IS_IDENTICAL in > /usr/local/www/sites/valgrind-www/php/.htconfx on line 15 > > Just so you know. > > Maurice. |