From owner-p4-projects@FreeBSD.ORG Fri Oct 24 02:59:00 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D85E71065733; Fri, 24 Oct 2008 02:58:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F0011065674 for ; Fri, 24 Oct 2008 02:58:59 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA308FC23 for ; Fri, 24 Oct 2008 02:58:59 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O2wxdw048878 for ; Fri, 24 Oct 2008 02:58:59 GMT (envelope-from peter-gmail@wemm.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9O2wxeH048876 for perforce@freebsd.org; Fri, 24 Oct 2008 02:58:59 GMT (envelope-from peter-gmail@wemm.org) Date: Fri, 24 Oct 2008 02:58:59 GMT Message-Id: <200810240258.m9O2wxeH048876@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter-gmail@wemm.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 151840 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 02:59:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=151840 Change 151840 by peter@peter_cheese on 2008/10/24 02:58:48 Sync up with linux changes. Adjust ifdefs. Gets a little further. Affected files ... .. //depot/projects/valgrind/coregrind/m_dispatch/dispatch-amd64-freebsd.S#2 edit .. //depot/projects/valgrind/coregrind/m_dispatch/dispatch-x86-freebsd.S#2 edit .. //depot/projects/valgrind/coregrind/m_libcfile.c#5 edit .. //depot/projects/valgrind/coregrind/m_signals.c#5 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syscall-x86-freebsd.S#5 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd-variants.c#4 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#10 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#7 edit .. //depot/projects/valgrind/drd/drd_strmem_intercepts.c#2 edit .. //depot/projects/valgrind/exp-ptrcheck/h_intercepts.c#2 edit .. //depot/projects/valgrind/exp-ptrcheck/h_main.c#2 edit .. //depot/projects/valgrind/memcheck/mc_replace_strmem.c#4 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_dispatch/dispatch-amd64-freebsd.S#2 (text+ko) ==== @@ -1,14 +1,14 @@ /*--------------------------------------------------------------------*/ /*--- The core dispatch loop, for jumping to a code address. ---*/ -/*--- dispatch-amd64.S ---*/ +/*--- dispatch-amd64-linux.S ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2006 Julian Seward + Copyright (C) 2000-2008 Julian Seward jseward@acm.org This program is free software; you can redistribute it and/or @@ -119,8 +119,12 @@ /* AT ENTRY: %rax is next guest addr, %rbp is possibly modified guest state ptr */ - /* Has the guest state pointer been messed with? If yes, exit. */ + /* Has the guest state pointer been messed with? If yes, exit. + Also, set %rcx to be &VG_(tt_fast), some insns before it is + used, in the hope of getting it off the critical path. This + location seems to be optimal on 2.2GHz Athlon64. */ cmpq 8(%rsp), %rbp + movq VG_(tt_fast)@GOTPCREL(%rip), %rcx jnz gsp_changed /* save the jump address in the guest state */ @@ -131,17 +135,16 @@ jz counter_is_zero /* try a fast lookup in the translation cache */ - movq VG_(tt_fast)@GOTPCREL(%rip), %rcx - movq %rax, %rbx - andq $VG_TT_FAST_MASK, %rbx - movq (%rcx,%rbx,8), %rcx - cmpq %rax, (%rcx) + movq %rax, %rbx /* next guest addr */ + andq $VG_TT_FAST_MASK, %rbx /* entry# */ + shlq $4, %rbx /* entry# * sizeof(FastCacheEntry) */ + movq 0(%rcx,%rbx,1), %r10 /* .guest */ + movq 8(%rcx,%rbx,1), %r11 /* .host */ + cmpq %rax, %r10 jnz fast_lookup_failed - /* Found a match. Call tce[1], which is 8 bytes along, since - each tce element is a 64-bit int. */ - addq $8, %rcx - jmp *%rcx + /* Found a match. Jump to .host. */ + jmp *%r11 ud2 /* persuade insn decoders not to speculate past here */ /* generated code should run, then jump back to VG_(run_innerloop__dispatch_unprofiled). */ @@ -157,8 +160,12 @@ /* AT ENTRY: %rax is next guest addr, %rbp is possibly modified guest state ptr */ - /* Has the guest state pointer been messed with? If yes, exit. */ + /* Has the guest state pointer been messed with? If yes, exit. + Also, set %rcx to be &VG_(tt_fast), some insns before it is + used, in the hope of getting it off the critical path. This + location seems to be optimal on 2.2GHz Athlon64. */ cmpq 8(%rsp), %rbp + movq VG_(tt_fast)@GOTPCREL(%rip), %rcx jnz gsp_changed /* save the jump address in the guest state */ @@ -169,22 +176,22 @@ jz counter_is_zero /* try a fast lookup in the translation cache */ - movq VG_(tt_fast)@GOTPCREL(%rip), %rcx movq %rax, %rbx - andq $VG_TT_FAST_MASK, %rbx - movq (%rcx,%rbx,8), %rcx - cmpq %rax, (%rcx) + andq $VG_TT_FAST_MASK, %rbx /* entry# */ + shlq $4, %rbx /* entry# * sizeof(FastCacheEntry) */ + movq 0(%rcx,%rbx,1), %r10 /* .guest */ + movq 8(%rcx,%rbx,1), %r11 /* .host */ + cmpq %rax, %r10 jnz fast_lookup_failed /* increment bb profile counter */ movq VG_(tt_fastN)@GOTPCREL(%rip), %rdx - movq (%rdx,%rbx,8), %rdx + shrq $1, %rbx /* entry# * sizeof(UInt*) */ + movq (%rdx,%rbx,1), %rdx addl $1, (%rdx) - /* Found a match. Call tce[1], which is 8 bytes along, since - each tce element is a 64-bit int. */ - addq $8, %rcx - jmp *%rcx + /* Found a match. Jump to .host. */ + jmp *%r11 ud2 /* persuade insn decoders not to speculate past here */ /* generated code should run, then jump back to VG_(run_innerloop__dispatch_profiled). */ ==== //depot/projects/valgrind/coregrind/m_dispatch/dispatch-x86-freebsd.S#2 (text+ko) ==== @@ -1,14 +1,14 @@ /*--------------------------------------------------------------------*/ /*--- The core dispatch loop, for jumping to a code address. ---*/ -/*--- dispatch-x86.S ---*/ +/*--- dispatch-x86-linux.S ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2005 Julian Seward + Copyright (C) 2000-2008 Julian Seward jseward@acm.org This program is free software; you can redistribute it and/or @@ -120,16 +120,15 @@ jz counter_is_zero /* try a fast lookup in the translation cache */ - movl %eax, %ebx - andl $VG_TT_FAST_MASK, %ebx - movl VG_(tt_fast)(,%ebx,4), %ecx - cmpl %eax, (%ecx) + movl %eax, %ebx /* next guest addr */ + andl $ VG_TT_FAST_MASK, %ebx /* entry# */ + movl 0+VG_(tt_fast)(,%ebx,8), %esi /* .guest */ + movl 4+VG_(tt_fast)(,%ebx,8), %edi /* .host */ + cmpl %eax, %esi jnz fast_lookup_failed - /* Found a match. Jump to tce[1], which is 8 bytes along, - since each tce element is a 64-bit int. */ - addl $8, %ecx - jmp *%ecx + /* Found a match. Jump to .host. */ + jmp *%edi ud2 /* persuade insn decoders not to speculate past here */ /* generated code should run, then jump back to VG_(run_innerloop__dispatch_unprofiled). */ @@ -157,11 +156,13 @@ jz counter_is_zero /* try a fast lookup in the translation cache */ - movl %eax, %ebx - andl $VG_TT_FAST_MASK, %ebx - movl VG_(tt_fast)(,%ebx,4), %ecx - cmpl %eax, (%ecx) + movl %eax, %ebx /* next guest addr */ + andl $ VG_TT_FAST_MASK, %ebx /* entry# */ + movl 0+VG_(tt_fast)(,%ebx,8), %esi /* .guest */ + movl 4+VG_(tt_fast)(,%ebx,8), %edi /* .host */ + cmpl %eax, %esi jnz fast_lookup_failed + /* increment bb profile counter */ /* note: innocuous as this sounds, it causes a huge amount more stress on D1 and significantly slows everything down. */ @@ -169,10 +170,8 @@ /* Use "addl $1", not "incl", to avoid partial-flags stall on P4 */ addl $1, (%edx) - /* Found a match. Jump to tce[1], which is 8 bytes along, - since each tce element is a 64-bit int. */ - addl $8, %ecx - jmp *%ecx + /* Found a match. Jump to .host. */ + jmp *%edi ud2 /* persuade insn decoders not to speculate past here */ /* generated code should run, then jump back to VG_(run_innerloop__dispatch_profiled). */ @@ -200,7 +199,7 @@ /* %EIP is up to date here */ /* back out decrement of the dispatch counter */ addl $1, VG_(dispatch_ctr) - movl $VG_TRC_INNER_COUNTERZERO, %eax + movl $ VG_TRC_INNER_COUNTERZERO, %eax jmp run_innerloop_exit /*NOTREACHED*/ @@ -208,7 +207,7 @@ /* %EIP is up to date here */ /* back out decrement of the dispatch counter */ addl $1, VG_(dispatch_ctr) - movl $VG_TRC_INNER_FASTMISS, %eax + movl $ VG_TRC_INNER_FASTMISS, %eax jmp run_innerloop_exit /*NOTREACHED*/ @@ -241,7 +240,7 @@ jmp run_innerloop_exit_REALLY invariant_violation: - movl $VG_TRC_INVARIANT_FAILED, %eax + movl $ VG_TRC_INVARIANT_FAILED, %eax jmp run_innerloop_exit_REALLY run_innerloop_exit_REALLY: ==== //depot/projects/valgrind/coregrind/m_libcfile.c#5 (text+ko) ==== @@ -209,7 +209,7 @@ { SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) # if defined(__NR_stat64) { struct vki_stat64 buf64; res = VG_(do_syscall2)(__NR_stat64, (UWord)file_name, (UWord)&buf64); @@ -227,13 +227,6 @@ TRANSLATE_TO_vg_stat(vgbuf, &buf); return res; } -# elif defined(VGO_freebsd) - { struct vki_stat buf; - res = VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)&buf); - if (!res.isError) - TRANSLATE_TO_vg_stat(vgbuf, &buf); - return res; - } # elif defined(VGO_aix5) { struct vki_stat buf; res = VG_(do_syscall4)(__NR_AIX5_statx, @@ -261,7 +254,7 @@ { SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) # if defined(__NR_fstat64) { struct vki_stat64 buf64; res = VG_(do_syscall2)(__NR_fstat64, (UWord)fd, (UWord)&buf64); @@ -279,13 +272,6 @@ TRANSLATE_TO_vg_stat(vgbuf, &buf); return res.isError ? (-1) : 0; } -# elif defined(VGO_freebsd) - { struct vki_stat buf; - res = VG_(do_syscall2)(__NR_fstat, (UWord)fd, (UWord)&buf); - if (!res.isError) - TRANSLATE_TO_vg_stat(vgbuf, &buf); - return res.isError ? (-1) : 0; - } # elif defined(VGO_aix5) I_die_here; # else @@ -318,10 +304,8 @@ SysRes VG_(dup2) ( Int oldfd, Int newfd ) { -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) return VG_(do_syscall2)(__NR_dup2, oldfd, newfd); -# elif defined(VGO_freebsd) - return VG_(do_syscall2)(__NR_dup2, oldfd, newfd); # elif defined(VGO_aix5) I_die_here; # else @@ -602,7 +586,7 @@ static Int my_connect ( Int sockfd, -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) struct vki_sockaddr_in* serv_addr, # else void* serv_addr, @@ -776,7 +760,7 @@ static Int my_connect ( Int sockfd, -# if defined(VGO_linux) +# if defined(VGO_linux) || defined(VGO_freebsd) struct vki_sockaddr_in* serv_addr, # else void* serv_addr, ==== //depot/projects/valgrind/coregrind/m_signals.c#5 (text+ko) ==== @@ -2094,7 +2094,6 @@ if (sip == NULL) sip = next_queued(0, &pollset); /* process-wide */ -#ifdef VGO_linux /* XXX freebsd4 does not have sigtimedwait. MUST FIX */ /* If there was nothing queued, ask the kernel for a pending signal */ if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) { if (VG_(clo_trace_signals)) @@ -2102,7 +2101,6 @@ "for thread %d", si.si_signo, tid); sip = &si; } -#endif if (sip != NULL) { /* OK, something to do; deliver it */ ==== //depot/projects/valgrind/coregrind/m_syswrap/syscall-x86-freebsd.S#5 (text+ko) ==== @@ -7,7 +7,7 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2005 Julian Seward + Copyright (C) 2000-2008 Julian Seward jseward@acm.org This program is free software; you can redistribute it and/or @@ -78,10 +78,8 @@ UWord arg4; // 16 UWord arg5; // 20 UWord arg6; // 24 -#ifdef VGO_freebsd UWord arg7; // 28 UWord arg8; // 32 -#endif */ @@ -101,7 +99,7 @@ 1: /* Even though we can't take a signal until the sigprocmask completes, start the range early. - If eip is in the range [1,2], the syscall hasn't been started yet */ + If eip is in the range [1,2), the syscall hasn't been started yet */ /* Set the signal mask which should be current during the syscall. */ movl $__NR_sigprocmask, %eax @@ -138,7 +136,7 @@ /* If eip==2, then the syscall was either just about to start, or was interrupted and the kernel was restarting it. */ 2: int $0x80 -3: /* In the range [3, 4], the syscall result is in %eax/%edx/eflags, +3: /* In the range [3, 4), the syscall result is in %eax/%edx/eflags, but hasn't been committed to EAX/EDX. */ pushf popl %edi /* copy flags to %edi */ @@ -153,7 +151,7 @@ %edi is saved across a syscall so we don't have to worry about it getting trashed by the sigprocmask below. */ -4: /* Re-block signals. If eip is in [4,5], then the syscall is complete and +4: /* Re-block signals. If eip is in [4,5), then the syscall is complete and we needn't worry about it. */ movl $__NR_sigprocmask, %eax movl $VKI_SIG_SETMASK, %ecx ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd-variants.c#4 (text+ko) ==== @@ -8,7 +8,7 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2005 Julian Seward + Copyright (C) 2000-2008 Julian Seward jseward@acm.org This program is free software; you can redistribute it and/or ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#10 (text+ko) ==== @@ -7,7 +7,7 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2005 Nicholas Nethercote + Copyright (C) 2000-2008 Nicholas Nethercote njn@valgrind.org This program is free software; you can redistribute it and/or @@ -54,6 +54,7 @@ #include "priv_types_n_macros.h" #include "priv_syswrap-generic.h" + #include "priv_syswrap-freebsd.h" // Run a thread from beginning to end and return the thread's @@ -70,7 +71,6 @@ vg_assert(tst->status == VgTs_Init); - /* make sure we get the CPU lock before doing anything significant */ VG_(acquire_BigLock)(tid, "thread_wrapper(starting new thread)"); @@ -128,6 +128,9 @@ c = VG_(count_living_threads)(); vg_assert(c >= 1); /* stay sane */ + // Tell the tool this thread is exiting + VG_TRACK( pre_thread_ll_exit, tid ); + if (c == 1) { VG_(debugLog)(1, "syswrap-freebsd", @@ -300,6 +303,8 @@ VG_(sigfillset)(&mask); VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, &fork_saved_mask); + VG_(do_atfork_pre)(tid); + res = VG_(do_syscall0)( __NR_fork ); if (!res.isError && res.res == 0) { @@ -308,12 +313,21 @@ /* restore signal mask */ VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL); + + /* If --child-silent-after-fork=yes was specified, set the + logging file descriptor to an 'impossible' value. This is + noticed by send_bytes_to_logging_sink in m_libcprint.c, which + duly stops writing any further logging output. */ + if (!VG_(logging_to_socket) && VG_(clo_child_silent_after_fork)) + VG_(clo_log_fd) = -1; } else if (!res.isError && res.res > 0) { /* parent */ + VG_(do_atfork_parent)(tid); + if (VG_(clo_trace_syscalls)) - VG_(printf)(" clone(fork): process %d created child %d\n", + VG_(printf)(" clone(fork): process %d created child %ld\n", VG_(getpid)(), res.res); /* restore signal mask */ @@ -366,7 +380,7 @@ PRE(sys_socket) { - PRINT("sys_socket ( %d, %d, %d )",ARG1,ARG2,ARG3); + PRINT("sys_socket ( %ld, %ld, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "socket", int, domain, int, type, int, protocol); } POST(sys_socket) @@ -379,7 +393,7 @@ PRE(sys_setsockopt) { - PRINT("sys_setsockopt ( %d, %d, %d, %p, %d )",ARG1,ARG2,ARG3,ARG4,ARG5); + PRINT("sys_setsockopt ( %ld, %ld, %ld, %#lx, %ld )",ARG1,ARG2,ARG3,ARG4,ARG5); PRE_REG_READ5(long, "setsockopt", int, s, int, level, int, optname, const void *, optval, int, optlen); @@ -388,7 +402,7 @@ PRE(sys_getsockopt) { - PRINT("sys_getsockopt ( %d, %d, %d, %p, %p )",ARG1,ARG2,ARG3,ARG4,ARG5); + PRINT("sys_getsockopt ( %ld, %ld, %ld, %#lx, %#lx )",ARG1,ARG2,ARG3,ARG4,ARG5); PRE_REG_READ5(long, "getsockopt", int, s, int, level, int, optname, void *, optval, int, *optlen); @@ -404,7 +418,7 @@ PRE(sys_connect) { *flags |= SfMayBlock; - PRINT("sys_connect ( %d, %p, %d )",ARG1,ARG2,ARG3); + PRINT("sys_connect ( %ld, %#lx, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "connect", int, sockfd, struct sockaddr *, serv_addr, int, addrlen); ML_(generic_PRE_sys_connect)(tid, ARG1,ARG2,ARG3); @@ -413,7 +427,7 @@ PRE(sys_accept) { *flags |= SfMayBlock; - PRINT("sys_accept ( %d, %p, %d )",ARG1,ARG2,ARG3); + PRINT("sys_accept ( %ld, %#lx, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "accept", int, s, struct sockaddr *, addr, int, *addrlen); ML_(generic_PRE_sys_accept)(tid, ARG1,ARG2,ARG3); @@ -430,7 +444,7 @@ PRE(sys_sendto) { *flags |= SfMayBlock; - PRINT("sys_sendto ( %d, %p, %d, %u, %p, %d )",ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); + PRINT("sys_sendto ( %ld, %#lx, %ld, %lu, %#lx, %ld )",ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); PRE_REG_READ6(long, "sendto", int, s, const void *, msg, int, len, unsigned int, flags, @@ -441,7 +455,7 @@ PRE(sys_recvfrom) { *flags |= SfMayBlock; - PRINT("sys_recvfrom ( %d, %p, %d, %u, %p, %p )",ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); + PRINT("sys_recvfrom ( %ld, %#lx, %ld, %lu, %#lx, %#lx )",ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); PRE_REG_READ6(long, "recvfrom", int, s, void *, buf, int, len, unsigned int, flags, struct sockaddr *, from, int *, fromlen); @@ -457,7 +471,7 @@ PRE(sys_sendmsg) { *flags |= SfMayBlock; - PRINT("sys_sendmsg ( %d, %p, %d )",ARG1,ARG2,ARG3); + PRINT("sys_sendmsg ( %ld, %#lx, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "sendmsg", int, s, const struct msghdr *, msg, int, flags); ML_(generic_PRE_sys_sendmsg)(tid, ARG1,ARG2); @@ -466,7 +480,7 @@ PRE(sys_recvmsg) { *flags |= SfMayBlock; - PRINT("sys_recvmsg ( %d, %p, %d )",ARG1,ARG2,ARG3); + PRINT("sys_recvmsg ( %ld, %#lx, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "recvmsg", int, s, struct msghdr *, msg, int, flags); ML_(generic_PRE_sys_recvmsg)(tid, ARG1,ARG2); } @@ -478,13 +492,13 @@ PRE(sys_shutdown) { *flags |= SfMayBlock; - PRINT("sys_shutdown ( %d, %d )",ARG1,ARG2); + PRINT("sys_shutdown ( %ld, %ld )",ARG1,ARG2); PRE_REG_READ2(int, "shutdown", int, s, int, how); } PRE(sys_bind) { - PRINT("sys_bind ( %d, %p, %d )",ARG1,ARG2,ARG3); + PRINT("sys_bind ( %ld, %#lx, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "bind", int, sockfd, struct sockaddr *, my_addr, int, addrlen); ML_(generic_PRE_sys_bind)(tid, ARG1,ARG2,ARG3); @@ -492,13 +506,13 @@ PRE(sys_listen) { - PRINT("sys_listen ( %d, %d )",ARG1,ARG2); + PRINT("sys_listen ( %ld, %ld )",ARG1,ARG2); PRE_REG_READ2(long, "listen", int, s, int, backlog); } PRE(sys_getsockname) { - PRINT("sys_getsockname ( %d, %p, %p )",ARG1,ARG2,ARG3); + PRINT("sys_getsockname ( %ld, %#lx, %#lx )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getsockname", int, s, struct sockaddr *, name, int *, namelen); ML_(generic_PRE_sys_getsockname)(tid, ARG1,ARG2,ARG3); @@ -512,7 +526,7 @@ PRE(sys_getpeername) { - PRINT("sys_getpeername ( %d, %p, %p )",ARG1,ARG2,ARG3); + PRINT("sys_getpeername ( %ld, %#lx, %#lx )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getpeername", int, s, struct sockaddr *, name, int *, namelen); ML_(generic_PRE_sys_getpeername)(tid, ARG1,ARG2,ARG3); @@ -526,7 +540,7 @@ PRE(sys_socketpair) { - PRINT("sys_socketpair ( %d, %d, %d, %p )",ARG1,ARG2,ARG3,ARG4); + PRINT("sys_socketpair ( %ld, %ld, %ld, %#lx )",ARG1,ARG2,ARG3,ARG4); PRE_REG_READ4(long, "socketpair", int, d, int, type, int, protocol, int [2], sv); ML_(generic_PRE_sys_socketpair)(tid, ARG1,ARG2,ARG3,ARG4); @@ -548,7 +562,7 @@ // We are conservative and check everything, except the memory pointed to // by 'data'. *flags |= SfMayBlock; - PRINT( "sys_mount( %p, %p, %d, %p )" ,ARG1,ARG2,ARG3,ARG4); + PRINT( "sys_mount( %#lx, %#lx, %ld, %#lx )" ,ARG1,ARG2,ARG3,ARG4); PRE_REG_READ4(long, "mount", char *, type, char *, path, int, flags, void *, data); @@ -558,7 +572,7 @@ PRE(sys_unmount) { - PRINT("sys_umount( %p, %d )", ARG1, ARG2); + PRINT("sys_umount( %#lx, %ld )", ARG1, ARG2); PRE_REG_READ2(long, "unmount", char *, path, int, flags); PRE_MEM_RASCIIZ( "unmount(path)", ARG1); } @@ -570,27 +584,27 @@ #if 0 PRE(sys_setfsuid) { - PRINT("sys_setfsuid ( %d )", ARG1); + PRINT("sys_setfsuid ( %ld )", ARG1); PRE_REG_READ1(long, "setfsuid", vki_uid_t, uid); } PRE(sys_setfsgid) { - PRINT("sys_setfsgid ( %d )", ARG1); + PRINT("sys_setfsgid ( %ld )", ARG1); PRE_REG_READ1(long, "setfsgid", vki_gid_t, gid); } #endif PRE(sys_setresuid) { - PRINT("sys_setresuid ( %d, %d, %d )", ARG1, ARG2, ARG3); + PRINT("sys_setresuid ( %ld, %ld, %ld )", ARG1, ARG2, ARG3); PRE_REG_READ3(long, "setresuid", vki_uid_t, ruid, vki_uid_t, euid, vki_uid_t, suid); } PRE(sys_getresuid) { - PRINT("sys_getresuid ( %p, %p, %p )", ARG1,ARG2,ARG3); + PRINT("sys_getresuid ( %#lx, %#lx, %#lx )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getresuid", vki_uid_t *, ruid, vki_uid_t *, euid, vki_uid_t *, suid); PRE_MEM_WRITE( "getresuid(ruid)", ARG1, sizeof(vki_uid_t) ); @@ -610,14 +624,14 @@ PRE(sys_setresgid) { - PRINT("sys_setresgid ( %d, %d, %d )", ARG1, ARG2, ARG3); + PRINT("sys_setresgid ( %ld, %ld, %ld )", ARG1, ARG2, ARG3); PRE_REG_READ3(long, "setresgid", vki_gid_t, rgid, vki_gid_t, egid, vki_gid_t, sgid); } PRE(sys_getresgid) { - PRINT("sys_getresgid ( %p, %p, %p )", ARG1,ARG2,ARG3); + PRINT("sys_getresgid ( %#lx, %#lx, %#lx )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getresgid", vki_gid_t *, rgid, vki_gid_t *, egid, vki_gid_t *, sgid); PRE_MEM_WRITE( "getresgid(rgid)", ARG1, sizeof(vki_gid_t) ); @@ -645,7 +659,7 @@ ThreadId t; ThreadState* tst; - PRINT("exit_group( %d )", ARG1); + PRINT("exit_group( %ld )", ARG1); PRE_REG_READ1(void, "exit_group", int, exit_code); tst = VG_(get_ThreadState)(tid); @@ -675,7 +689,7 @@ PRE(sys_getlogin) { - PRINT("sys_getlogin ( %p, %d )",ARG1,ARG2); + PRINT("sys_getlogin ( %#lx, %ld )",ARG1,ARG2); PRE_REG_READ2(long, "getlogin", char *, buf, int, len); PRE_MEM_WRITE( "getlogin(buf, len)", ARG1, ARG2 ); @@ -688,13 +702,13 @@ } PRE(sys_setlogin) { - PRINT("sys_setlogin ( %p )",ARG1); + PRINT("sys_setlogin ( %#lx )",ARG1); PRE_REG_READ1(long, "setlogin", char *, buf); PRE_MEM_RASCIIZ( "setlogin(buf)", ARG1 ); } PRE(sys_mkfifo) { - PRINT("sys_mkfifo ( %p(%s), 0x%x, 0x%x )", ARG1, ARG1, ARG2 ); + PRINT("sys_mkfifo ( %#lx(%s), 0x%lx, 0x%lx )", ARG1, (char *)ARG1, ARG2, ARG3 ); PRE_REG_READ2(long, "mkfifo", const char *, pathname, int, mode); PRE_MEM_RASCIIZ( "mkfifo(pathname)", ARG1 ); } @@ -703,7 +717,7 @@ PRE(sys_quotactl) { - PRINT("sys_quotactl (%p, %d, %d, %p )", ARG1,ARG2,ARG3, ARG4); + PRINT("sys_quotactl (%#lx, %ld, %ld, %#lx )", ARG1,ARG2,ARG3, ARG4); PRE_REG_READ4(long, "quotactl", const char *, path, int, cmd, int, id, void *, addr); @@ -713,7 +727,7 @@ /* int getdomainname(char *domainname, int len); */ PRE(sys_getdomainname) { - PRINT("sys_getdomainname ( %p, %d )",ARG1,ARG2); + PRINT("sys_getdomainname ( %#lx, %ld )",ARG1,ARG2); PRE_REG_READ2(long, "getdomainname", char *, buf, int, len); PRE_MEM_WRITE( "getdomainname(buf, len)", ARG1, ARG2 ); @@ -727,14 +741,14 @@ /* int setdomainname(char *domainname, int len); */ PRE(sys_setdomainname) { - PRINT("sys_setdomainname ( %p )",ARG1); + PRINT("sys_setdomainname ( %#lx )",ARG1); PRE_REG_READ1(long, "setdomainname", char *, buf); PRE_MEM_RASCIIZ( "setdomainname(buf)", ARG1 ); } PRE(sys_uname) { - PRINT("sys_uname ( %p )", ARG1); + PRINT("sys_uname ( %#lx )", ARG1); PRE_REG_READ1(long, "uname", struct utsname *, buf); PRE_MEM_WRITE( "uname(buf)", ARG1, sizeof(struct vki_utsname) ); } @@ -748,7 +762,7 @@ PRE(sys_lstat) { - PRINT("sys_lstat ( %p(%s), %p )",ARG1,ARG1,ARG2); + PRINT("sys_lstat ( %#lx(%s), %#lx )",ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "lstat", char *, file_name, struct stat *, buf); PRE_MEM_RASCIIZ( "lstat(file_name)", ARG1 ); PRE_MEM_WRITE( "lstat(buf)", ARG2, sizeof(struct vki_stat) ); @@ -764,7 +778,7 @@ PRE(sys_stat) { - PRINT("sys_stat ( %p(%s), %p )",ARG1,ARG1,ARG2); + PRINT("sys_stat ( %#lx(%s), %#lx )",ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "stat", char *, file_name, struct stat *, buf); PRE_MEM_RASCIIZ( "stat(file_name)", ARG1 ); PRE_MEM_WRITE( "stat(buf)", ARG2, sizeof(struct vki_stat) ); @@ -777,7 +791,7 @@ PRE(sys_fstat) { - PRINT("sys_fstat ( %d, %p )",ARG1,ARG2); + PRINT("sys_fstat ( %ld, %#lx )",ARG1,ARG2); PRE_REG_READ2(long, "fstat", unsigned long, fd, struct stat *, buf); PRE_MEM_WRITE( "fstat(buf)", ARG2, sizeof(struct vki_stat) ); } @@ -789,20 +803,20 @@ PRE(sys_pathconf) { - PRINT("sys_pathconf ( %p(%s), %d )",ARG1,ARG1,ARG2); + PRINT("sys_pathconf ( %#lx(%s), %ld )",ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "pathconf", char *, file_name, int, name); PRE_MEM_RASCIIZ( "pathconf(file_name)", ARG1 ); } PRE(sys_fpathconf) { - PRINT("sys_fpathconf ( %d, %d )",ARG1,ARG2); + PRINT("sys_fpathconf ( %ld, %ld )",ARG1,ARG2); PRE_REG_READ2(long, "fpathconf", int, fd, int, name); } PRE(sys_lchmod) { - PRINT("sys_lchmod ( %p(%s), %d )", ARG1,ARG1,ARG2); + PRINT("sys_lchmod ( %#lx(%s), %ld )", ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "lchmod", const char *, path, vki_mode_t, mode); PRE_MEM_RASCIIZ( "lchmod(path)", ARG1 ); } @@ -821,7 +835,7 @@ PRE(sys_undelete) { *flags |= SfMayBlock; - PRINT("sys_undelete ( %p(%s) )", ARG1,ARG1); + PRINT("sys_undelete ( %#lx(%s) )", ARG1,(char *)ARG1); PRE_REG_READ1(long, "undelete", const char *, pathname); PRE_MEM_RASCIIZ( "undelete(pathname)", ARG1 ); } @@ -835,7 +849,7 @@ #if 0 PRE(sys_sysinfo) { - PRINT("sys_sysinfo ( %p )",ARG1); + PRINT("sys_sysinfo ( %#lx )",ARG1); PRE_REG_READ1(long, "sysinfo", struct sysinfo *, info); PRE_MEM_WRITE( "sysinfo(info)", ARG1, sizeof(struct vki_sysinfo) ); } @@ -851,7 +865,7 @@ PRE(sys___sysctl) { - PRINT("sys_sysctl ( %p, %d, %p, %p, %p, %d )", ARG1,ARG2,ARG3,ARG4,ARG5,ARG6 ); + PRINT("sys_sysctl ( %#lx, %ld, %#lx, %#lx, %#lx, %ld )", ARG1,ARG2,ARG3,ARG4,ARG5,ARG6 ); PRE_REG_READ6(long, "__sysctl", int *, name, unsigned int, namelen, void *, old, vki_size_t *, oldlenp, void *, new, vki_size_t, newlen); PRE_MEM_READ("sysctl(name)", ARG1, ARG2 * sizeof(int *)); @@ -873,7 +887,7 @@ PRE(sys_sendfile) { *flags |= SfMayBlock; - PRINT("sys_sendfile ( %d, %d, %llu, %d, %p, %p, %lu )", ARG1,ARG2,LOHI64(ARG3,ARG4),ARG5,ARG6,ARG7,ARG8); + PRINT("sys_sendfile ( %ld, %ld, %llu, %ld, %#lx, %#lx, %lu )", ARG1,ARG2,LOHI64(ARG3,ARG4),ARG5,ARG6,ARG7,ARG8); PRE_REG_READ7(ssize_t, "sendfile", int, fd, int, s, unsigned int, offset_low, unsigned int, offset_high, @@ -892,7 +906,7 @@ PRE(sys_getdirentries) { *flags |= SfMayBlock; - PRINT("sys_getdents ( %d, %p, %d )", ARG1,ARG2,ARG3); + PRINT("sys_getdents ( %ld, %#lx, %ld )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getdirentries", unsigned int, fd, struct dirent *, dirp, unsigned int, count); @@ -911,19 +925,19 @@ PRE(sys_seteuid) { - PRINT("sys_seteuid ( %d )", ARG1); + PRINT("sys_seteuid ( %ld )", ARG1); PRE_REG_READ1(long, "seteuid", vki_uid_t, uid); } PRE(sys_setegid) { - PRINT("sys_setegid ( %d )", ARG1); + PRINT("sys_setegid ( %ld )", ARG1); PRE_REG_READ1(long, "setegid", vki_gid_t, gid); } PRE(sys_lutimes) { - PRINT("sys_lutimes ( %p(%s), %p )", ARG1,ARG1,ARG2); + PRINT("sys_lutimes ( %#lx(%s), %#lx )", ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "lutimes", char *, filename, struct timeval *, tvp); PRE_MEM_RASCIIZ( "lutimes(filename)", ARG1 ); if (ARG2 != 0) @@ -932,7 +946,7 @@ PRE(sys_futimes) { - PRINT("sys_lutimes ( %d, %p )", ARG1,ARG2); + PRINT("sys_lutimes ( %ld, %#lx )", ARG1,ARG2); PRE_REG_READ2(long, "futimes", int, fd, struct timeval *, tvp); if (ARG2 != 0) PRE_MEM_READ( "futimes(tvp)", ARG2, sizeof(struct vki_timeval) ); @@ -940,7 +954,7 @@ PRE(sys_utrace) { - PRINT("sys_utrace ( %p, %lu )", ARG1, ARG2); + PRINT("sys_utrace ( %#lx, %lu )", ARG1, ARG2); PRE_REG_READ2(long, "utrace", const void *, buf, vki_size_t, len); PRE_MEM_READ( "utrace(buf,len)", ARG2, ARG3 ); } @@ -982,7 +996,7 @@ const struct timespec *timeout); */ *flags |= SfMayBlock; - PRINT("sys_kevent ( %d, %p, %d, %p, %d, %p )\n", ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); + PRINT("sys_kevent ( %ld, %#lx, %ld, %#lx, %ld, %#lx )\n", ARG1,ARG2,ARG3,ARG4,ARG5,ARG6); PRE_REG_READ6(long, "kevent", int, fd, struct vki_kevent *, newev, int, num_newev, struct vki_kevent *, ret_ev, int, num_retev, @@ -1007,7 +1021,7 @@ PRE(sys___getcwd) { - PRINT("sys___getcwd ( %p, %u )", ARG1,ARG2); + PRINT("sys___getcwd ( %#lx, %lu )", ARG1,ARG2); PRE_REG_READ2(long, "__getcwd", char *, buf, unsigned int, size); PRE_MEM_WRITE( "__getcwd(buf)", ARG1, ARG2 ); } @@ -1028,7 +1042,7 @@ // returned, not a length. PRE(sys_getfsstat) { - PRINT("sys_getfsstat ( %p, %ld, %d )",ARG1,ARG2,ARG3); + PRINT("sys_getfsstat ( %#lx, %ld, %ld )",ARG1,ARG2,ARG3); PRE_REG_READ3(long, "getfsstat", struct statfs *, buf, long, len, int, flags); PRE_MEM_WRITE( "getfsstat(buf)", ARG1, ARG2 ); } @@ -1042,7 +1056,7 @@ PRE(sys_fhopen) { - PRINT("sys_open ( %p, %d )",ARG1,ARG2); + PRINT("sys_open ( %#lx, %ld )",ARG1,ARG2); PRE_REG_READ2(long, "open", struct fhandle *, fhp, int, flags); PRE_MEM_READ( "fhopen(fhp)", ARG1, sizeof(struct vki_fhandle) ); @@ -1065,7 +1079,7 @@ PRE(sys_fhstat) { - PRINT("sys_fhstat ( %p, %p )",ARG1,ARG2); + PRINT("sys_fhstat ( %#lx, %#lx )",ARG1,ARG2); PRE_REG_READ2(long, "fhstat", struct fhandle *, fhp, struct stat *, buf); PRE_MEM_READ( "fhstat(fhp)", ARG1, sizeof(struct vki_fhandle) ); PRE_MEM_WRITE( "fhstat(buf)", ARG2, sizeof(struct vki_stat) ); @@ -1078,7 +1092,7 @@ PRE(sys_fhstatfs) { - PRINT("sys_fstatfs ( %p, %p )",ARG1,ARG2); + PRINT("sys_fstatfs ( %#lx, %#lx )",ARG1,ARG2); PRE_REG_READ2(long, "fhstatfs", struct fhandle *, fhp, struct statfs *, buf); PRE_MEM_READ( "fhstatfs(fhp)", ARG1, sizeof(struct vki_fhandle) ); @@ -1092,7 +1106,7 @@ PRE(sys_fhstatfs6) { - PRINT("sys_fstatfs6 ( %p, %p )",ARG1,ARG2); + PRINT("sys_fstatfs6 ( %#lx, %#lx )",ARG1,ARG2); PRE_REG_READ2(long, "fhstatfs6", struct fhandle *, fhp, struct statfs *, buf); PRE_MEM_READ( "fhstatfs6(fhp)", ARG1, sizeof(struct vki_fhandle) ); @@ -1106,7 +1120,7 @@ PRE(sys_fstatfs6) { - PRINT("sys_fstatfs6 ( %d, %p )",ARG1,ARG2); + PRINT("sys_fstatfs6 ( %ld, %#lx )",ARG1,ARG2); PRE_REG_READ2(long, "fstatfs6", unsigned int, fd, struct statfs *, buf); PRE_MEM_WRITE( "fstatfs6(buf)", ARG2, sizeof(struct vki_statfs6) ); @@ -1119,7 +1133,7 @@ PRE(sys_statfs6) { - PRINT("sys_statfs6 ( %p(%s), %p )",ARG1,ARG1,ARG2); + PRINT("sys_statfs6 ( %#lx(%s), %#lx )",ARG1,(char *)ARG1,ARG2); PRE_REG_READ2(long, "statfs6", const char *, path, struct statfs *, buf); PRE_MEM_RASCIIZ( "statfs6(path)", ARG1 ); PRE_MEM_WRITE( "statfs(buf)", ARG2, sizeof(struct vki_statfs6) ); @@ -1141,7 +1155,7 @@ PRE(sys_io_setup) { - PRINT("sys_io_setup ( %u, %p )", ARG1,ARG2); + PRINT("sys_io_setup ( %lu, %#lx )", ARG1,ARG2); PRE_REG_READ2(long, "io_setup", unsigned, nr_events, vki_aio_context_t *, ctxp); PRE_MEM_WRITE( "io_setup(ctxp)", ARG2, sizeof(vki_aio_context_t) ); @@ -1200,7 +1214,7 @@ PRE(sys_io_getevents) { *flags |= SfMayBlock; - PRINT("sys_io_getevents ( %llu, %lld, %lld, %p, %p )", + PRINT("sys_io_getevents ( %llu, %lld, %lld, %#lx, %#lx )", (ULong)ARG1,(Long)ARG2,(Long)ARG3,ARG4,ARG5); PRE_REG_READ5(long, "io_getevents", vki_aio_context_t, ctx_id, long, min_nr, long, nr, @@ -1246,7 +1260,7 @@ { Int i; - PRINT("sys_io_submit ( %llu, %ld, %p )", (ULong)ARG1,ARG2,ARG3); + PRINT("sys_io_submit ( %llu, %ld, %#lx )", (ULong)ARG1,ARG2,ARG3); PRE_REG_READ3(long, "io_submit", vki_aio_context_t, ctx_id, long, nr, struct iocb **, iocbpp); @@ -1275,7 +1289,7 @@ PRE(sys_io_cancel) { - PRINT("sys_io_cancel ( %llu, %p, %p )", (ULong)ARG1,ARG2,ARG3); + PRINT("sys_io_cancel ( %llu, %#lx, %#lx )", (ULong)ARG1,ARG2,ARG3); PRE_REG_READ3(long, "io_cancel", vki_aio_context_t, ctx_id, struct iocb *, iocb, struct io_event *, result); @@ -1310,14 +1324,14 @@ PRE(sys_inotify_add_watch) { - PRINT( "sys_inotify_add_watch ( %d, %p, %x )", ARG1,ARG2,ARG3); + PRINT( "sys_inotify_add_watch ( %ld, %#lx, %lx )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "inotify_add_watch", int, fd, char *, path, int, mask); PRE_MEM_RASCIIZ( "inotify_add_watch(path)", ARG2 ); } PRE(sys_inotify_rm_watch) { - PRINT( "sys_inotify_rm_watch ( %d, %x )", ARG1,ARG2); + PRINT( "sys_inotify_rm_watch ( %ld, %lx )", ARG1,ARG2); PRE_REG_READ2(long, "inotify_rm_watch", int, fd, int, wd); } @@ -1327,8 +1341,8 @@ PRE(sys_mq_open) { >>> TRUNCATED FOR MAIL (1000 lines) <<<