History log of /external/strace/defs.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
64aa1b1e2dd14c5259bd349270f4d1e29d4fb421 04-Jun-2014 Zubin Mithra <zubin.mithra@gmail.com> Decode paths associated with file descriptors returned by syscalls

* defs.h (RVAL_FD): New macro.
(RVAL_MASK, RVAL_STR, RVAL_NONE): Update.
* desc.c (sys_dup, sys_delete_module): New functions.
(do_dup2, decode_open, sys_creat): Change return value to RVAL_FD.
* linux/dummy.h (sys_delete_module, sys_dup): Remove.
* linux/syscall.h (sys_delete_module, sys_dup): New prototypes.
* syscall.c (trace_syscall_exiting): Handle RVAL_FD.

Signed-off-by: Zubin Mithra <zubin.mithra@gmail.com>
/external/strace/defs.h
1d78d22058da04eac7bf726c059d5c3fb193da08 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: introduce markers specifying the needs of special care in unwinding

Some system calls require capturing the stack trace before they are
processed in kernel. Typical one is execve. Some system calls require
invalidating mmap cache after they are processed in kernel.

In current implementation these requirements are handled directly by
appropriate syscall handlers. However, it is difficult to keep the
source code maintainable using this approach to cover all system calls
which have such requirements.

A more generic way to implement this is to flag all syscalls that
require special processing, and handle these flags right in
trace_syscall_entering instead of changing syscall handlers.

This patch just defines new flags: STACKTRACE_INVALIDATE_CACHE and
STACKTRACE_CAPTURE_ON_ENTER.

The names of macros are suggested by Dmitry Levin.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/defs.h
9bc6561588093a788c29f07579f9e4103864a752 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: implement automatic mmap cache invalidation

A mmap cache belonging to a tcb was updated when a system call which
changed the memory mapping was called. This implementation was assumed
the mapping was changed only by the tcb. However, this assumption is
incorrect if the target application is multi-threaded; more than two
tcbs can shared the same memory mapping and a tcb can modify it without
being noticed by the others.

This change introduces a global integer variable mmap_cache_generation,
and mmap_cache_generation field to struct tcb. The variable
is incremented each time a process enters a syscall that can modify its
memory mapping. Each tcb records the value of this variable at the
moment if building its mmap cache. Every mmap cache associated with
the given tcb can be validated by comparing its mmap_cache_generation
field with the variable mmap_cache_generation.

This implementation is inefficient. If strace attaches two processes
which don't share the memory mapping, rebuilding mmap cache of a tcb
triggered by another tcb's mmap system call is not necessary.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/defs.h
f8e39d7b7a9d581e634be59af73cf82cb566abf9 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: introduce queue_t for capturing stacktrace

This is the second step for splitting capturing from printing.

New `queue' field is added to tcb. Captured stacktrace is stored here.
The field is initialized/finalized at unwind_tcb_init/unwind_tcb_fin.

New API function unwind_capture_stacktrace is added. This function
captures the currest stack using stracktrace_walker and records it in
tcb. It's printing is delayed to the next call of
unwind_print_stacktrace.

unwind_print_stacktrace is extended. Now it checks queue field of
the given tcb at the start of function. If the function finds a
captured stack trace, the latter is printed using stracktrace_walker.

Currently unwind_capture_stacktrace invocations are added directly to
handlers of mmap, munmap, mprotect, and execve.

Here is the difference of output with/without patch:

(without patch)
execve("./test-fork", ["./test-fork"], [/* 56 vars */]) = 0
> /usr/lib64/ld-2.18.so(check_one_fd.part.0+0x82) [0x11f0]

(with patch)
execve("./test-fork", ["./test-fork"], [/* 54 vars */]) = 0
> /usr/lib64/libc-2.18.so(execve+0x7) [0xbcd27]
> /home/yamato/var/strace/strace(exec_or_die+0x10c) [0x26ac]
> /home/yamato/var/strace/strace(startup_child+0x346) [0x134f6]
> /home/yamato/var/strace/strace(init+0x89f) [0x13dff]
> /home/yamato/var/strace/strace(main+0xa) [0x26ca]
> /usr/lib64/libc-2.18.so(__libc_start_main+0xf5) [0x21d65]
> /home/yamato/var/strace/strace(_start+0x29) [0x2799]

In older version output lines of captured elements were built when
printing. In this version they are built when capturing the stack.
As result, unneeded dynamic memory allocations are avoided.
Suggested by Luca Clementi.

In older version the combination of snprintf and realloc were used.
In this version they are replaced with asprintf.
Suggested by Dmitry Levin.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/defs.h
6141392856a170c9297783e6bfbd9fd970f76fdf 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: give all exported functions "unwind_" prefix

* unwind.c (init_unwind_addr_space): Rename to unwind_init.
(init_libunwind_ui): Rename to unwind_tcb_init.
(free_libunwind_ui): Rename to unwind_tcb_fin.
(delete_mmap_cache): Rename to unwind_cache_invalidate.
(print_stacktrace): Rename to unwind_print_stacktrace.
* defs.h: Update prototypes.
* mem.c: All callers updated.
* process.c: Likewise.
* strace.c: Likewise.
* syscall.c: Likewise.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/defs.h
b65042fbdb576d13e9bb57c21a890539cab25c43 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: make alloc_mmap_cache function local

* defs.h (alloc_mmap_cache): Remove.
* unwind.c (alloc_mmap_cache): Add static qualifier.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/defs.h
327064b63722a4400058e0e7e9b39d9e34b14b57 23-Jul-2013 Luca Clementi <luca.clementi@gmail.com> Add -k option to print stack trace after each syscall

Print the stack trace of the traced process after each system call when
-k option is specified. It is implemented using libunwind to unwind the
stack and to obtain the function name pointed by the IP.

Based on the code that was originally taken from strace-plus
of Philip J. Guo.

* configure.ac: Add --with-libunwind option. Check libunwind support.
* Makefile.am: Add libunwind support.
* defs.h (struct tcb) [USE_LIBUNWIND]: Append libunwind specific fields.
[USE_LIBUNWIND] (stack_trace_enabled, alloc_mmap_cache,
delete_mmap_cache, print_stacktrace): New prototypes.
* mem.c (print_mmap, sys_munmap, sys_mprotect): Add libunwind support.
* process.c (sys_execve): Likewise.
* strace.c (usage, alloctcb, droptcb, init): Likewise.
* syscall.c (trace_syscall_exiting): Likewise.
* unwind.c: New file.
* strace.1: Document -k option.
/external/strace/defs.h
e53bf23f1c33076090b51184b82af4dd98d0c51c 28-May-2014 Mark Hills <Mark.Hills@framestore.com> Optionally produce stats on syscall latency

Time spent in system time is not useful where a syscall depends on some
non-CPU resource, eg. typically open() or stat() to a network drive.

This patch adds a new flag (-w) to produce a summary of the time
difference between beginning and end of the system call (ie. latency)

This functionality has been useful to profile slow processes that
are not CPU-bound.

Signed-off-by: Mark Hills <mark.hills@framestore.com>
/external/strace/defs.h
ac5133d0cb5c18a39f6fa9b7ca2ebcba9277a904 29-May-2014 Dmitry V. Levin <ldv@altlinux.org> Constify count_syscall function

* count.c (count_syscall): Add const qualifier to timeval argument and
rename it. Store the wall clock time spent while in syscall in separate
timeval variable.
* defs.h (count_syscall): Update prototype.
* syscall.c (trace_syscall_exiting): Update count_syscall invocation.
/external/strace/defs.h
447db45365e37ec97c41b26b5a24e38d58e4f3ae 29-May-2014 Dmitry V. Levin <ldv@altlinux.org> Constify tv_* functions

* defs.h (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div): Add
const qualifier to read only arguments.
* util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_mul, tv_div):
Likewise.
/external/strace/defs.h
3b09ebe724b1ee233ce2314a8b70a4dfdf9d2b07 02-May-2014 James Hogan <james.hogan@imgtec.com> Fix {get,set}rlimit decoding with unreliable SIZEOF_RLIM_T

When strace is built with large file support definitions in CFLAGS (as
may be provided by buildroot) the C library headers may expose a 64-bit
rlim_t even though the struct rlimit fields used by the system call
interface are only 32-bit. The SIZEOF_RLIM_T will then be 8 which
results in bad decoding of the getrlimit and setrlimit syscalls.

This is fixed by replacing unreliable SIZEOF_RLIM_T based checks with
checks for current_wordsize.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/defs.h
7845a42b39e59e904d01e75e21f7bc7eb6462560 17-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> Fix preadv/pwritev offset decoding

* util.c (printllval): Add align argument.
* defs.h (printllval): Update prototype.
(printllval_aligned, printllval_unaligned): New macros.
* file.c (sys_readahead, sys_truncate64, sys_ftruncate64, sys_fadvise64,
sys_fadvise64_64, sys_sync_file_range, sys_sync_file_range2,
sys_fallocate): Replace printllval call with printllval_aligned.
* io.c (sys_pread, sys_pwrite): Likewise.
(sys_preadv, sys_pwritev): Replace printllval call with
printllval_unaligned.
* linux/arm/syscallent.h: Set the number of preadv and pwritev
arguments to 5.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.

Reported-by: Dima Kogan <dima@secretsauce.net>
/external/strace/defs.h
99db95dd039d8fd700e7759bf4969abb55b979b9 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Implement fanotify_init and fanotify_mark decoding

* fanotify.c: New file.
* linux/fanotify.h: Likewise.
* Makefile.am (strace_SOURCES): Add fanotify.c.
(EXTRA_DIST): Add linux/fanotify.h.
* defs.h (print_dirfd): New prototype.
* file.c (print_dirfd): Export.
* linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove.
* linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New
prototypes.
* pathtrace.c (pathtrace_match): Handle sys_fanotify_init and
sys_fanotify_mark.
/external/strace/defs.h
82b1ea7c3fc854d5ea805f490d351d443701d60b 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Itroduce XLAT_END macro to make xlat structures more compact

* defs.h (XLAT_END): New macro.
/external/strace/defs.h
a69ddcb672f326418aaa74f399f600f69d074758 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Introduce XLAT macro to ease maintenance of xlat structures

* defs.h (XLAT): New macro.

Suggested-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/defs.h
b88a6f877eb08e6d45130374fc1a1867371db703 31-Jan-2014 Stefan Sørensen <stefan.sorensen@spectralink.com> Decode ptp ioctls

* defs.h (ptp_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='.
* Makefile.am (strace_SOURCES): Add ptp.c.
(EXTRA_DIST): Add linux/ptp_clock.h.
* ptp.c: New file.
* linux/ptp_clock.h: New file.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/defs.h
03ef0b2665363adf6100bc4af479a14b5f17bc27 13-Nov-2013 Dmitry V. Levin <ldv@altlinux.org> Assume that <sys/ptrace.h> provides a valid ptrace prototype

We used to explicitly list architectures where <sys/ptrace.h> from glibc
is known to provide a valid prototype for ptrace, and use a homegrown
replacement for all the rest. Situation seems to be better nowadays,
glibc is not the only libc available, so let's use ptrace prototype from
<sys/ptrace.h> by default, leaving the replacement for rare broken cases
if any.

* defs.h: Use ptrace prototype workaround iff
NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.
/external/strace/defs.h
0506f0f430c15677c7724f9c4500093e0e7e15d3 12-Nov-2013 Dmitry V. Levin <ldv@altlinux.org> Stop using _LFS64_LARGEFILE

There is only one place left in the code where strace guesses whether
libc provides LFS64 functions and structures. The most natural thing to
do there is to check for _LARGEFILE64_SOURCE - the macro provided by
glibc. Other libc implementations that provide nondegenerate LFS64
interfaces are expected to define this macro as well.

* defs.h (_LFS64_LARGEFILE): Remove.
* strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE.
/external/strace/defs.h
6974bd4f5fae1e78791cf64a6aebc1da2ded25fe 12-Nov-2013 Dmitry V. Levin <ldv@altlinux.org> Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specific

* configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and
PTRACE_POKEUSER.
* defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if
they are not provided by <sys/ptrace.h>.

Reported by John Spencer.
/external/strace/defs.h
b338f2d65ea9d911a0fead3229ba336bc30e6214 09-Nov-2013 Denys Vlasenko <dvlasenk@redhat.com> Fix select decoding on e.g. 32-bit ppc process by 64-bit strace.

Added next_set_bit() function which finds the next set bit,
properly taking into account word size of the traced process.
Use it in decode_select() instead of fd_isset().
Also, properly round fdsize up to word size of traced process,
not to strace's word size.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
7daacbbbe7349677476a3d2fbf174dcf86f171be 15-Aug-2013 Vineet Gupta <Vineet.Gupta1@synopsys.com> Add support for ARC Cores from Synopsys

Take #2 on mainlining strace support for ARC (last one was 4.6 based back
in March 2011), see
http://sourceforge.net/p/strace/mailman/message/27210168/

The syscall ABI is asm-generic/unistd.h based (so no legacy syscalls),
hence very similar to metag port.

test/* all seem to work well.

* linux/arc/ioctlent.h.in: New file.
* linux/arc/syscallent.h: Likewise.
* Makefile.am (EXTRA_DIST): Add linux/arc/ioctlent.h.in and
linux/arc/syscallent.h.
* configure.ac: Add ARC to the list of supported architectures.
* defs.h: Add ARC support.
* process.c (struct_user_offsets): Likewise.
* signal.c (sys_sigreturn): Likewise.
* syscall.c (print_pc, get_regset, get_regs, get_scno, get_syscall_args,
get_syscall_result, get_error): Likewise.
* util.c (change_syscall): Likewise.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/defs.h
5e133aa68498626afdbdcf29e22300257a21bf57 18-Jul-2013 Denys Vlasenko <dvlasenk@redhat.com> Fix sigset printing via print_sigset().

Replace print_sigset() with print_sigset_addr_len(),
which takes not only addr, but also len parameter.
This allows us to drop "do we need to print RT signals?" parameter,
and this fixes RT signals printing in many syscalls.

sys_epoll_pwait: print RT signals too, print sigmask size argument.

sys_sigprocmask: print_sigset -> print_sigset_addr_len(current_wordsize),
no change in functionality.

sys_sigpending: use print_sigset_addr_len(current_wordsize)
instead of open-coding it.

sys_rt_sigprocmask: use print_sigset_addr_len instead of open-coding it.
sys_rt_sigpending: ditto.
sys_rt_sigsuspend: ditto.
sys_rt_sigtimedwait: ditto.

do_signalfd: print_sigset -> print_sigset_addr_len. This fixes
RT signals printing (wasn't showing them before).

sys_ppoll: ditto.

copy_sigset_len() is folded into its only user, print_sigset_addr_len(),
and copy_sigset() is gone.

While at it, checked kernel sources and noted where kernel enforces
sigset_size == NSIG / 8 (== sizeof(kernel_sigset_t)),
and where it allows word-sized sigset_size ([rt_]sigpending).

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
76da831a4159a58cd321328498496e772e3b4afc 16-Jul-2013 Denys Vlasenko <dvlasenk@redhat.com> Group USE_CUSTOM_PRINTF define with other tweakables

No code changes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
b51f364c4241aa247a7a22f92c06f1f1a4ab99b4 16-Jul-2013 Denys Vlasenko <dvlasenk@redhat.com> Improve sigreturn decoding on x86 to show RT signal bits too.

This includes decoding of 32-bit sigreturn by 64-bit strace,
which previously wasn't done.

Added a test for it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
a34deadbb3419909d691de514a298f6b748f2d95 12-Jul-2013 Anton Blanchard <anton@samba.org> powerpc: fix iflag build issue (static -> extern)

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
5a2483ba25fd80cb189abcdc14624be72b0c4c0b 01-Jul-2013 Denys Vlasenko <dvlasenk@redhat.com> Remove ia64-specific printing of current address on signal delivery

The address is printed anyway by printleader() if -i is active.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
c09646aa9e8768d308267bb92747b2d1ff58b1c3 01-Jul-2013 Denys Vlasenko <dvlasenk@redhat.com> Rename ia32 to ia64_ia32mode, and make it bool, not long

Grepping for just ia32 was turning up many false positives.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
4793221a53fb69aa519bc91ab19a79524c0df097 30-Jun-2013 Denys Vlasenko <dvlasenk@redhat.com> Fold is_restart_error() into its sole user

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
752e5a02e67f66f555aa39faf522f07126924e62 28-Jun-2013 Denys Vlasenko <dvlasenk@redhat.com> Change upeek() to take pid, not full tcp.

This will be used by next change.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
ce6e33be1dbfc16620ea7991a414e879ef84fe22 26-Jun-2013 Anton Blanchard <anton@samba.org> powerpc: Use PTRACE_GETREGS to fetch all registers

* defs.h: declare ppc_regs and get_regs_error.
* signal.c (sys_sigreturn): Use ppc_regs instead of upeek.
* syscall.c: define ppc_regs.
(printcall): Use ppc_regs instead of upeek.
(get_scno): Replace multiple upeek calls with one PTRACE_GETREGS call.
(get_syscall_result): Likewise.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
fadbf6679cb52d4265a771cbb8635a2ff472e869 26-Jun-2013 Denys Vlasenko <dvlasenk@redhat.com> Get rid of TCB_INUSE and TCB_STRACE_CHILD

We can use tcb::pid == 0 as an indicator of free tcb,
and we already have strace_child variable which holds
pid of our child, if any.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
f1669e7975cb8d67448d52d9ae7dde3301d27273 18-Jun-2013 Denys Vlasenko <dvlasenk@redhat.com> Cleanups. No logic changes.

* defs.h: Define new ptrace constants unconditionally.
* strace.c (detach): Fix comment.
(trace): Remove now unnecessary "if USE_SEIZE".

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
2a3d27552f17a5b378344620bec7d255bac65a8d 14-May-2013 Denys Vlasenko <dvlasenk@redhat.com> Hide startup syscalls.

Tested with "./strace [-D] [-q] [-bexecve] env true",
all cases seem to work.

* defs.h: Declare new variable: bool hide_log_until_execve.
* strace.c: Define hide_log_until_execve.
Rename skip_startup_execve to skip_one_b_execve.
(startup_child): Do not set skip_one_b_execve = 1 here.
(init): If "strace PROG" case (as opposed to "strace -pPID"),
set skip_one_b_execve and hide_log_until_execve to 1.
(trace): Don't print signal messages if hide_log_until_execve == 1.
* syscall.c (trace_syscall_entering):
Skip syscall printing if hide_log_until_execve == 1.
Reset hide_log_until_execve if we enter execve syscall.
(trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
01997cf32d4492b9898283ced45e8a4a6fd161b8 13-May-2013 Daniel P. Berrange <berrange@redhat.com> Allow -q to be repeated for very quiet output

Even with the -q flag specified, tracing output is still mixed
with messages about signals and process exit status, which is
often irrelevant. Allow the -q option to be repeated to force
the suppression of signals / exit status info too.

* defs.h: Change 'qflag' from 'bool' to 'unsigned int'.
* strace.1: Document ability to repeat '-q' option.
* strace.c: Allow '-q' to be repeated to quieten process
exit status and signal messages.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
/external/strace/defs.h
3883ab84388efe01962e4164911508af24d3f2f5 07-May-2013 Mike Frysinger <vapier@gentoo.org> mips: fix build regression

The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled
the mips headers around causing it to check the ABI defines before it
included the header which set those up. Now all mips builds fail with:
In file included from count.c:36:0:
defs.h:48:4: error: #error Unsupported _MIPS_SIM

* defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check.
/external/strace/defs.h
2690fadc8b35190dddd29274a7405bac13adc469 07-May-2013 Dmitry V. Levin <ldv@altlinux.org> mips o32: raise the max number of syscall arguments to 7

On mips o32, fadvise64_64 takes 7 arguments.

* defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7.
/external/strace/defs.h
d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e 02-May-2013 Mike Frysinger <vapier@gentoo.org> Decode mtd/ubi ioctls

Been playing with UBI of late and it'd help if I could see what it was
doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
a pointer to a 64bit value, not a strict.

* util.c (MAX, MIN): Move to ...
* defs.h (MAX, MIN): ... here.
(CLAMP): Define.
(ubi_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
* mtd.c: Include ubi user API header.
(ubi_volume_types): New enum decode.
(ubi_volume_props): Likewise.
(ubi_ioctl): Define.
* linux/ubi-user.h: Import from linux 3.8.
/external/strace/defs.h
8f636ed12870cdc8e4b38194eb4b701f42ad222b 25-Mar-2013 Chris Zankel <chris@zankel.net> Add support for the XTENSA architecture

* configure.ac: Add XTENSA to the list of supported architectures.
* defs.h: Add XTENSA support.
* linux/xtensa/syscallent.h: New file.
* linux/xtensa/ioctlent.h.in: Likewise.
* process.c (struct_user_offsets): Add XTENSA support.
* signal.c (sys_sigreturn): Likewise.
* syscall.c (printcall, get_scno, get_syscall_args,
get_syscall_result, get_error): Likewise.
* util.c (change_syscall): Likewise.

Signed-off-by: Chris Zankel <chris@zankel.net>
/external/strace/defs.h
7d5696f11d3c02045001b4ab91a11700f7e05f75 18-Mar-2013 Dmitry V. Levin <ldv@altlinux.org> i386, tile, x32: do not redefine ptrace prototype

* defs.h [I386 || TILE || X32]: Use ptrace prototype from sys/ptrace.h.
/external/strace/defs.h
5198ed4bb36e3105a1f12bb3250bee78b6e0dd72 06-Mar-2013 Denys Vlasenko <vda.linux@googlemail.com> Open-code isprint(c) and isspace(c)

We don't call setlocale, thus we always use C locale.
But libc supports various other locales, and therefore
its ctype interface is general and at times inefficient.
For example, in glibc these macros result in function call,
whereas for e.g. isprint(c) just c >= ' ' && c <= 0x7e
suffices.

By open-coding ctype checks (we have only 4 of them)
we avoid function calls, we get smaller code:

text data bss dec hex filename
245127 680 5708 251515 3d67b strace_old
245019 676 5708 251403 3d60b strace

and we don't link in ctype tables (beneficial for static builds).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
61ad0a401c6d1b7b4c1a209f9d61c3790e1e7d15 06-Mar-2013 Denys Vlasenko <vda.linux@googlemail.com> Stop using a large static buffer in getfdpath

text data bss dec hex filename
245075 680 9836 255591 3e667 strace_old
245143 680 5708 251531 3d68b strace

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
38cfe7c92328e940c71074c9b579b5bf9f2cb2f6 05-Mar-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove variable tracing_paths and check in pathtrace_match

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
7239dbcf2dff792f408c60fe3e278f707fdf497b 05-Mar-2013 Denys Vlasenko <vda.linux@googlemail.com> Use dynamically-sized selected[] array for -P PATH

While at it, added a small optimization of not remembering
the path twice if it happens to be the same.

text data bss dec hex filename
245111 680 10860 256651 3ea8b strace_old
245075 680 9804 255559 3e647 strace

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
5f999a869b681ff69cbb801225677fc125b6aefd 22-Feb-2013 James Hogan <james.hogan@imgtec.com> Add support for Imagination Technologies Meta

Add support for Imagination Technologies Meta architecture (the
architecture/ABI is usually referred to as metag in code). The Meta
Linux kernel port is in the process of being upstreamed for v3.9 so it
uses generic system call numbers.

sys_lookup_dcookie writes a filename to buffer argument, so I've set
TF flag.
nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h
so I've left it blank.
truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit
args which are packed tightly on metag, so less arguments on metag.
fchdir/llseek takes a file descriptor so s/TF/TD/
sync_file_range has 2 64bit args so uses 6 args, so s/4/6/
timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/
shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args.
oldgetrlimit is just getrlimit for metag.
add TM flag to various memory syscalls.
metag doesn't directly use sys_mmap_pgoff for mmap2.
prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag.
fanotify_init doesn't appear to take a file descriptor so remove TD.
Add kcmp syscall.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Christian Svensson <blue@cmd.nu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
05f325199a6cf36c92560d5a08b56652502705c2 26-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Assorted NOMMU fixes

With -D, strdup'ing of pathname is necessary only on NOMMU.

Don't set skip_startup_execve to 1 if NOMMU and not in daemonized mode
(try "strace [-D] -b env echo HI" to see whether we detach on correct execve).

Fix test_ptrace_FOO shortcuts on NOMMU to always assume success
and _properly_ set all variables.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
9cbc15b7e72b2f108b886f89778ae606c7b6a526 22-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Eliminate MAX_QUALS, make qualifier array dynamic

MAX_QUALS was 2048, even though most arches used less than 500 entries
in it. MAX_QUALS had to be maintained by hand to be higher than syscall
count. It also limited the highest possible fd to track.

This change makes qual_flagsN[] arrays start sized to the required minimum
(number of syscalls) and grow dynamically if user requested
-e read=BIGNUM. As a precaution, BIGNUM should be < 2^15, but this limit
can be raised with no cost for normal strace invocations.

qual_flags is now a define to qual_vec[current_personality].

As a bonus, this patch aliases sysent, errnoent, signalent, ioctlent
names in one-personality arches to their corresponding <foo>0 arrays,
removing one indirection level.

text data bss dec hex filename
244471 700 12928 258099 3f033 strace.t7/strace
244627 680 10860 256167 3e8a7 strace.t8/strace

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a9fe13c9437707fa132fde4e51a20d88381e7430 22-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Create and use struct_sysent and struct_ioctlent typedefs.

This is a preparatory mass replace patch with no code changes.

The future change will need to typedef sysent to sysent0,
which results in compile failures when "struct sysent" string
gets mangled into "struct sysent0".

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
40d63b9a92e049986fce1fb91cca10fdd3d3a64a 22-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Use tcp->qual_flg instead of qual_flags[] in verbose() and abbrev()

We have hundreds of uses of these macros.
Result is more efficient and 1.1 kbyte shorter code:

text data bss dec hex filename
245579 700 12928 259207 3f487 strace.t5/strace
244471 700 12928 258099 3f033 strace.t6/strace

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
c1540fe19d0980be3f6a218c91a03983f8a86009 21-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove unused QUAL_FAULT code (was used by non-Linux code only).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a585c9d6416d5ca7e3af3ffd4887205f06f8286d 21-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Use uint8_t for qual_flags[] instead of ints.

Resulting bss reduction is ~6kbytes:

text data bss dec hex filename
245703 700 19072 265475 40d03 strace.t4/strace
245687 700 12928 259315 3f4f3 strace.t5/strace

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
74ec14f968a418691b851cbbfeb0269174c64b08 21-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Eliminate many SCNO_IS_VALID checks

By adding tcp->s_ent pointer tot syscall table entry,
we can replace sysent[tcp->scno] references by tcp->s_ent.
More importantly, we may ensure that tcp->s_ent is always valid,
regardless of tcp->scno value. This allows us to drop
SCNO_IS_VALID(tcp->scno) checks before we access syscall
table entry.

We can optimize (qual_flags[tcp->scno] & QUAL_foo) checks
with a similar technique.

Resulting code shrink:
text data bss dec hex filename
245975 700 19072 265747 40e13 strace.t3/strace
245703 700 19072 265475 40d03 strace.t4/strace

* count.c (count_syscall): Use cheaper SCNO_IN_RANGE() check.
* defs.h: Add "int qual_flg" and "const struct sysent *s_ent"
to struct tcb. Remove "int u_nargs" from it.
Add UNDEFINED_SCNO constant which will mark undefined scnos
in tcp->qual_flg.
* pathtrace.c (pathtrace_match): Drop SCNO_IS_VALID check.
Use tcp->s_ent instead of sysent[tcp->scno].
* process.c (sys_prctl): Use tcp->s_ent->nargs instead of tcp->u_nargs.
(sys_waitid): Likewise.
* strace.c (init): Add compile-time check that DEFAULT_QUAL_FLAGS
constant is consistent with init code.
* syscall.c (decode_socket_subcall): Use tcp->s_ent->nargs
instead of tcp->u_nargs. Set tcp->qual_flg and tcp->s_ent.
(decode_ipc_subcall): Likewise.
(printargs): Use tcp->s_ent->nargs instead of tcp->u_nargs.
(printargs_lu): Likewise.
(printargs_ld): Likewise.
(get_scno): [MIPS,ALPHA] Use cheaper SCNO_IN_RANGE() check.
If !SCNO_IS_VALID, set tcp->s_ent and tcp->qual_flg to default values.
(internal_fork): Use tcp->s_ent instead of sysent[tcp->scno].
(syscall_fixup_for_fork_exec): Remove SCNO_IS_VALID check.
Use tcp->s_ent instead of sysent[tcp->scno].
(get_syscall_args): Likewise.
(get_error): Drop SCNO_IS_VALID check where it is redundant.
(dumpio): Drop SCNO_IS_VALID check where it is redundant.
Use tcp->s_ent instead of sysent[tcp->scno].
(trace_syscall_entering): Use (tcp->qual_flg & UNDEFINED_SCNO) instead
of SCNO_IS_VALID check. Use tcp->s_ent instead of sysent[tcp->scno].
Drop SCNO_IS_VALID check where it is redundant.
Print undefined syscall name with undefined_scno_name(tcp).
(trace_syscall_exiting): Likewise.
* util.c (setbpt): Use tcp->s_ent instead of sysent[tcp->scno].

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
7270de551ca6b3ea097c114005b6b028990ce3dc 21-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> ARM: make it one-personality arch

ARM in fact _is_ one personality.

We had two personalities for it because it has a handful of
syscalls with huge scnos (0x000f00xx).

Extending syscall table to have [0x000f0005] index is of course
not a good idea.

Someone decided to handle that by having a separate personality
just for these syscalls.

But multi-personality arch does a bit more work in other parts.

This patch is another alternative: "move" 0x000f00nn syscalls
down to the entries just above last ordinary syscall,
by manipulating scno if it falls into the 0x000f00xx range.

In order to not worsen genuine undefined scnos' printing,
the code remaps scno back to actual value before printing
"syscall_NNN" string.

* defs.h: Remove multi-reprsonality defines from ARM.
* syscall.c (shuffle_scno): New function.
(undefined_scno_name): New function.
(get_scno): [ARM] Replace personality setting with scno shuffling.
(trace_syscall_entering): Print unknown syscall name using
undefined_scno_name().
(trace_syscall_exiting): Likewise.
* linux/arm/syscallent.h: Add ARM specific syscalls at the end.
* linux/arm/errnoent1.h: Deleted.
* linux/arm/ioctlent1.h: Deleted.
* linux/arm/signalent1.h: Deleted.
* linux/arm/syscallent1.h: Deleted.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
4bfb198db17d9a6b83f104d4f1e184664db78391 20-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Use the same style of includes in linux/*/* files

While at it, fix some comments which say
"we use i386 syscalls/ioctls/errnos" but in reality
common ones are used.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
5c9d8f4fc5318fc740ec2a16bac5b8a29e7eb52d 19-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Make it possible to to do test builds for NOMMU architectures

And while using it, I discovered that -D doesn't work too well
on NOMMU. Added a comment about it.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
c9d0fc0a63d5b425d6a4e9fedb4cb7a8e3129d6c 17-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove broken HAVE_LONG_LONG conditionals

We use printllval without HAVE_LONG_LONG guards in many places,
but define it only if HAVE_LONG_LONG. This means that
on !HAVE_LONG_LONG systems we won't build for some time now.

* defs.h: Remove HAVE_LONG_LONG guard around LONG_LONG() macro
and printllval() function declaration.
* util.c: Remove HAVE_LONG_LONG guard around printllval()
function definition.
(printllval): Add compile-time error check for using wrong
if branch. Explain places where we deliberately use mismatched
types for printf formats.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
86738a232d74ddea29d2b9c90e8d036f63c438fd 17-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Merge two identical tables

* defs.h: Declare whence_codes[].
* desc.c: Delete static whence[].
(printflock[64]): Use whence_codes.
* file.c: Make whence_codes[] non-static.
Add SEEK_DATA and SEEK_HOLE to them.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
c956ef085f5685b47bd7a66d0bff5abcb0a50484 16-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Simple optimization in get_error

* defs.h: Define SCNO_IN_RANGE(scno) macro.
* syscall.c (get_error): Change return type to void.
Use SCNO_IN_RANGE instead of SCNO_IS_VALID.
(trace_syscall_exiting): Stop checking get_error() return value.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
5721cdbcdba76eef854a30e7e56e328eae976e44 16-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Mass rename of SCNO_IN_RANGE define to SCNO_IS_VALID

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
48e4c1bf4dcfa9730c4ac4fc9b8d115569ef389b 16-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Finish prefixing regs struct names with arch_

* defs: Rename regs -> sparc_regs.
* signal.c (sys_sigreturn): Use new variable name.
* syscall.c: Rename regs -> sparc_regs, regs -> avr32_regs.
(getrval2): Use new variable names.
(printcall): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
2550d4890eae4d2d32ec6be0185eef6d30ce0124 15-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Use the same type for i386_regs on 32-bit and 64-bit x86.

* defs.h: Stop including <asm/ptrace.h> for x86.
Change i386_regs from "struct pt_regs" to "struct user_regs_struct".
* syscall.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
e015d2d331c75b912e3dd96532e2c31ae0e06554 15-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Macroize conditional signed widening operation

* defs.h: Define widen_to_long() macro.
* signal.c (sys_kill): Use it instead of open-coding it.
(sys_tgkill): Use widen_to_long() on pids.
* resource.c (decode_rlimit): Formatting fix.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
ae8643e671db5c574ecba6aa7fe9012f286dc257 15-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> A better handling of current_wordsize

On x86_64:
text data bss dec hex filename
435661 26628 47424 509713 7c711 strace_old
435501 26612 47440 509553 7c671 strace_new_clever_wordsize

On x32 and arm it should be even better, current_wordsize becomes
a constant there.

* defs.h: Declare current_wordsize as a variable if needed,
else declare as a constant define.
Remove declatation of personality_wordsize[].
* syscall.c: Make personality_wordsize[] static.
Declare current_wordsize as a variable if needed.
(set_personality): Set current_wordsize only if non-constant.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
492f81f14cc86c13b0f67ac66a3d5ea9f6ccb673 14-Feb-2013 Christian Svensson <blue@cmd.nu> Add support for the OpenRISC 1000 platform

* configure.ac: Added or1k architecture..
* defs.h: Added or1k to use register reading system.
* linux/or1k/ioctlent.h.in: Use i386 ioctls.
* linux/or1k/syscallent.h: New file.
* process.c: Added or1k register defs to struct_user_offsets[].
* syscall.c: Added or1k_io iovec for or1k GETREGSET,
  regset structure for or1k.
  (printcall): Added handling for or1k.
  (get_regs): Likewise.
  (get_scno): Likewise.
  (get_syscall_args): Likewise.
  (get_syscall_result): Likewise.
(get_error): Likewise.
* util.c (change_syscall): Added dummy handling for or1k.
* system.c (sys_or1k_atomic): New function (or1k specific syscall).

Signed-off-by: Christian Svensson <blue@cmd.nu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
eec8d5d6b028665a73169fda96e4e873cb8351f0 14-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> [X86] Use ptrace(PTRACE_GETREGSET, NT_PRSTATUS) to get registers.

Unlike PTRACE_GETREGS, this new method detects 32-bit processes
reliably, without checking segment register values which
are undocumented and aren't part of any sort of API.
While at it, also fixed x32 detection to use __X32_SYSCALL_BIT,
as it should have been from the beginning.

* defs.h: Declare os_release and KERNEL_VERSION.
* strace.c: Make os_release non-static, remove KERNEL_VERSION define.
* syscall.c: New struct i386_user_regs_struct,
static union x86_regs_union and struct iovec x86_io.
(printcall): Use i386_regs or x86_64_regs depending on x86_io.iov_len.
(get_regs): On x86 and kernels 2.6.30+, use PTRACE_GETREGSET,
on earlier kernels fall back to old method.
(get_scno): [X86] Determine personality based on regset size
on scno & __X32_SYSCALL_BIT.
(syscall_fixup_on_sysenter): Use i386_regs or x86_64_regs depending
on x86_io.iov_len.
(get_syscall_args): Likewise.
(get_error): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
d4d3edefe74787a194a2472d99a673f6d4a2721a 13-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Factor out code to check addr, fetch and print siginfo

* defs.h: Declare new function printsiginfo_at(tcp, addr).
* process.c (sys_waitid): Use printsiginfo_at().
(sys_ptrace): Likewise.
* signal.c: (printsiginfo_at): Implement this new function.
(sys_rt_sigsuspend): Use printsiginfo_at().
(sys_rt_sigtimedwait): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
bf357fcb76baeb64a45fc2b6b355c913c63e6015 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove hacks for old kernels for architectures which require new kernels

* defs.h: Do not define TCB_WAITEXECVE for AARCH64.
* util.c (change_syscall): For AARCH64 and X32, replace code
with dummy "return 0" and a comment explaining why that is ok
for these architectures.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
d27809c978f3c8c3271f7d726dc92dd0eefa8a0f 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove old kernel hacks for architectures which require new kernels

* defs.h: Do not define TCB_WAITEXECVE for AVR32, BFIN and TILE.
* util.c (change_syscall): For AVR32, BFIN and TILE, replace code
with dummy "return 0" and a comment explaining why that is ok
for these architectures.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
9472a27b79a6820b5bdf37647c04a7e1d8790737 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Remove unused / ambiguously used defines

We sometimes use LINUXSPARC and sometimes (more often)
use "defined(SPARC) || defined(SPARC64)". Better to use
one construct consistently.
LINUX_MIPS64 is altogether unused.

* defs.h: Remove LINUXSPARC and LINUX_MIPS64 defines.
Move PTRACE_xxx compat defines up, before arch-specific
machinery. Use defined(SPARC) || defined(SPARC64)
instead of LINUXSPARC.
* file.c: Use defined(SPARC) || defined(SPARC64) instead of LINUXSPARC.
* signal.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
28ac68f2ab90e85663ecedcf9b56847290cd1ed4 08-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Optimize AArch64 handling of 32-bit personality

By putting aarch64_regs and arm_regs into a union,
register copying is eliminated.
No need to check and change personality on syscall exit.

* defs.h: Remove unused NUM_ARM_REGS define. Fix indentation.
* syscall.c: Put aarch64_regs and arm_regs into a union.
(update_personality): Shorten bitness message.
(printcall): Add commented-out PC printing.
(get_regs): Remove now-unnecessary 64-to-32 bits register copying.
(get_syscall_result): Drop personality changing code.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
401374e9c236751a0bc548bef8fc369a905a4190 06-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Rename ARM's regs structure to arm_regs

Compile-tested.

* defs.h: Rename regs structure to arm_regs.
* syscall.c: Likewise.
(printcall): Use new name instead of old one.
(get_regs): Likewise.
(get_scno): Likewise.
(get_syscall_args): Likewise.
(get_error): Likewise.
* signal.c (sys_sigreturn): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
8d4ca0c8cd81329ad730ab52b1e0653c1bbea803 06-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Shortcut tests for fork/exec syscalls

This change should speed up strace by a tiny bit.

More importantly, it makes it much more clear that
fork and exec fixups are not necessary for any reasonably
recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees
are all dead code.

* defs.h: Declare new need_fork_exec_workarounds flag variable.
* strace.c: Define need_fork_exec_workarounds flag variable.
(test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator.
(test_ptrace_setoptions_for_all): Likewise.
(init): Set need_fork_exec_workarounds to TRUE if needed.
* syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec().
(trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if
need_fork_exec_workarounds == TRUE.
(trace_syscall_exiting): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
af8dc6b3a562193c27c89531e7ac6d94e7c3c322 05-Feb-2013 Chris Metcalf <cmetcalf@tilera.com> tile: fix merge skew with new get_regs architecture

* defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error.
* syscall.c (get_regs) [TILE]: Fix merge skew.
(printcall) [TILE]: fix a compiler warning about pt_reg_t in
a printf expression.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/defs.h
0b99a8ac3bf6314bc92ab528b3849ab3faf7bf4c 05-Feb-2013 Chris Metcalf <cmetcalf@tilera.com> Add tilegx support to strace

tilegx support has been in the kernel since 3.0.
In addition, fix some issues with the tilepro support already
present in strace, primarily the decision to use the
<asm/unistd.h> numbering space for system calls.

* defs.h [TILE]: Include <asm/ptrace.h> and provide an extern
struct pt_regs tile_regs for efficiency. Provide compat 32-bit
personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE,
PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY.
* linux/tile/errnoent1.h: New file, includes linux/errnoent.h.
* linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h.
* linux/tile/signalent1.h: New file, includes linux/signalent.h.
* linux/tile/syscallent.h: Update with new asm-generic syscalls.
The version previously committed was the from the first tile patch
to LKML, which subsequently was changed to use <asm-generic/unistd.h>.
* linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h.
* mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable.
* process.c [TILE]: Choose clone arguments correctly and properly
suppress all "struct user" related offsets in user_struct_offsets.
* signal.c [TILE]: Use tile_regs not upeek.
* syscall.c (update_personality) [TILE]: Print mode.
(PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers.
(tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state.
(get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek.
(get_scno) [TILE]: Set personality.
(get_syscall_args) [TILE]: Use tile_regs.
(get_syscall_result) [TILE]: Update tile_regs.
(get_error) [TILE]: Use tile_regs.
(printcall) [TILE]: Print pc.
(arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]:
Properly handle tile call semantics and support tilegx.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
ce7d953ebecc10f71e191b6d18cfeb2399429d5f 05-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Optimize out PTRACE_PEEKUSER with -i

strace -i was fetching PC with a separate PEEKUSER
despite having GETREGS data:

ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0
ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0
write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0

Now it does this:

ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0
write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0

Analogous improvement in sys_sigreturn() is also implemented.

* defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM.
Declare clear_regs(), get_regs() and get_regs_error flag variable.
* strace.c (trace): Call get_regs(pid) as soon as we know the tcb
and that it is stopped.
* syscall.c (get_regs): New function. Used to fetch registers early,
just after tracee has stopped.
(printcall): Move it here from util.c. Use global regs.REG data,
if available on the arch, instead of re-fetching it.
(get_scno): Use global regs.REG data.
(get_syscall_result): Likewise.
* signal.c (sys_sigreturn): Likewise.
* util.c (printcall): Moved to syscall.c.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
890a5cad2321ae72fb5ca1b253edb874b1ca7180 10-Nov-2012 Steve McIntyre <steve.mcintyre@linaro.org> Add support for tracing 32-bit ARM EABI binaries on AArch64

* defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the
accessor macros, so it's possible to build on AArch64 without
ARM system headers. Set SUPPORTED_PERSONALITIES to 2.
Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE.
Set DEFAULT_PERSONALITY to 1.
* linux/aarch64/errnoent1.h: New file, includes generic errnoent.h.
* linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h.
* linux/aarch64/signalent1.h: New file, includes generic signalent.h.
* linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h.
* linux/aarch64/syscallent.h: New file, includes arm/syscallent.h.
* syscall.c [AARCH64]: Define aarch64_regs.
(update_personality) [AARCH64]: Add debug output.
(get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by
checking the size of the returned uio structure from PTRACE_GETREGSET
and interpret the structure accordingly.
(get_syscall_result): Likewise.
(get_syscall_args): Merge the AArch64 and ARM sections so that on
AArch64 we can fall back to supporting the ARM personality.
(get_error): Likewise.

Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
/external/strace/defs.h
d8d3bd3709eb52581c8ce86cec5a7a9c43c3c5b9 24-Oct-2012 Steve McIntyre <steve.mcintyre@linaro.org> Add AArch64 support to strace

AArch64 has been included in linux from 3.7 onwards.
Add support for AArch64 in strace, tested on linux in a simulator.

* configure.ac: Support AArch64.
* defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE.
* ipc.c (indirect_ipccall): Support AArch64.
* process.c (struct_user_offsets): Likewise.
* syscall.c [AARCH64]: Include <asm/ptrace.h>, <sys/uio.h>, and
<elf.h>. Define struct user_pt_regs regs.
(get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET.
(get_syscall_args, get_error): Support AArch64.
* linux/aarch64/ioctlent.h.in: New file.
* linux/aarch64/syscallent.h: New file, based on linux 3.7 version of
asm-generic/unistd.h.

Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
/external/strace/defs.h
9679296d56e3c0a948b1b4dcce99fd3c9b253a3d 24-Oct-2012 Namhyung Kim <namhyung.kim@lge.com> Add -e trace=memory option

Add a new 'memory' category for tracing memory mapping related syscalls.

Affected syscalls are: break, brk, get_mempolicy, madvise, mbind,
migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect,
mremap, msync, munlock, munlockall, munmap, remap_file_pages, and
set_mempolicy.

* defs.h (TRACE_MEMORY): New macro.
* syscall.c (lookup_class): Handle trace=memory option.
* strace.1: Document it.
* linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
/external/strace/defs.h
26bc0606d96d05d30ba263939a0451889340a64c 10-Jul-2012 Denys Vlasenko <vda.linux@googlemail.com> Enable usage of PTRACE_SEIZE

* defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL
and PTRACE_EVENT_STOP1.
* strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL
with 0.
(trace): Do not check for PTRACE_EVENT_STOP1.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
c52826c267aaca5c976b10e13ee6debc0bdf3f43 15-May-2012 Denys Vlasenko <vda.linux@googlemail.com> Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches

On 64bit systems with a single personality, they used to be sizeof(long),
which has type "long", not "int", which complicates printf formats.

* defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int.
This in turn makes sure current_wordsize is also an int.
* count.c (call_summary): Revert the change which added cast to int.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
b5d43b81a8abdf17bc3aa585a66215ebe3ba3671 28-Apr-2012 Denys Vlasenko <vda.linux@googlemail.com> Fix printstr's len parameter width

We often pass syscall params and other long-sized values
as printstr(len). Truncating them to int may be a bad thing.

* defs.h: Change len parameter's type from int to long in
string_quote and printstr function declarations.
* util.c (string_quote): Special-case only len==-1, not all len<0.
(printstr): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
e0bc222263cf47a43e1b26d55edb2ffadc8ccbff 28-Apr-2012 Denys Vlasenko <vda.linux@googlemail.com> Fix recvmsg decode: do not show more data than actually returned

I noticed that "hostname -d" talks over netlink and gets 20 bytes
of response, but we show entire 1024 bytes of iov.
This changes fixes that.

* defs.h: New function tprint_iov_upto.
* io.c (tprint_iov_upto): Definition of this function.
(tprint_iov): Call tprint_iov_upto.
* net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto.
(printmsghdr): Add data_size parameter, pass it down to do_msghdr.
(printmmsghdr): Call do_msghdr with data_size==ULONG_MAX.
(sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX.
(sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
ebee04cfb009bdc46599774b4647f6615b6ce3a2 18-Apr-2012 Mike Frysinger <vapier@gentoo.org> Decode /dev/loop ioctls

Needed to debug some losetup failures, and it's easier when you can see
what the kernel is getting vs what you think you're sending, so add some
decoders for those ioctls.

* loop.c: New file.
* Makefile.am (strace_SOURCES): Add loop.c.
* defs.h (loop_ioctl): New prototype.
(string_quote): Likewise.
* ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'.
* util.c (string_quote): Remove static keyword.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/defs.h
085e42886052190d3e515ca865546b527f59cdd1 17-Apr-2012 H.J. Lu <hongjiu.lu@intel.com> x32: add ia32 support

* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h,
linux/x32/ioctlent1.h, linux/x32/signalent1.h and
linux/x32/syscallent1.h.
* configure.ac: Remove AC_GNU_SOURCE, obsoleted by
AC_USE_SYSTEM_EXTENSIONS.
* defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32.
(PERSONALITY1_WORDSIZE): Set to 4 for X32.
* file.c (stat64): New struct for X32.
(sys_lseek32): New function for X32.
(stat64): Undef.
(sys_fstat64): Likewise.
(sys_stat64): Likewise.
(realprintstat64): New function for X32.
(sys_fstat64): Likewise.
(sys_stat64): Likewise.
* mem.c (sys_old_mmap): New function for X32.
* pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32.
* syscall.c (update_personality): Add X32 support.
(get_scno): Support currpers == 1 for X32.
* linux/syscall.h (sys_lseek32): New function prototype for X32.
* linux/x32/errnoent1.h: New file.
* linux/x32/ioctlent1.h: Likewise.
* linux/x32/signalent1.h: Likewise.
* linux/x32/syscallent1.h: Likewise.
/external/strace/defs.h
6e4f3c1fa41851cb72230432db4be8e0c2993c7d 16-Apr-2012 Denys Vlasenko <vda.linux@googlemail.com> Add custom (faster) vfprintf implementation (disabled by default)

* defs.h: Declare strace_vfprintf either as a alias to vfprintf
or as a bona fide function. USE_CUSTOM_PRINTF define controls whether
we use strace_vfprintf. By default, we don't.
* strace.c (tprintf): Call strace_vfprintf instead of vfprintf.
* vsprintf.c: New file, implements strace_vfprintf.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
35be58119e3727a694d8c9f9b83f372401fcc4c0 16-Apr-2012 H.J. Lu <hongjiu.lu@intel.com> Add x32 support to strace

X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with
32bit pointers. At system call level, x32 is also identical to x86-64,
as shown by many changes like "defined(X86_64) || defined(X32)". The
main differerence bewteen x32 and x86-64 is off_t in x32 is long long
instead of long.

This patch adds x32 support to strace. Tested on Linux/x32.

* configure.ac: Support X32.
* defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64,
Set PERSONALITY2_WORDSIZE to 4 for X86_64.
Add tcb::ext_arg for X32.
* file.c (stat): New for X32.
(sys_lseek): Use 64-bit version for X32.
(printstat64): Check current_personality != 1 for X86_64.
* ipc.c (indirect_ipccall): Check current_personality == 1
for X86_64.
* mem.c (sys_mmap64): Also use tcp->u_arg for X32. Print NULL
for zero address. Call printllval for offset for X32.
* pathtrace.c (pathtrace_match): Don't check sys_old_mmap for
X32.
* process.c (ARG_FLAGS): Defined for X32.
(ARG_STACK): Likewise.
(ARG_PTID): Likewise.
(change_syscall): Handle X32.
(struct_user_offsets): Support X32.
(sys_arch_prctl): Likewise.
* signal.c: Include <asm/sigcontext.h> for X32.
(SA_RESTORER): Also define for X32.
* syscall.c (update_personality): Support X32 for X86_64.
(is_restart_error): Likewise.
(syscall_fixup_on_sysenter): Likewise.
(get_syscall_args): Likewise.
(get_syscall_result): Likewise.
(get_error): Likewise.
(__X32_SYSCALL_BIT): Define if not defined.
(__X32_SYSCALL_MASK): Likewise.
(get_scno): Check DS register value for X32. Use
__X32_SYSCALL_MASK on X32 system calls.
* util.c (printllval): Use ext_arg for X32.
(printcall): Support X32.
(change_syscall): Likewise.
(arg0_offset): Likewise.
(arg1_offset): Likewise.
* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h,
linux/x32/ioctlent.h.in, linux/x32/signalent.h,
linux/x32/syscallent.h, linux/x86_64/errnoent2.h,
linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and
linux/x86_64/syscallent2.h.
* linux/x32/errnoent.h: New.
* linux/x32/ioctlent.h.in: Likewise.
* linux/x32/signalent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/errnoent2.h: Likewise.
* linux/x86_64/ioctlent2.h: Likewise.
* linux/x86_64/signalent2.h: Likewise.
* linux/x86_64/syscallent2.h: Likewise.

Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
dd0130b963151e37cffc8b593bebe3e3de58dfd4 16-Apr-2012 H.J. Lu <hongjiu.lu@intel.com> Restore tcb::u_lrval; fix lseek on MIPS-n32

Linux kernel v3.4 adds x32 support. Both x32 and n32 use 64bit offset
for lseek parameter and return value. We need u_lrval to handle it
properly. Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek.
This patch fixes it properly and prepares lseek for x32.

* defs.h (tcb): Restore tcb::u_lrval field, RVAL_Lfoo constants.
Set RVAL_MASK to 7.
* file.c (sys_lseek): Print 64bit offset and return RVAL_LUDECIMAL
for n32.
* syscall.c (get_error): Set u_lrval for MIPS-n32.
(trace_syscall_exiting): Handle RVAL_Lfoo return value types.

Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
0cbed357ab749fa0cf58e8d72230c2ed92334932 05-Apr-2012 Mike Frysinger <vapier@gentoo.org> Decode mtd ioctls

I got tired of figuring out mtd structures (which show up a lot
in the embedded space), so add decoders for those ioctls.

* defs.h (mtd_ioctl): New prototype.
(print_loff_t): Likewise.
* io.c (print_loff_t): Delete static keyword
* ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'.
* Makefile.am (strace_SOURCES): Add mtd.c.
(EXTRA_DIST): Add linux/mtd-abi.h.
* mtd.c: New file.
* linux/mtd-abi.h: New file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/defs.h
ccee169ab6aa4ae7515198dadcef5dd2286ede4b 25-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Robustify parsing of numbers from strings

* defs.h (string_to_uint): New prototype.
* util.c (string_to_uint): New function.
* strace.c (error_opt_arg): New function.
(process_opt_p_list): Use string_to_uint instead of atoi.
Terminate in case of invalid process id.
(init): Use string_to_uint instead of atoi.
Use error_opt_arg in case of invalid option argument.
* syscall.c (qual_syscall, qual_signal, qual_desc): Use string_to_uint
instead of atoi.
/external/strace/defs.h
e4cc7c58dda80d502e5c66c0c91f7df191d540a8 23-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Simple optimizations

Why open-coding isdigit is a good idea?

Before: call __ctype_b_loc
movzbl (%ebx),%edx
mov (%eax),%eax
testb $0x8,0x1(%eax,%edx,2)
je lbl

After: movzbl (%eax),%edx
sub $0x30,%edx
cmp $0x9,%dl
ja lbl

text data bss dec hex filename
236869 704 18944 256517 3ea05 strace.before
236719 700 18944 256363 3e96b strace

* defs.h: Alias sigemptyset to __sigemptyset on glibc.
* syscall.c (qual_syscall): Open-code isdigit.
(qual_desc): Likewise.
(qual_signal): Open-code isdigit. Remove string copying
which was done for no apparent reason.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
d63b0d568265296caccef53476cee5e3ca05ce57 23-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Reorder declarations in defs.h. No code changes

* defs.h: Reorder declarations (such as: keep all printing functions together).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
513e9c23df4713c97c25f862ee9c140f508c5a2c 21-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> simple cleanups in defs.h. No logic changes.

* defs.h: Move offsetof macro definition into "libc stuff" section.
Renumber TCB_foo constants (smaller constants -> sometimes smaller code).
Remove uoff macro.
* process.c: Move uoff macro here (sole user).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
235067525cc064a9a466c245fa8a6265ae136306 21-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Report some ptrace failures; nuke tcp->ptrace_errno

Report some (not all) ptrace errors, namely,
errors on ptrace restart operations.

Before: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <unfinished ...>
After: 10533 sendto(-1, 0x804895e, 17, 0, NULL, 0 <ptrace(SYSCALL):No such process>

This tells user that strace failed to let sendto syscall
to be entered - process was dead at that point of time.
It is (marginally) better than to always say "<unfinished ...>"

While at it, patch removes tcp->ptrace_errno.
I added it many months ago, and it looks that after all
it is not needed for ptrace error detection: I failed to execute
a single existing code path which is accessible
through that variable only.

* defs.h: Remove struct tcp::ptrace_errno field.
* strace.c (ptrace_restart): Emit message to log on error.
(printleader): Remove "if (printing_tcp->ptrace_errno)..." code.
(trace): Remove !tcp->ptrace_errno check, it's always true.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
852f98a3824f6b8359df744af5772306410341ab 20-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Make ptrace_restart() static. No code changes

* defs.h: Remove ptrace_restart() declaration.
* strace.c (ptrace_restart): Move its definition here.
* util.c (ptrace_restart): Remove its definition.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
9fd4f96d2a2527ac7ca90c156bfc11ce10118684 19-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Optimize code if we have only one personality

On i386:
text data bss dec hex filename
238025 672 18980 257677 3ee8d strace.before
237389 704 18944 257037 3ec0d strace

* defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined.
Introduce new define, current_wordsize as
(personality_wordsize[current_personality]).
Make set_personality() no-op, current_personality constant zero,
current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality.
* count.c (call_summary): Use current_wordsize instead of
personality_wordsize[current_personality].
* desc.c (printflock): Likewise.
* file.c (sys_utime): Likewise.
* io.c (tprint_iov): Likewise.
* process.c (printargv): Likewise.
* resource.c (decode_rlimit): Likewise.
* signal.c (sys_kill): Likewise.
(sys_rt_sigaction): Likewise.
* time.c (sprinttv): Likewise.
(sprint_timespec): Likewise.
(printitv_bitness): Likewise.
(tprint_timex): Likewise.
(printsigevent): Likewise.
* util.c (dumpiov): Likewise.
(umoven): Likewise.
(umovestr): Likewise.
* syscall.c: Initialize sysent to sysent0 etc.
Make current_personality, personality_wordsize[], set_personality()
conditional on SUPPORTED_PERSONALITIES > 1.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
146b944d4a968c2922f4220d33219ed3534f50d0 18-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Make internal_fork and internal_exec static

text data bss dec hex filename
237917 672 18980 257569 3ee21 strace
237845 672 18980 257497 3edd9 strace_new

* defs.h: Remove declarations of internal_fork and internal_exec.
* process.c: Remove definitions of internal_fork and internal_exec.
* syscall.c: Move them here.
(internal_syscall): Return void instead of int. We were always
returning zero, and callers weren't checking it anyway.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
f50e7141d5b5aedafa220d851a8b6afe753d679a 18-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove code which is not used on Linux

Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686,
mipsel,mips,x86_64

* syscall.c: Remove code which handles RVAL_Lfoo constants.
* defs.h: Remove struct tcb::u_lrval member - it is never set.
Remove RVAL_Lfoo constants which signify return of "long" result -
they are never used.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a61a72eacb9b6c687937799b933876bb3b397af4 17-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove unused struct tcb::baddr field

* defs.h: Remove unused struct tcb::baddr field.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
081533c10048365a2a8ffd2456af81765d402810 17-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Move change_syscall() to its only user and make it static

* defs.h: Remove declaration of change_syscall().
* process.c (change_syscall): Remove definition of this function.
* util.c (change_syscall): Add definition of change_syscall().

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
800ec8ffde1296b3f2cfdd838fb08f2ff2bbe946 16-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Make alloc_tcb and droptcb static. No code changes.

The change is trivial. Diff is large because it is confused
by function definitions being moved around.

* defs.h: Remove declarations of alloc_tcb and droptcb.
* strace.c: Make alloc_tcb and droptcb static.
Shuffle functions around to make compiler happy.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a6d91ded3f2d5401e09a9c2fa442aabfbfe593a8 16-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Tidy up includes and copyright notices, fix indentation

The files not mentioned in changelog below had only
copyright notices fixes and indentation fixes.

* defs.h: Include <stdint.h> and <inttypes.h>.
* file.c: Do not include <inttypes.h>.
Move struct kernel_dirent declaration below top include block.
* block.c: Do not include <stdint.h> and <inttypes.h>.
* quota.c: Likewise.
* desc.c: Likewise.
* signal.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
2c4fb905fef268a7e359ce3acaec4ee7ef087996 15-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> When reporting signals, use short signal names (SIGfoo) instead of strerror

* defs.h: Remove strsignal declaration.
* signal.c: Better check for SI_FROMUSER define.
* strace.c (strerror): Remove this function.
(trace): Use short signal names (SIGfoo) instead of strerror.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
29898149a0ce805cedb88602896573c50e059e74 15-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Clean up defs.h order. No code changes

* defs.h: Group together related declarations. No code changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
68269aa29f37e012ab545aa1e700d2df3b85bb81 15-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove an outdated comment

* defs.h: Remove an outdated comment.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
bcde70adbcff01af4a0675d2fd9d9522807d573e 15-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove extra include directives. No code changes.

* defs.h: Include <signal.h> unconditionally.
Other files were doing it unconditionally, so no harm done.
* bjm.c: Remove system includes which are already included by defs.h.
* pathtrace.c: Likewise.
* process.c: Likewise.
* signal.c: Likewise.
* strace.c: Likewise.
* stream.c: Likewise.
* syscall.c: Likewise.
* system.c: Likewise.
* util.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a50d2a87a1a8df4471bbd93f2ce9ef0541b1124b 15-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Tidy up order of includes; make bool variables explicit.

Bool variables are more compact in data and (on x86) on code too:

text data bss dec hex filename
237950 676 19044 257670 3ee86 strace.before
237838 676 19012 257526 3edf6 strace

* defs.h: Group library includes at the top of the file.
Rename dtime to Tflag, debug to debug_flag.
Change debug_flag,Tflag,qflag,not_failing_only,show_fd_path,tracing_paths
variable declarations from int to bool.
* strace.c: Change corresponding definitions. Do the same for static
variables iflag,rflag,print_pid_pfx.
Rename dtime to Tflag, debug to debug_flag.
* syscall.c: Rename dtime to Tflag, debug to debug_flag.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
7de265d88a78a27d58c2c728424e5bb8379ef351 13-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Fix logging for "strace -o FILE -ff test/threaded_execve" test case

Our logic which was deciding whether to print "<unfinished ...>"
thingy wasn't working properly for -ff case.

* defs.h: Group log generation-related declarations together.
Add a large comment which explains how it works.
Add declaration of line_ended() function.
* strace.c (line_ended): New function which sets up internal data
to indicate that previous line was finished.
(printleader): Change logic to fix log generation in -ff mode.
(newoutf): Make check for -ff mode consistent with other places.
(droptcb): Print "<detached ...>" if last line for this tcp wasn't finished.
(cleanup): Remove code to print "<unfinished ...>", printleader()
or detach() will do it instead.
(trace): Remove code to print "<unfinished ...>".
Add code which finishes threaded execve's incomplete line
with " <pid changed to PID ...>" message. Replace printing_tcp = NULL
followed by fflush() by line_ended() call.
* process.c (sys_exit): Call line_ended() to indicate that we finished priting.
* syscall.c (trace_syscall_exiting): Set printing_tcp to current tcp.
Call line_ended() to indicate that we finished priting.
Remove call to fflush(), it is done by line_ended() now.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
75fe85c2ee83a31afe0c8f1468da28deb1c2bc28 09-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Fix the case where we try to detach unattached processes

Before this change:
$ strace -D -p1
strace: -D and -p are mutually exclusive options
Process 1 detached <==== WRONG! (and we try to SIGSTOP it!!!)

* defs.h: Change the meaning of TCB_ATTACHED: now it means "this tracee
is attached to us". Add TCB_STRACE_CHILD: "this tracee is our child".
* strace.c (kill_save_errno): Move up. No code changes.
(process_opt_p_list): Don't set TCB_ATTACHED on new tcb.
(startup_attach): Change how we work with TCB_ATTACHED.
Set TCB_STRACE_CHILD on -D.
(startup_child): Use kill_save_errno instead of kill.
Set TCB_ATTACHED and TCB_STRACE_CHILD on attached strace child.
If we are in -D case, don't set TCB_ATTACHED (we aren't attached yet).
(detach): do not do PTRACE_DETACH if TCB_ATTACHED is not set.
(cleanup): Check TCB_STRACE_CHILD instead of TCB_ATTACHED.
(trace): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
e8172b79e3dd35a136f4dc4d4de9df5bb4565c01 09-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Allow -p PID to take comma or whitespace-separated list of PIDs

* defs.h: Clarify meaning of TCB_ATTACHED. No code changes.
* strace.c (process_opt_p_list): New function.
(main): Call process_opt_p_list to process -p PIDs argument.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
114aefd6183b8c073453f8def73270c42255f974 08-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Pass addr=0 instead of 1 into restarting ptrace calls

While we are at it, fold do_ptrace into its lone caller.
We no longer set tcp->ptrace_errno = ESRCH on ESRC error in upeek.
Other code paths where ptrace fails wern't doing it, and the code which
checks tcp->ptrace_errno even assumes it is never set to ESRCH.
(It was me who added this code sometime ago, so it was my fault
that it was a bit messy)

I ran sigkill_rain test and verified that unfinished syscalls are
still handled correctly.

* util.c (ptrace_restart): Do not pass addr=1 to ptrace(), pass 0 instead.
I have no idea why we were passing 1. Ptrace documentation says
that addr parameter is ignored.
(do_ptrace): Remove this function.
(upeek): Use ptrace() instead of do_ptrace().
* defs.h: Remove do_ptrace() declaration.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
72879c6a35cd5afa7f58ee7bc32e4dcd8e65bd9a 27-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Alias a few more syscall printing functions

text data bss dec hex filename
237384 672 19044 257100 3ec4c strace.before
236448 672 19044 256164 3e8a4 strace

* defs.h: Declare new functions printargs_lu(), printargs_ld()
which simply print syscall all args as unsigned or signed longs.
* desc.c (sys_epoll_create): Call printargs_ld() instead of open-coding it.
* linux/syscall.h: Remove declarations of the following functions:
sys_alarm, sys_getresgid, sys_getsid, sys_nice, sys_setgid, sys_setpgid,
sys_setpgrp, sys_setregid, sys_setresgid.
* process.c (sys_setgid): Delete this function: now aliased to sys_setuid().
(sys_getresgid): Delete this function: now aliased to sys_getresuid().
(sys_setregid): Delete this function: now aliased to sys_setreuid().
(sys_setresgid): Delete this function: now aliased to sys_setresuid().
(sys_setpgrp): Delete this function: now aliased to printargs_lu().
(sys_getsid): Likewise.
(sys_setpgid): Likewise.
(sys_alarm): Likewise.
(sys_getpgrp): Delete this function: was unused - was already shadowed
by a define in linux/dummy.h.
(sys_setsid): Likewise.
(sys_getpgid): Likewise.
* resource.c (sys_nice): Delete this function: now aliased to printargs_ld().
* linux/dummy.h: Define new aliases (see above for the list).
* syscall.c (printargs_lu): New function.
(printargs_ld): New function.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
e83e157021177930b64ec4aa4983bbe13b39e91b 25-Feb-2012 Dmitry V. Levin <ldv@altlinux.org> Compress blank lines

Suppress repeated empty lines left after automated code removal.
This change was made by filtering every source code file through
"cat -s".
/external/strace/defs.h
aa925db23634fe6a2c1d4b47accb3649daf1b781 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove a few more code parts which are unused on Linux

This change is abapted from Dmitry's changes to remove support for
non-Linux architectures.

* Makefile.am: Remove if LINUX/endif pairs.
* defs.h: Remove stream_ioctl() declaration.
* ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block.
* resource.c: Use 'defined(FOO)' instead of 'defined FOO' form.
* util.c: Likewise.
* signal.c: Remove conditional includes which are never used on Linux.
* stream.c: Likewise.
* file.c: Remove excessive empty lines.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
329655a4661180043dc3f30e85b343e76a85b8e6 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Reindent defs.h preprocessor directives

* defs.h: Fix indentation of preprocessor directives broken by
automatic removal of non-Linux code.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
8470374cba7df0e70653d95c4f336a4082c68d82 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Cleanup after non-Linux code removal.

Conditions such as defined(LINUX) are always true now,
defined(FREEBSD) etc are always false.
When if directive has them as subexpressions, it can be simplified.
Another trivial changes here are fixes for directive indentation.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
ed720fda5d515f1359fcd3242223e553d1216789 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Automated removal of non-Linux code

This change is generated by running every source through the following command:

unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD
-USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS
-UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
44824b9d4b05ba81d722f586b6e2803e7d18ca7b 20-Feb-2012 Dmitry V. Levin <ldv@altlinux.org> Eliminate native_scno and known_scno

* defs.h (known_scno): Remove.
(sysent): Remove native_scno field.
* process.c [IA64]: Replace known_scno(tcp) with tcp->scno.
(internal_fork) [USE_PROCFS || !LINUX]: Likewise.
* syscall.c: Do not define NR_SYSCALL_BASE.
(known_scno): Remove.
(syscall_fixup_on_sysenter) [USE_PROCFS]: Replace known_scno(tcp)
with tcp->scno.
(trace_syscall_entering) [SVR4 || FREEBSD || SUNOS4]: Likewise.
(syscall_fixup_on_sysexit) [SUNOS4]: Likewise.
/external/strace/defs.h
9aa25abb2e74b05872c8d141776ced5c77b29dcf 10-Feb-2012 Dmitry V. Levin <ldv@altlinux.org> Remove initialization of native_scno field for most of syscalls

The native_scno field is not so much used in the code than before.
In many cases sys_func is checked instead, and for most of syscall
entries there is no need to initialize native_scno.

* linux/i386/syscallent.h: Remove native_scno initialization for
_exit, read, write, waitpid, execve, wait4, sysfs, readv, writev,
pread64, pwrite64, exit_group, waitid, send, recv, sendto and
recvfrom syscall entries.
* linux/syscall.h: Do not define no longer used SYS_waitid and
SYS_sub_* constants.
[IA64]: Do not define SYS_waitpid and SYS32_* constants.
* defs.h: Do not define no longer used __NR_exit_group constant.
* strace.c [USE_PROCFS] (proc_open): Use sys_func to check for execve.
/external/strace/defs.h
e752bed4afcd88da082f8b80ca7060d15c59fb16 03-Feb-2012 H.J. Lu <hongjiu.lu@intel.com> Skip the syscall entry if the sys_func field is NULL

Avoid NULL dereference when there are holes in sysent tables.
It can happen with syscall (number, ...) and number is in those holes.
There are no targets with holey systent tables so far, but at least
one such a target, x32, is already on the horizon.

* defs.h (SCNO_IN_RANGE): Also check the sys_func field.
/external/strace/defs.h
31fa8a22b17b2f898513b68e04269597147d2478 29-Jan-2012 Denys Vlasenko <vda.linux@googlemail.com> Add experimental code to use PTRACE_SEIZE, disabled by default

All new code is predicated on "ifdef USE_SEIZE". If it is not defined,
behavior is not changed.

If USE_SEIZE is enabled and run-time check shows that PTRACE_SEIZE works, then:
- All attaching is done with PTRACE_SEIZE + PTRACE_INTERRUPT.
This means that we no longer generate (and possibly race with) SIGSTOP.
- PTRACE_EVENT_STOP will be generated if tracee is group-stopped.
When we detect it, we issue PTRACE_LISTEN instead of PTRACE_SYSCALL.
This leaves tracee stopped. This fixes the inability to SIGSTOP or ^Z
a straced process.

* defs.h: Add commented-out "define USE_SEIZE 1" and define PTRACE_SEIZE
and related constants.
* strace.c: New variable post_attach_sigstop shows whether we age going
to expect SIGSTOP on attach (IOW: are we going to use PTRACE_SEIZE).
(ptrace_attach_or_seize): New function. Uses PTRACE_ATTACH or
PTRACE_SEIZE + PTRACE_INTERRUPT to attach to given pid.
(startup_attach): Use ptrace_attach_or_seize() instead of ptrace(PTRACE_ATTACH).
(startup_child): Conditionally use alternative attach method using PTRACE_SEIZE.
(test_ptrace_setoptions_followfork): More robust parameters to PTRACE_TRACEME.
(test_ptrace_seize): New function to test whether PTRACE_SEIZE works.
(main): Call test_ptrace_seize() while initializing.
(trace): If PTRACE_EVENT_STOP is seen, restart using PTRACE_LISTEN in order
to not let tracee run.
* process.c: Decode PTRACE_SEIZE, PTRACE_INTERRUPT, PTRACE_LISTEN.
* util.c (ptrace_restart): Add "LISTEN" to a possible error message.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
000b601439d249a4afa2ceb6096850a702612d1e 28-Jan-2012 Denys Vlasenko <vda.linux@googlemail.com> Fix a case of broken output if last seen syscall was exit

* defs.h: Rename tcp_last to printing_tcp. Explain what it means.
Remove printtrailer() function.
* process.c (sys_exit): Convert printtrailer() call to "printing_tcp = NULL".
* strace.c: Add new variable printing_tcp.
(cleanup): Convert printtrailer() call to "printing_tcp = NULL".
(trace): Likewise.
(trace): Fix checks for incomplete line - it was working wrongly if last syscall was exit.
(printleader): Set printing_tcp.
(printtrailer): Remove this function.
* syscall.c: Remove tcp_last variable.
(trace_syscall_entering): Don't set printing_tcp, printleader call now does it.
(trace_syscall_exiting): Convert printtrailer() call to "printing_tcp = NULL".

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
eebb04d4ae8bf4b08a041f5ea442ca24c90692c2 27-Jan-2012 Denys Vlasenko <vda.linux@googlemail.com> Make pid2tcb static

* defs.h: Remove pid2tcb declaration.
* strace.c (pid2tcb): Make this function static.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
a1d541ec56e2fb4716f083fcc814b1dedde63d87 20-Jan-2012 Denys Vlasenko <vda.linux@googlemail.com> Eliminate code duplication in time printing, reduce a few static buffers

text data bss dec hex filename
238454 664 28772 267890 41672 strace.before
238106 664 28676 267446 414b6 strace

* defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines.
Add 'int special' parameter to sprinttv().
* time.c (sprinttv): Add 'int special' parameter, and use it
similarly to 'int special' parameter of printtv_bitness().
(printtv_bitness): Use sprinttv() instead of duplicating its code.
(print_timespec): Use sprint_timespec() instead of duplicating
its code.
* desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128
when checking remaining buffer size.
* net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128
for static buffer size.
* stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128
when checking remaining buffer size.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/defs.h
023b7700de942f59fcb4cd30903969d276a4d796 18-Jan-2012 Denys Vlasenko <dvlasenk@redhat.com> Get rid of TCB_SIGTRAPPED

On attempts to block or set SIGTRAP handler,
for example, using sigaction syscall, we generate
an additional SIGSTOP.

This change gets rid of this SIGSTOP sending/ignoring.
It appears to work just fine.

It also works if I force strace to not use PTRACE_O_TRACESYSGOOD,
which means strace stops will be marked with SIGTRAP,
not (SIGTRAP | 0x80) - I wondered maybe that's when
this hack is needed.

So, why we even have TCB_SIGTRAPPED? No one knows. It predates
version control: this code was present in the initial commit,
in 1999. No adequate comments, either.

Moreover, TCB_SIGTRAPPED is not set in sys_rt_sigaction
and sys_sigprocmask syscalls - the ones which are most usually
used to implement signal blocking, it is only set in obsolete
sys_signal, sys_sigaction, sys_sigsetmask, and in some dead
non-Linux code.

I think whatever bug it was fixing is gone long ago -
at least as long as sys_rt_sigaction is used by glibc.
Again, since glibc (and uclibc) uses sys_rt_sigaction
and sys_sigprocmask, modified code paths are not used
by most programs anyway.

* defs.h: Remove definition of TCB_SIGTRAPPED.
* signal.c (sys_sigvec): Don't set TCB_SIGTRAPPED and don't send SIGSTOP.
(sys_sigsetmask): Likewise.
(sys_sigaction): Likewise.
(sys_signal): Likewise.
* strace.c (trace): Remove code which executes if TCB_SIGTRAPPED is set.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
024cad9a25bd11abc05525ab58b33cb570e29464 17-Jan-2012 Dmitry V. Levin <ldv@altlinux.org> Fix struct pt_regs declaration on i386 and x86-64

* defs.h [I386] (i386_regs): Replace definition with declaration.
[X86_64] (x86_64_regs): Remove.
* syscall.c [X86_64] (x86_64_regs): Make static.
/external/strace/defs.h
b11322fd3c8d291061d69e40e28004b97b91b15d 10-Jan-2012 Denys Vlasenko <dvlasenk@redhat.com> Display mask on enter to sigreturn, not on exit

sys_sigreturn() performs ugly manipulations in order to show
signal mask which is restored by this syscall: on syscall entry,
fetches it from the stack, saves it in tcp->u_arg[]
(where it used to overflow this array - fixed sometime ago),
then retrieves the mask and displays it on syscall exit.

Apparently, the motivation is to make it slightly more obvious
to user that signal mask is restored only when this syscall returns.
IMO, this hardly justifies the necessary hacks. It is much easier
to display the mask at the point when we fetch it - on syscall entry.

While at it, I made it so that we do display returned value/errno.
I see no point in hiding it and showing uninformative "= ?" instead.

Example of pause() being interrupted by ALRM which has installed handler
which re-arms ALRM:

Before the patch:

rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted)
--- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
alarm(1) = 0
sigreturn() = ? (mask now [INT])

After:

rt_sigsuspend([INT]) = ? ERESTARTNOHAND (To be restarted)
--- {si_signo=SIGALRM, si_code=SI_KERNEL} (Alarm clock) ---
alarm(1) = 0
sigreturn() (mask [INT]) = -1 EINTR (Interrupted system call)

* defs.h: Declare struct pt_regs i386_regs and struct pt_regs x86_64_regs.
* syscall.c: Remove "static" keywork from these structures' definitions.
* signal.c (sys_sigreturn): Display mask on enter, not on exit.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
a5a839a920da9d54c4174ebc82b29d7718839029 23-Dec-2011 Dmitry V. Levin <ldv@altlinux.org> Enhance personality switching

On syscall entry, save current personality in the tcb structure
along with scno.
On syscall exit, restore current personality from the tcb structure.
* defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers
field.
* strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize
tcp->currpers.
* syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New
function.
(get_scno, trace_syscall_exiting): Use it.

Reported-by: Michael A Fetterman <mafetter@nvidia.com>
/external/strace/defs.h
f88837a666a716aecd9974f7ef3fcf006e0afce1 05-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Do post-attach initialization earlier; fix "we ignore SIGSTOP on NOMMU" bug

We set ptrace options when we see post-attach SIGSTOP.
This is wrong: it's better to set them right away on the very first
stop (whichever it will be). It also will make adding SEIZE support easier,
since SEIZE has no post-attach SIGSTOP.

We do it by adding a new bit, TCB_IGNORE_ONE_SIGSTOP, and treating
TCB_STARTUP and TCB_IGNORE_ONE_SIGSTOP as two slightly different things.

* defs.h: Add a new flag bit, TCB_IGNORE_ONE_SIGSTOP.
* process.c (internal_fork): Set TCB_IGNORE_ONE_SIGSTOP on a newly added child.
* strace.c (startup_attach): Set TCB_IGNORE_ONE_SIGSTOP after attach.
Fix a case when "strace -p PID" found PID dead but sone other of its threads
still alive.
(startup_child): Set TCB_IGNORE_ONE_SIGSTOP after attach, _if needed_.
This fixes a bogus case where we can ignore a _real_ SIGSTOP on NOMMU.
(detach): Perform anti-SIGSTOP dance only if TCB_IGNORE_ONE_SIGSTOP is set,
not if TCB_STARTUP is set.
(trace): Set TCB_IGNORE_ONE_SIGSTOP after attach.
Clear TCB_STARTUP and initialize tracee on the very first tracee stop.
Clear TCB_IGNORE_ONE_SIGSTOP when SIGSTOP is seen.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
d116a7338645af45090aecc331701e999148d284 05-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Get rid of TCB_ATTACH_DONE

* defs.h: Remove TCB_ATTACH_DONE constant.
* strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE
to distinquish attached from not-yet-attached threads.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
0a295bc97fd2ba9e6dc02f382dc87bc8705dc4d0 01-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Add stpcpy to autoconf machinery

* configure.ac: Add stpcpy to AC_CHECK_FUNCS.
* defs.h: Frame stpcpy with "if !defined HAVE_STPCPY".
* util.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
5940e6593911dcace424c668a1c0934c71fccb9e 01-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Fix "format not a string literal" warning caused by tprintf(str)

* defs.h: Declare tprints().
* strace.c: Define tprints().
(tabto): Use tprints(str), since tprintf(str) was throwing a warning.
* desc.c: Use tprints(str) instead of tprintf("%s", str).
* file.c: Likewise.
* io.c: Likewise.
* net.c: Likewise.
* process.c: Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
1d46ba57a8ab16b353b531f2bbefe2ad7f354ca9 31-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Make out-of-memory handling more uniform

This fixes one real bug in dumpstr().

* defs.h: Declare die_out_of_memory().
* strace.c (die_out_of_memory): New function.
(strace_popen): If allocation fails, call die_out_of_memory().
(main): Likewise.
(expand_tcbtab): Likewise.
(rebuild_pollv): Likewise.
* count.c (count_syscall): Likewise.
(call_summary_pers): Likewise.
* desc.c (decode_select): Likewise.
* file.c (sys_getdents): Likewise.
(sys_getdents64): Likewise.
(sys_getdirentries): Likewise.
* pathtrace.c (pathtrace_match): Likewise.
* syscall.c (qualify): Likewise.
* util.c (printstr): Likewise.
(dumpiov): Likewise.
(dumpstr): Likewise.
(fixvfork): Likewise.
* mem.c (sys_mincore): Don't check free() parameter for NULL.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
2fb4db3e7aa1d6ac6b4b43f47597197492a846dd 31-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Optimization: eliminate all remaining usages of strcat()

After this change, we don't use strcat() anywhere.

* defs.h: Change sprinttv() return type to char *.
* time.c (sprinttv): Return pointer past last stored char.
* desc.c (decode_select): Change printing logic in order to eliminate
usage of strcat() - use stpcpy(), *outptr++ = ch, sprintf() instead.
Also reduce usage of strlen().
* stream.c (decode_poll): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
5284557bfad96f12dd5798539008e1644f1dc094 31-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Optimization: eliminate some usages of strcat()

* defs.h: Declare stpcpy().
* util.c: Define stpcpy().
* file.c: Remove static str_append().
(sprint_open_modes): Use stpcpy() instead of str_append().
(sprintflags): Use stpcpy() instead of strcat().
(printpathn): Eliminate usage of strcat().
(printstr): Eliminate usage of strcat().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
eb0e3e8f501b8519594d57caf2632581b3031c50 30-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> On X86_64 and I386, use PTRACE_GETREGS to fetch all registers

Before this change, registers were read with PTRACE_PEEKUSER
ptrace operation, one per register. This is slower than
fetching them all in one ptrace operation.

* defs.h: include asm/ptrace.h on X86_64 and I386.
* syscall.c: New static variables i386_regs and x86_64_regs.
Remove static eax/rax variables.
(get_scno): Fetch all registers with single PTRACE_GETREGS operation.
(get_syscall_result): Likewise.
(syscall_fixup_on_sysenter): Use PTRACE_GETREGS results in i386/x86_64_regs.
(syscall_enter): Set tcp->u_arg[i] from PTRACE_GETREGS results.
(get_error): Set tcp->u_rval, tcp->u_error from PTRACE_GETREGS results.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
77770bbf6b52bc109a2769df3aff19ce9fcdc9f4 26-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Indent a large set of nested ifdefs/endifs. No code changes

* defs.h: Indent a large set of nested ifdefs/endifs

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
8b4454cba79445651050ea84bb411e5265d4651e 25-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Rename syscall_fixup to syscall_fixup_on_sysenter

* defs.h: Tweak comment.
* syscall.c: Rename syscall_fixup to syscall_fixup_on_sysenter.
(trace_syscall_entering): Use new finction name.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
102ec4935440ff52a7fa3566154a84cc2473f16a 25-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Optimize tabto()

tabto is used in many lines of strace output.
On glibc, tprintf("%*s", col - curcol, "") is noticeably slow
compared to tprintf(" "). Use the latter.
Observed ~15% reduction of time spent in userspace.

* defs.h: Drop extern declaration of acolumn. Make tabto()
take no parameters.
* process.c (sys_exit): Call tabto() with no parameters.
* syscall.c (trace_syscall_exiting): Call tabto() with no parameters.
* strace.c: Make acolumn static, add static char *acolumn_spaces.
(main): Allocate acolumn_spaces as a string of spaces.
(printleader): Call tabto() with no parameters.
(tabto): Use simpler method to print lots of spaces.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
cb6f056004a10d5c3ed0341366e3ddeb53cac5e6 25-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Opotimize "scno >= 0 && scno < nsyscalls" check

gcc can't figure out on its own that this check can be done with
single compare, and does two compares. We can help it by casting
scno to unsigned long: ((unsigned long)(scno) < nsyscalls)

* defs.h: New macro SCNO_IN_RANGE(long_var).
* count.c (count_syscall): Use SCNO_IN_RANGE() instead of open-coded check.
* syscall.c (getrval2): Use SCNO_IN_RANGE() instead of open-coded check.
This fixes a bug: missing check for scno < 0 and scno > nsyscalls
instead of scno >= nsyscalls.
(get_scno): Use SCNO_IN_RANGE() instead of open-coded check.
This fixes a bug: scno > nsyscalls instead of scno >= nsyscalls.
(known_scno): Use SCNO_IN_RANGE() instead of open-coded check.
(internal_syscall): Likewise.
(syscall_enter): Likewise.
(trace_syscall_entering): Likewise.
(get_error): Likewise.
(trace_syscall_exiting): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
92d443c030d821f3ccb7462842fca8f62aea0b42 25-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Group int-sized fields together in struct tcb

* defs.h: Group int-sized fields together in struct tcb.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
06602d99b72564e77600fc7c94e9ce8b78ec7085 24-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Rename some functions, delete unused one. No code changes

* defs.h: Rename get_scno_on_sysenter() to get_scno();
delete force_result() declaration.
* strace.c (proc_open): Rename get_scno_on_sysenter() to get_scno().
* syscall.c: Rename get_scno_on_sysenter() to get_scno().
Rename get_scno_on_sysexit() to get_syscall_result().
Delete unused force_result().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
9a36ae5e886794865623b0d3d4f0d10bf541f32d 24-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> get_scno is an unholy mess, make it less horrible

Currently, get_scno does *much* more than "get syscall no".
It checks for post-execve SIGTRAP. It checks for changes
in personality. It retrieves params on entry and registers on exit.
Worse still, it is different in different architectures: for example,
for AVR32 regs are fetched in get_scno(), while for e.g. I386
it is done in syscall_enter().

Another problem is that get_scno() is called on both syscall entry and
syscall exit, which is stupid: we don't need to know scno on syscall
exit, it is already known from last syscall entry and stored in
tcp->scno! In essence, get_scno() does two completely different things
on syscall entry and on exit, they are just mixed into one bottle, like
shampoo and conditioner.

The following patches will try to improve this situation.

This change duplicates get_scno into identical get_scno_on_sysenter,
get_scno_on_sysexit functions. Call them in syscall enter and syscall
exit, correspondingly.

* defs.h: Rename get_scno to get_scno_on_sysenter; declare it only
if USE_PROCFS.
* strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno.
* syscall.c (get_scno): Split into two (so far identical) functions
get_scno_on_sysenter and get_scno_on_sysexit.
(trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno.
(trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
44142a7b79d96e711c8b492a6ad6bb0a2bbc8ead 23-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Define MAX_ARGS to 6 for all Linux arches

* defs.h: Define MAX_ARGS to 6 for all Linux arches.
* linux/ia64/syscallent.h: Change all 8-argument printargs
to MA (MAX_ARGS).
linux/mips/syscallent.h: Change all two 7-argument printargs
to MA (MAX_ARGS).

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
afc64037e22cc7cafadba766286e32550d9e8feb 23-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Drop checks for sysent[i].nargs == -1

* defs.h: Declare nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
* syscall.c: Define nsyscalls, nerrnos, nioctlents, nsignals as unsigned.
(decode_subcall): Drop checks for sysent[i].nargs == -1.
(syscall_enter): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
ac1ce77a23b4f4eecb6768f118259499308fce1c 23-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Stop using nargs == -1 in syscallent tables

Usage -1 as argument count in syscallent tables
necessitates the check for it, a-la:
if (sysent[tcp->scno].nargs != -1)
tcp->u_nargs = sysent[tcp->scno].nargs;
else
tcp->u_nargs = MAX_ARGS;
which is stupid: we waste cycles checking something which
is constant and known at compile time.

* defs.h: Make struct sysent::nargs unsigned.
* freebsd/i386/syscallent.h: Replace nargs of -1 with MA.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* svr4/syscallent.h: Likewise.
* freebsd/syscalls.pl: Likewise in generator script.
* syscallent.sh: Likewise in generator script.
* syscall.c: Add define MA MAX_ARGS / undef MA around includes
of syscallent[N].h.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
b88f96129f8ebc064d490c8c161bcbc925d938c8 21-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Straighten up confused comments/messages about post-execve SIGTRAP handling

* defs.h: Explain TCB_INSYSCALL and TCB_WAITEXECVE bits in detail.
* strace.c (choose_pfd): Use entering/exiting macros instead of direct check
for TCB_INSYSCALL.
* syscall.c (get_scno): Use entering/exiting macros instead of direct check
for TCB_INSYSCALL. Fix comments about post-execve SIGTRAP.
(syscall_fixup): Use entering/exiting instead of direct check
for TCB_INSYSCALL. Add a comment what "not a syscall entry" message
usually means. Change wrong "stray syscall exit" messages into
"not a syscall entry" ones.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
c95a88f124895042345473fad58daa30da9e1565 21-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> count_syscall() always returns 0, optimize it

* defs.h (count_syscall): Change return type from int to void.
* count.c (count_syscall): Change return type from int to void.
* syscall.c (trace_syscall_exiting): Change code around call
to count_syscall accordingly.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
8dc0c8c5ef66c2b2eb76484b83c750c0712891f9 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Exclude tcp->pfd from non-procfs systems

* defs.h: Make struct tcb::pfd fields conditional on USE_PROCFS.
* strace.c (alloc_tcb): Use tcp->pfd only if USE_PROCFS.
(droptcb): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
39fca628019cbfa01835482ac8559e21fde7f03c 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Small optimization in signal and ioctl tables

Trivial shuffling of data tables puts them all in one file,
allowing gcc to see their sizes and eliminate variables
which store these sizes.

Surprisingly, in C mode gcc does not optimize out static const int
variables. Help it by using enums instead.

* defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2},
signalent{0,1,2}, nsignals{0,1,2}.
* ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}.
* signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}.
* syscall.c: Move above definitions to this file. Make them static const
or enums if suitable.
/external/strace/defs.h
5c774b2be4c64f24c8473d7bdf2ad23b8bc314cc 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Don't return int from set_personality(), no one checks it.

* defs.h (set_personality): Change return type to void.
* syscall.c (set_personality): Change return type to void.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
3ec963237690a8bb7e032c37e26fa0f089bb16e4 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove unused declaration

* defs.h: Remove unused declaration of handle_new_child().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
d9ec141671dea4f4982749aa1bcc9c9ff4138d30 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Use natural-sized integer field for tcb::flags

* defs: Change struct tcb::flags type from short to int.
This results in smaller code at least on x86.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
4924dbd6d750665cf383b20ab4fd67e48219ab91 19-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Make addflags return void

* defs.h (addflags): Change return type from int to void.
* util.c (addflags): Change return type from int to void.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
d9560c108099394281012eb4bd7c46a46df6d31d 19-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Set saner MAX_ARGS (6 or 8) for X86_64 and I386

I noticed that tcp->u_args[MAX_ARGS] array is way larger than
I'd expect: for all arches except HPPA it has 32 (!) elements.

I looked at the code and so far I spotted only one abuser of
this fact: sys_sigreturn. On several arches, it saves sigset_t
into tcp->u_args[1...N] on entry and prints it on exit, a-la

memcpy(&tcp->u_arg[1], &sc.oldmask[0], sizeof(sigset_t))

The problem here is that in glibc sigset_t is insanely large:
128 bytes, and using sizeof(sigset_t) in memcpy will overrun
&tcp->u_args[1] even with MAX_ARGS == 32:
On 32 bits, sizeof(tcp->u_args) == 32*4 == 128 bytes!
We may already have a bug there!

This commit changes the code to save NSIG / 8 bytes only.
NSIG can't ever be > 256, and in practice is <= 129,
thus NSIG / 8 is <= 16 bytes == 4 32-bit words,
and even MAX_ARGS == 5 should be enough for saving signal masks.

* defs.h: Reduce MAX_ARGS for X86_64 and I386 from 32 to 8
for FreeBSD and to 6 for everyone else. Add comment about current
state of needed MAX_ARGS.
* signal.c: Add comment about size of sigset_t.
(sprintsigmask): Reduce static string buffer from 8k to 2k.
(sys_sigreturn): Fix sigset saving to save only NSIG / 8 bytes,
not sizeof(sigset_t) bytes.
* linux/mips/syscallent.h: Reduce nargs of printargs-type syscall to 7.
* linux/arm/syscallent.h: Reduce nargs of printargs-type syscall to 6.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
041b3ee42e7c6338f482320bcc649aff254ae892 18-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Cosmetic fixes, no code changes

* defs.h: Add/reformat comments.
* signal.c: Remove wrong comment. Add warning directive
when we detect that NSIG is undefined. Add comment about
NSIG on ARM. Fix typo in comment.
(signame): Reformat code a bit without changes to logic.
Shorten static buffer.
(sys_rt_sigprocmask): Remove stray empty line.
* syscall.c: Add warning directive when we detect that
NSIG is undefined. Add comment about NSIG on ARM.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
44f87efc676467ab47972feec49af4f7f34356bf 17-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove tcp->parent and TCB_CLONE_THREAD.

tcp->parent is used for only two things:
(1) to send signal on detach via tgkill (need to know tgid).
Solution: use tkill, it needs only tid.
(2) to optimize out ptrace options setting for new tracees.
Not a big deal if we drop this optimization: "set options" op is fast,
doing it just one extra time once per each tracee is hardly measurable.

TCB_CLONE_THREAD is a misnomer. It used only to flag sibling we attached to
in startup_attach. This is used to prevent infinite recursive rescanning
of /proc/PID/task.
Despite the name, there is no guarantee it is set only on non-leader:
if one would run "strace -f -p THREAD_ID" and THREAD_ID is *not*
a thread leader, strace will happily attach to it and all siblings
and will think that THREAD_ID is the leader! Which is a bug, but
since we no longer detach when we think tracee is going to die,
this bug no longer matters, because we do not use the knowledge
about thread group leaders for anything. (We used it to delay
leader's exit).

IOW: after this patch strace has no need to know about threads, parents
and children, and so on. Therefore it does not track that information.
It treats all tracees as independent entities. Overall,
this simplifies code a lot.

* defs.h: Add TCB_ATTACH_DONE flag, remove TCB_CLONE_THREAD flag
and struct tcb::parent field.
* process.c (internal_fork): Don't set tcpchild->parent.
* strace.c (startup_attach): Use TCB_ATTACH_DONE flag instead of
TCB_CLONE_THREAD to avoid attach attempts on already-attached threads.
Unlike TCB_CLONE_THREAD, TCB_ATTACH_DONE bit is used only temporarily,
and only in this function. We clear it on every tcb before we return.
(detach): Use tkill instead of tgkill.
(trace): Set ptrace options on new tracees unconditionally,
not only when tcp->parent == NULL.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
833fb13cef3f1f05b71361b5002aa3c2faad9615 17-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove TCB_SUSPENDED constant and related code.

Since we no longer suspend waitpid'ing tracees, we have only one case when
we suspend tracee: when we pick up a new tracee created by clone/fork/vfork.

Background: on some other OSes, attach to child is done this way:
get fork's result (pid), loop ptrace(PTRACE_ATTACH) until you hook up
new process/thread. This is ugly and not safe, but what matters for us
is that it doesn't require suspending. Suspending is required
on Linux only, because on Linux attach to child is done differently.

On Linux, we use two methods of catching new tracee:
adding CLONE_THREAD bit to syscall (if needed, we change
[v]fork into clone before that), or using ptrace options.
In both cases, it may be so that new tracee appears before one which
created it returns from syscall. In this case, current code
suspends new tracee until its creator returns. Only then
strace can determine who is its parent (it needs child's pid for this,
which is visible in parent's [v]fork/clone result).
This is inherently racy. For example, what if SIGKILL kills
creator after it succeeded creating child, but before it returns?
Looks like we will have child suspended forever.

But after previous commit, we DO NOT NEED parent<->child link for anything.
Therefore we do not need suspending too. Bingo!

This patch removes suspending code. Now new tracees will be continued
right away. Next patch will remove tcp->parent member.

* defs.h: Remove TCB_SUSPENDED constant
* process.c (handle_new_child): Delete this function.
(internal_fork): Do not call handle_new_child on syscall exit.
* strace.c (handle_ptrace_event): Delete this function.
(trace): Do not suspend new child; remove all handling
of now impossible TCB_SUSPENDED condition.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
19cdada5b499b978ffd9c3367b4ef34ad6f8bf2b 17-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Do not detach when we think tracee is going to die.

Current code plays some ungodly tricks, trying to not detach
thread group leader until all threads exit.

Also, it detaches from a tracee when signal delivery is detected
which will cause tracee to exit.
This operation is racy (not to mention the determination
whether signal is set to SIG_DFL is a horrible hack):
after we determined that this signal is indeed fatal
but before we detach and let process die,
*other thread* may set a handler to this signal, and
we will leak the process, falsely displaying it as killed!

I need to look in the past to figure out why we even do it.
First guess is that it's a workaround for old kernel bugs:
kernel used to deliver exit notifications to the tracer,
not to real parent. These workarounds are ancient
(internal_exit is from 1995).

The patch deletes the hacks. We no longer need tcp->nclone_threads,
TCB_EXITING and TCB_GROUP_EXITING. We also lose a few rather
ugly functions.

I also added a new message: "+++ exited with EXITCODE +++"
which shows exact moment strace got exit notification.
It is analogous to existing "+++ killed by SIG +++" message.

* defs.h: Delete struct tcb::nclone_threads field,
TCB_EXITING and TCB_GROUP_EXITING constants,
declarations of sigishandled() and internal_exit().
* process.c (internal_exit): Delete this function.
(handle_new_child): Don't ++tcp->nclone_threads.
* signal.c (parse_sigset_t): Delete this function.
(sigishandled): Delete this function.
* strace.c (startup_attach): Don't tcbtab[tcbi]->nclone_threads++.
(droptcb): Don't delay dropping if tcp->nclone_threads > 0,
don't drop parent if its nclone_threads reached 0:
just drop (only) this tcb unconditionally.
(detach): don't drop parent.
(handle_group_exit): Delete this function.
(handle_ptrace_event): Instead of handle_group_exit, just drop tcb;
do not panic if we see WIFEXITED from an attached pid;
print "+++ exited with EXITCODE +++" for every WIFEXITED pid.
* syscall.c (internal_syscall): Do not treat sys_exit specially -
don't call internal_exit on it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
02a08fb6f08e21e464b629f20e1601f1176b5be9 11-Aug-2011 Sergei Trofimovich <slyfox@gentoo.org> Declare printrusage32() on Alpha

* defs.h [ALPHA] (printrusage32): New declaration.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
/external/strace/defs.h
1b0df40644ca23fe068d7f004dbc15b07ff85086 20-Jul-2011 Dmitry V. Levin <ldv@altlinux.org> Check for additional PTRACE_* constants

* configure.ac (AC_CHECK_DECLS): Add PTRACE_O_TRACESYSGOOD,
PTRACE_O_TRACEEXEC, PTRACE_O_TRACEEXIT, PTRACE_EVENT_EXEC,
PTRACE_EVENT_VFORK_DONE and PTRACE_EVENT_EXIT.
* defs.h [LINUX]: Define these PTRACE_* constants when they are not
provided by <sys/ptrace.h>.

Reported-by: Douglas Mencken <dougmencken@gmail.com>
Reported-by: Steve Bennett <steveb@workware.net.au>
/external/strace/defs.h
9015cd9f9e33d4457bdb50dbafe1ce943a5f3a96 24-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Make IOCTL_WSTOP more readable

* defs.h: Make IOCTL_WSTOP more readable

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
ead73bd3493c517fde508aecf6bc097aeae1752c 24-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Make a few variables static.

* defs.h: Remove tcbtab declaration.
* strace.c: Make run_uid, run_gid, outf, tcbtab, progname
global variables static

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
91ecfac9b61691c0ba2d878c5398c6db52c7624e 23-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Add a comment about setbpt. No code changes.

* defs.h: Add a comment about setbpt().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
65d7c4d66c209dce592a5a2ec0d1f83eef6b2f28 23-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove TCB_FOLLOWFORK

TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow
all [v]forks/clones or don't follow any, therefore global variable
followfork is an already existing indicator of what we want to do.
This patch drops all setting/clearing of TCB_FOLLOWFORK bit,
and replaces checks for this bit by checks of followfork value.
In internal_fork, check is moved to in front of if(), since
the check is needed on both "entering" and "exiting" branch.

* defs.h: Remove TCB_FOLLOWFORK define.
* process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK,
test followfork instead of tcp->flags & TCB_FOLLOWFORK.
(handle_new_child): Likewise.
* strace.c (startup_attach): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
2b60c35b33cf22a88405c60db1e620880d05a7d4 22-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Delete fork_tcb()

Get rid of fork_tcb() function. It used to do what the comment
above it says, but now it doesn't do much:
it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls
expand_tcbtab(). The second operation is not necessary, since
alloc_tcp() will do it itself when needed.
This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK
where it was formerly called. It also makes nprocs, tcbtabsize and
expand_tcbtab() static. (While at it, I nuked redundant
extern char **environ declaration: strace.c had *two* of them...)

* defs.h: Remove declarations of nprocs, tcbtabsize and
expand_tcbtab.
* process.c (fork_tcb): Remove this function.
(internal_fork): Open-code fork_tcb.
(handle_new_child): Likewise.
* strace.c: Remove redundant "extern char **environ". Declare
nprocs and tcbtabsize static.
(expand_tcbtab): Make it static.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
b56d6d3bfeeb8889ea18105033acfba6f3fcbf51 21-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove write-only nchildren member from struct tcb

* defs.h: Remove nchildren member from struct tcb.
* process.c (handle_new_child): Remove inc/decrements of tcp->nchildren.
(internal_fork): Likewise.
* strace.c (startup_attach): Likewise.
(droptcb): Likewise.
(alloc_tcb): Remove initialization of tcp->nchildren.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
f0a5f6d7107ade2ea9c425330655e97d11d17d79 21-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove write-only nzombies member from struct tcb

* defs.h: Remove nzombies member from struct tcb.
* strace.c (droptcb): Remove "tcp->parent->nzombies++".
(alloc_tcb): Remove "tcp->nzombies = 0".

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
f44cce48bbbd573cc5ae801f69f857433160b03a 21-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Fix regression introduced by "Properly handle real SIGTRAPs" change

Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54
introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set.
The check (tcp->parent == NULL) in old code was meant to check
"if we are not a child created by auto-attach" - in this case,
options need to be set on the child; otherwise they are inherited
and do not need to be set.
I misunderstood the check and if tcp->parent is not NULL, I was
setting only ptrace_setoptions_for_all bits.
This change fixes the problem. Since the fixed logic makes it
unnecessary to keep two sets of options in separate variables,
I merge them back into one variable, ptrace_setoptions.

* defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all
into one variable, ptrace_setoptions.
* strace.c: Likewise.
(test_ptrace_setoptions_followfork): Use ptrace_setoptions variable.
(test_ptrace_setoptions_for_all): Likewise.
(main): Likewise.
* process.c (internal_fork): Likewise.
(internal_exec): Likewise.
* strace.c (trace): Fix the bug where different options were set
depending on "tcp->parent == NULL" condition. Add a comment
which makes it more clear why this condition is checked.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
0df9ed47af7a9385a2fbe6ba688ed4fc24ab0c00 18-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Do not suspend waitpid.

strace used to suspend waitpid until there is a child
for waitpid'ing process to collect status from.
Apparently, it was done because in some very old kernels
(circa 2002 or even earlier) there were ptrace bugs which
were making waitpid in real parent to not see children.
This kernel bug is fixed long ago. This change removes the workaround.
test/wait_must_be_interruptible.c is a test program which
illustrates why without this change strace changes
programs's behavior.

* defs.h: Delete waitpid and nclone_waiting members from from struct tcb.
Remove declaration of internal_wait().
* process.c (internal_wait): Remove this function.
* strace.c (alloc_tcb): Do not set tcp->nclone_waiting.
(resume): Remove this function.
(resume_from_tcp): Remove this function.
(detach): Do not call resume_from_tcp().
(handle_group_exit): Do not call resume_from_tcp().
* syscall.c (internal_syscall): Do not call internal_wait().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
8884968a46f5413345de7b0085388a367eb9caae 14-Jun-2011 Dmitry V. Levin <ldv@altlinux.org> Add argument to tprint_iov() specifying whether to decode each iovec

* defs.h (tprint_iov): Add decode_iov argument.
* io.c (tprint_iov): Implement new decode_iov argument.
(sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update
tprint_iov calls.
* net.c (do_msghdr): Likewise.
/external/strace/defs.h
fcda7a5f4fcfbedb5493bbfc1b37e53c6b3a575c 13-Jun-2011 Dmitry V. Levin <ldv@altlinux.org> Introduce ARRAY_SIZE() macro

* defs.h (ARRAY_SIZE): New macro.
* ioctl.c: Use it.
* pathtrace.c (pathmatch, storepath): Likewise.
* process.c (printpriv): Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
/external/strace/defs.h
b63256e69bf3f1a74aadb0e14556490bc8f4ef95 07-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Whitespace cleanups. no code changes.

* bjm.c: Fix tabulation (such as extra spaces before tabs),
convert punctuation where it deviates from prevalent form
elsewhere in strace code, convert sizeof and offsetof where
it deviates from from prevalent form, remove space between
function/macro/array names and (parameters) or [index],
add space between "if" and (condition), correct non-standard
or wrong indentaion.
* defs.h: Likewise
* desc.c: Likewise
* file.c: Likewise
* ipc.c: Likewise
* linux/arm/syscallent.h: Likewise
* linux/avr32/syscallent.h: Likewise
* linux/hppa/syscallent.h: Likewise
* linux/i386/syscallent.h: Likewise
* linux/ioctlsort.c: Likewise
* linux/m68k/syscallent.h: Likewise
* linux/microblaze/syscallent.h: Likewise
* linux/powerpc/syscallent.h: Likewise
* linux/s390/syscallent.h: Likewise
* linux/s390x/syscallent.h: Likewise
* linux/sh/syscallent.h: Likewise
* linux/sh64/syscallent.h: Likewise
* linux/tile/syscallent.h: Likewise
* linux/x86_64/syscallent.h: Likewise
* mem.c: Likewise
* net.c: Likewise
* pathtrace.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* sunos4/syscall.h: Likewise
* sunos4/syscallent.h: Likewise
* svr4/syscall.h: Likewise
* svr4/syscallent.h: Likewise
* syscall.c: Likewise
* system.c: Likewise
* test/childthread.c: Likewise
* test/leaderkill.c: Likewise
* test/skodic.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/defs.h
75422766d51cf96ea081977c9d0b26b2ba1a8ade 27-May-2011 Denys Vlasenko <dvlasenk@redhat.com> Cleanups on top of "handle SIGTRAP properly" change,
based on Dmitry's comments.

* defs.h ([p]error_msg[_and_die]): Declare new functions.
* strace.c (SYSCALLTRAP): Rename to syscall_trap_sig.
([p]error_msg[_and_die]): Define new functions.
(strace_tracer_pid): New variable, it controls which pid will
do cleanup on exit via [p]error_msg_and_die.
(main): Set strace_tracer_pid to our initial pid.
(startup_attach): Change strace_tracer_pid if we are in -D mode.
(test_ptrace_setoptions_for_all): Minor changes to logic,
such as better diagnostic messages.
/external/strace/defs.h
f8bc0655a0db6fd3031384a88cdc707285029ca5 24-May-2011 Denys Vlasenko <dvlasenk@redhat.com> Don't perform TCB_WAITEXECVE wait if not needed.

* defs.h (ptrace_setoptions_for_all): Expose this variable.
* strace.c (ptrace_setoptions_for_all): Remove "static".
* process.c (internal_exec): Don't set TCB_WAITEXECVE bit
if we know that post-execve SIGTRAP is not going to happen.
/external/strace/defs.h
3454e4b463e6c22c7ea8c5461ef5a077f4650a54 23-May-2011 Denys Vlasenko <dvlasenk@redhat.com> Properly handle real SIGTRAPs.

* defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork.
* process.c (internal_fork): Ditto.
* strace.c (ptrace_setoptions_for_all): New variable.
(SYSCALLTRAP): New variable.
(error_msg_and_die): New function.
(test_ptrace_setoptions_for_all): New function.
(main): Call test_ptrace_setoptions_for_all() at init.
(handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it).
(trace): Check events and set ptrace options without -f too.
Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP.
/external/strace/defs.h
8a08277d13d0378c2ff3ce851534c3bf7e31defa 07-Apr-2011 Grant Edwards <grant.b.edwards@gmail.com> Add ability to print file descriptor paths and filter by those paths

* pathtrace.c: New file, implements matching syscall arguments to
user-specified file paths.
* Makefile.am (strace_SOURCES): Add pathtrace.c.
* defs.h (TCB_FILTERED, filtered): New defines.
(getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
tracing_paths): New declarations.
* strace.c (show_fd_path, tracing_paths): New global variables.
(usage, main): Implement handling of -y and -P options.
* strace.1: Add descriptions of -y and -P options.
* syscall.c (trace_syscall_entering): Add path matching logic to the
print/noprint decision and set the TCB_FILTERED bit appropriately.
(trace_syscall_exiting): Use filtered() macro that checks the
TCB_FILTERED bit to determine print/noprint status.
* util.c (printfd): Use getfdpath().
/external/strace/defs.h
03aefdadb20f3bdd05bf644dc2ce1e85758a5aee 15-Mar-2011 Dmitry V. Levin <ldv@altlinux.org> Ensure that PTRACE_GETSIGINFO et al are always defined on Linux

* configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants.
* defs.h [LINUX]: Define those PTRACE_* constants that are not provided
by <sys/ptrace.h>.
/external/strace/defs.h
3138213bc9a827a372ad9f8009ebcc5d8797ce2d 04-Mar-2011 Dmitry V. Levin <ldv@altlinux.org> Fix decoding of file descriptors

* defs.h (printfd): New function prototype.
* util.c (printfd): New function.
* file.c (print_dirfd): Update prototype to use printfd().
(sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat,
sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat,
sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd().
(sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64,
sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64,
sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync,
sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr,
sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64,
sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch,
sys_fallocate): Use printfd() for decoding of file descriptors.
* desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2,
decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for
decoding of file descriptors.
* io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread,
sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64,
sys_ioctl): Likewise.
* mem.c (print_mmap, sys_mmap64): Likewise.
* signal.c (do_signalfd): Likewise.
* stream.c (decode_poll): Likewise.
* time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise.
Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.
/external/strace/defs.h
10a16a76fc04ec692a255c7ca2f4aac2e19df2c1 07-Sep-2010 Dmitry V. Levin <ldv@altlinux.org> Simplify tprintf() declaration

* defs.h (tprintf): Simplify declaration.
/external/strace/defs.h
7655fa090707a94c5ed34128e0d36da75af95198 05-Feb-2011 Dmitry V. Levin <ldv@altlinux.org> * defs.h (SYSCALL_NEVER_FAILS): Fix typo.
/external/strace/defs.h
50a218d4ac83e6adf6f44785037dd25bd8037921 18-Jan-2011 Dmitry V. Levin <ldv@altlinux.org> Fix decoding of get[ug]id, gete[ug]id and setfs[ug]id return values

* defs.h (SYSCALL_NEVER_FAILS): New syscall flag.
* linux/dummy.h: Change redirection for sys_get[ug]id, sys_gete[ug]id
and setfs[ug]id.
* linux/*/syscallent.h: Set SYSCALL_NEVER_FAILS flag for get[ug]id,
gete[ug]id and setfs[ug]id syscalls.
* process.c [LINUX] (sys_getuid, sys_setfsuid): New functions.
* syscall.c (NF): New shorthand macro for use in syscallent.h files.
(get_error): Check SYSCALL_NEVER_FAILS flag.
Reported by Марк Коренберг <socketpair@gmail.com>.
/external/strace/defs.h
4ef6db489a8a51ae03ffb78b58c679162a39f3c3 15-Jan-2011 Dmitry V. Levin <ldv@altlinux.org> Add block ioctl support

* block.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h [LINUX] (block_ioctl): New function.
* ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK*
ioctls.
Patch by Jeff Mahoney <jeffm@suse.com>
/external/strace/defs.h
b9c525790c158404c96ce8508e42a9217d1760d3 13-Dec-2010 Carmelo AMOROSO <carmelo.amoroso@st.com> sh: Fix compilation warning in do_pipe due to missing prototype

* defs.h [SH]: Make getrval2 prototype visible to do_pipe
and fix the following compiler warning:
.../net.c: In function 'do_pipe':
.../net.c:1632: warning: implicit declaration of function 'getrval2'
.../net.c:1632: warning: format '%lu' expects type 'long unsigned int',
but argument 3 has type 'int'

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
/external/strace/defs.h
696381ec63ec200c5211643e4a4324d58b3031c4 14-Dec-2010 Dmitry V. Levin <ldv@altlinux.org> Fix build on uClibc

* defs.h [LINUX]: Define PTRACE_GETEVENTMSG macro.
Patch by Douglas Mencken <dougmencken@gmail.com>.
/external/strace/defs.h
ca8ab8d2958f86297a6574a73cc1b9759d59c9b1 12-Nov-2010 Wang Chao <wang.chao@cn.fujitsu.com> Handle followfork using ptrace_setoptions if available

If PTRACE_O_TRACECLONE et al options are supported by kernel,
use them to do followfork rather than the original setbpt
method that changes registers ourselves.

* defs.h [LINUX] (handle_new_child): New function prototype.
* process.c [LINUX] (handle_new_child): New function based on the
code from internal_fork(), with a trivial change: do reparent only
for sys_clone.
[LINUX] (internal_fork): Use handle_new_child(). Do nothing if
ptrace_setoptions is in effect.
* strace.c [LINUX] (handle_ptrace_event): New function.
[LINUX] (trace): If ptrace_setoptions is in effect, then
call the new function to handle PTRACE_EVENT_* status, and
set PTRACE_SETOPTIONS when we see the initial stop of tracee.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/defs.h
b13c0de058585de7d47778a8923426b89bfffbb5 12-Nov-2010 Wang Chao <wang.chao@cn.fujitsu.com> Test how PTRACE_SETOPTIONS support works

Currently test fork related options only. Fork a child that uses
PTRACE_TRACEME at startup and then does a fork so strace can test
how the PTRACE_SETOPTIONS support works before it handles any real
tracee. Since PTRACE_O_TRACECLONE/*FORK were introduced to kernel
at the same time, this test seems to be enough for these 3 options.

* defs.h [LINUX]: Define PTRACE_O_TRACECLONE et al macros here.
(ptrace_setoptions): New variable declaration.
* strace.c [LINUX] (test_ptrace_setoptions): New function, tests
whether kernel supports PTRACE_O_CLONE/*FORK, the result is stored
in the new variable ptrace_setoptions for later use.
(main): Call test_ptrace_setoptions() if followfork option is set.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/defs.h
30145dda9d7ff70df1d5ad750a183572c73e8963 07-Sep-2010 Dmitry V. Levin <ldv@altlinux.org> Fix const-correctness issues uncovered by gcc -Wwrite-strings

* defs.h (struct xlat): Add const qualifier to the field of
type "char *".
(set_sortby, qualify, printnum, printnum_int): Add const qualifier to
arguments of type "char *".
* count.c (set_sortby): Add const qualifier to the argument and
automatic variable of type "char *".
* desc.c (decode_select): Add const qualifier to automatic variables of
type "char *".
* ioctlsort.c (struct ioctlent): Add const qualifier to fields of
type "char *".
(main): Add const qualifier to argv.
* process.c (printargv): Add const qualifier to the argument and
automatic variable of type "char *".
(printargc) Add const qualifier to argument of type "char *".
* signal.c (sprintsigmask, parse_sigset_t): Add const qualifier to
arguments of type "char *".
* strace.c (progname): Add const qualifier.
(detach): Add const qualifier to automatic variable of type "char *".
* stream.c (struct strbuf): Add const qualifier to the field of
type "char *".
* syscall.c (struct qual_options): Add const qualifier to fields of
type "char *".
(qual_syscall, qual_fault, qual_desc, lookup_class): Add const qualifier
to arguments of type "char *".
(qual_signal): Add const qualifier to the argument of type "char *",
avoid modification of constant argument.
(qualify): Likewise.
* util.c (printflags): Add const qualifier to automatic variable of
type "char *".
(printnum, printnum_int): Add const qualifier to arguments of
type "char *".
/external/strace/defs.h
21b8db4eb966a6098c7cd10bd6cf0ce8ec59cab8 27-Aug-2010 Wang Chao <wang.chao@cn.fujitsu.com> Drop nclone_detached and related flags

Remove nclone_detached since CLONE_DETACHED flag was no-op for a very
long time in kernel.

* defs.h (struct tcb): Remove nclone_detached field.
Remove TCB_CLONE_DETACHED flag.
* process.c: Remove CLONE_DETACHED flag.
(clone_flags): Remove CLONE_DETACHED entry.
(internal_fork, internal_wait): Remove code dealing with CLONE_DETACHED
flag and nclone_detached.
* strace.c (startup_attach, alloc_tcb, droptcb, handle_group_exit):
Likewise.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/defs.h
d69fa497f4729373618fb7b506a2362422487ab1 12-Jul-2010 Andreas Schwab <schwab@linux-m68k.org> Add biarch support for powerpc64

* acinclude.m4 (AC_LITTLE_ENDIAN_LONG_LONG): Use int instead of
long.
* configure.ac [$host_cpu = powerpc*]: Also define POWERPC64 if
$host_cpu = powerpc64.
* defs.h (SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE)
(PERSONALITY1_WORDSIZE) [POWERPC64]: Define.
* file.c: (struct stat_powerpc32, printstat_powerpc32) [POWERPC64]:
Define.
(printstat) [LINUX && POWERPC64]: Use printstat_powerpc32 in
32-bit personality.
(sys_newfstatat) [POWERPC64]: Handle personalities.
* signal.c (sys_sigreturn) [POWERPC64]: Likewise.
* util.c (printllval) [POWERPC64]: Likewise.
(printcall) [POWERPC64]: Use wider format for IP prefix.
* syscall.c (get_scno) [POWERPC64]: Check for 64/32 bit mode.
* linux/powerpc/errnoent1.h: New file.
* linux/powerpc/ioctlent1.h: New file.
* linux/powerpc/signalent1.h: New file.
* linux/powerpc/syscallent1.h: New file.
/external/strace/defs.h
102e69a3ea49c2833e2c95bf1babcaa0761d0ed7 03-Jul-2010 Andreas Schwab <schwab@linux-m68k.org> Remove extern declaration at file scope

* defs.h (force_result): Declare.
* process.c (internal_wait): Don't declare force_result.
/external/strace/defs.h
e3a7ef5a2a3ac31bfa0d3f9ce65981e51700073e 28-Mar-2010 Dmitry V. Levin <ldv@altlinux.org> Implement -C option to combine regular and -c output

* defs.h (cflag_t): New enum.
* strace.1: Document -C option.
* strace.c (cflag): Update type.
(main): Handle -C option.
(trace): Update use of cflag.
* count.c (count_syscall): Move clearing of TCB_INSYSCALL to ...
* syscall.c (trace_syscall): ... here. Update use of cflag.
Based on patch by Adrien Kunysz.
/external/strace/defs.h
c8c6698ef7cde83a496b273672a51ec2a8f14fb3 28-Dec-2009 Chris Metcalf <cmetcalf@tilera.com> Add support for the TILE architecture

* configure.ac: Add TILE to the list of supported architectures.
* defs.h: Define TCB_WAITEXECVE for TILE.
* linux/tile/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add linux/tile/syscallent.h
* process.c (change_syscall, struct_user_offsets): Add TILE support.
* syscall.c (get_scno, get_error, syscall_enter): Likewise.
* mem.c (mmap_flags, print_mmap): Add MAP_CACHE_xxx TILE extensions
support.
* signal.c (sigact_flags): Add SA_NOPTRACE.
(sys_sigreturn): Add TILE support.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
/external/strace/defs.h
e5e60858063f214fcd7860f50f8bcb46f951f9ab 31-Dec-2009 Dmitry V. Levin <ldv@altlinux.org> Remove dead code

* defs.h (tv_tv): Remove.
* net.c (sys_xsetsockaddr): Remove commented out dead code.
* process.c (setarg, sys_execv, sys_execve, struct_user_offsets):
Likewise.
* signal.c (sys_sigsuspend): Likewise.
* strace.c (reaper, trace): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
* syscall.c (trace_syscall): Likewise.
* term.c (term_ioctl): Likewise.
* util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt):
Likewise.
/external/strace/defs.h
257e15737d8f0550d9ab01c039047d37bc823cbd 26-Dec-2009 Dmitry V. Levin <ldv@altlinux.org> Merge Linux internal_clone() into internal_fork()

* defs.h (internal_clone): Remove.
* process.c (internal_clone): Merge into internal_fork().
(internal_fork) [!LINUX]: Remove dead code.
* syscall.c (internal_syscall): Replace internal_clone() with
internal_fork().
/external/strace/defs.h
e5355de95c495dcfc616509f88c4fb5f9996b8e6 27-Oct-2009 Andreas Schwab <schwab@redhat.com> Remove support for pre-C89

* defs.h: Remove references to __STDC__ and P macros.
* strace.c: Likewise.
/external/strace/defs.h
b5600fc3df0453ba11f254a9b49add3ffbec9733 04-Nov-2009 Andreas Schwab <schwab@redhat.com> Factor out printing of 64bit syscall argument

* defs.h (ALIGN64): Remove.
(printllval): Declare.
* util.c (printllval): Define.
* file.c (sys_readahead): Use printllval.
(sys_lseek64): Likewise.
(sys_truncate64): Likewise.
(sys_ftruncate64): Likewise.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Likewise.
(sys_fallocate): Likewise.
* io.c (sys_pread): Likewise.
(sys_pwrite): Likewise.
(sys_pread64): Likewise.
(sys_pwrite64): Likewise.
* mem.c (sys_mmap64): Likewise.
/external/strace/defs.h
ccdff481c086611488c5df70550fcf8fe907e7af 27-Oct-2009 Andreas Schwab <schwab@redhat.com> Maintain separate print column for each process

* defs.h (struct tcp): Add curcol.
* strace.c: (alloc_tcb): Initialize it.
(trace): Use curcol from current process and save it before
continuing.
(tprintf): Don't modify curcol on output error.
/external/strace/defs.h
8566c500253f3bef38ace7d6031f76fe5d21f7e0 12-Oct-2009 Mike Frysinger <vapier@gentoo.org> sparc/linux: Rewrite to use asm/ptrace.h

The current sparc/linux code uses asm/reg.h, but recent Linux kernels
dropped that header completely. So switch over to the ptrace headers
as those should stick around indefinitely as part of the ABI.

* defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define.
* process.c: Drop asm/regs.h include.
[SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs.
* signal.c: Drop asm/regs.h include.
(m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS].
[SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs.
* syscall.c: Drop asm/regs.h include.
[SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result,
syscall_enter): Change struct regs to struct pt_regs.
* util.c: Drop asm/regs.h include.
(_hack_syscall5, _ptrace): Delete.
[SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change
struct regs to struct pt_regs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/defs.h
67874d8393499e3c7f0d5a950f2707758560f61f 06-Oct-2009 Dmitry V. Levin <ldv@altlinux.org> * defs.h [HPPA]: Lower MAX_ARGS from 32 to 6.
/external/strace/defs.h
eb9e2e8904ce85a6c7390be25bb873c6db88c4d3 03-Jun-2009 Roland McGrath <roland@redhat.com> Revert unapproved commits.
/external/strace/defs.h
eedaac768dcb55346292495440f1201bd7b2b1b4 10-Mar-2009 Denys Vlasenko <dvlasenk@redhat.com> Decode fcntl's F_{GET,SET}LEASE, F_NOTIFY, and F_DUPFD_CLOEXEC.
By Mike Frysinger (vapier AT gentoo.org)
* desc.c: Add F_SETLEASE, F_GETLEASE, F_NOTIFY,
F_DUPFD_CLOEXEC to fcntlcmds[]. Create notifyflags[] array.
(sys_fcntl): Handle new flags.

Optimize printing of open modes.
* defs.h: Declare sprint_open_modes(),
remove unused parameter in tprint_open_modes().
* desc.c (sprint_open_modes): Move fuction definition from here...
* file.c (sprint_open_modes): To here.
(tprint_open_modes): Use sprint_open_modes(), it already
generates needed string.
* ipc.c: Remove unused parameter from calls
to tprint_open_modes().
/external/strace/defs.h
c71016ea799c6ca5b7bfca60eb845266af9c065f 06-Mar-2009 Denys Vlasenko <dvlasenk@redhat.com> defs.h: cosmetics (wrap overlong line)
/external/strace/defs.h
5ae2b7c601dadf79a4345e1ee21053947b9e4add 27-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> AVR32 support by Hans-Christian Egtvedt
(hans-christian.egtvedt AT atmel.com).
* configure.ac: Make it recognize avr32.
* defs.h: Define LINUX_AVR32.
* linux/avr32/syscallent.h: New file.
* Makefile.am: Reference linux/avr32/syscallent.h.
* proc.c (change_syscall, setarg): Add support for avr32.
(struct xlat struct_user_offsets[]): Ditto.
* syscall.c (get_scno): Ditto.
(get_error, force_result, syscall_enter): Ditto.
* util.c (getpc, printcall): Ditto.
/external/strace/defs.h
4dedd561d61562fe66f1a0b673ad33ac6a1e3c71 24-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> Replace many more bare ptrace calls with calls to wrappers
which do proper error-checking and set tcp->ptrace_errno.
In some cases, missing error checking is added.
Error handling for trace_syscall() failures and other cases
where tcp->ptrace_errno is nonzero is cleaned up a bit
and made more verbose if we see error other than ESRC.
Some comments are added or expanded.
* defs.h: Declare ptrace_cmds[]. Modify do_ptrace
declaration (last parameter is long, not void *).
* process.c: Make ptrace_cmds[] non-static.
(change_syscall): Use do_ptrace() instead of bare ptrace().
* signal.c: Use do_ptrace() instead of bare ptrace().
* strace.c: Update trace_syscall() failure handling.
* syscall.c: Use do_ptrace() instead of bare ptrace().
* util.c: Use do_ptrace() instead of bare ptrace().
Update do_ptrace() wrapper.
(str_PTRACE_xxx): New function - helper returning "PTRACE_xxx".
(do_ptrace_peekdata): New function - wrapper for PTRACE_PEEKDATA
(do_ptrace5): New function - wrapper for 5-argument ptrace calls.
/external/strace/defs.h
84e20af5a6f3d6e02c24579b60a282053ef01e0e 10-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> Cleanup after tcb table expansion simplification.
There was code which was trying to continue tracing
even if table expansion fails. Now we treat it as fatal
failure, so this code is removed by this change.
* defs.h: Delete TCB_FOLLOWFORK constant.
* process.c: Delete fork_tcb() and all calls of it.
* strace.c (startup_attach): Remove usage of TCB_FOLLOWFORK.
* syscall.c: Indent preprocessor directives.
/external/strace/defs.h
3bb7cd6660032e97f76e8f62efd3540dbba97656 09-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> * defs.h: Correct the comment about TCB_SUSPENDED.
* strace.c: Fix misplaced #endif.
* util.c: Indent preprocessor directives, mark code parts
which can never be reached by compilation because of
the combination of #if directives. These are likely dead code,
I want to remove them later.
/external/strace/defs.h
59432dbb333959618b5afdb9a7513d1ab0289a14 26-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * process.c (printwaitn): Add comment about wait4() pid expansion.
Use #ifdef ALPHA instead of LINUX_64BIT, it was misleading
(by implying "any 64-bit platform").
* defs.h: Remove now-unused LINUX_64BIT define.
* resource.c (sys_osf_getrusage): Fix indentation.
/external/strace/defs.h
418d66a847bda4867c59e604c0d07c64ed53e320 17-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> Two cleanups: tcb table expansion failure is not really a survivable
event, we do not have any viable way to continue. No wonder most
places where that is detected have FIXMEs.
It's way simpler to treat as fatal failure, and handle it inside
tcb table expansion finctions.
Second cleanup: tidy up haphazard locations of a few externs.

* defs.h: Change return type of expand_tcbtab() to void.
Declare change_syscall().
* process.c: Change all callsites of alloctcb(), alloc_tcb() and
fork_tcb(), removing now-redundant error checks.
(fork_tcb): Change return type to void - it can't fail now.
* strace.c: Move extern declarations out of function bodies.
Change all callsites of alloctcb(), alloc_tcb() and
fork_tcb(), removing now-redundant error checks.
(expand_tcbtab): Change return type to void - it can't fail now.
On failure to expand, print a message, clean up, and exit.
(alloc_tcb): On failure to expand, print a message, clean up, and exit.
* util.c (setbpt): Remove extern declaration from function body.
/external/strace/defs.h
1d5b113f8c013b11afa10de8393e770b29c648fd 17-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * defs.h: Update a comment. No code changes.
* strace.c (handle_stopped_tcbs): Discard all execve stops
and clear TCB_WAITEXECVE bit.
* syscall.c (get_scno): Add the code to not mistakenly
treat ptrace stop as execve stop (execve stops can be blocked
by traced program).
Fixes RH#477775 "strace hangs if the target process blocks SIGTRAP".
/external/strace/defs.h
f535b54bc40373c81b13df0975aef4212dacbbde 13-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> Fixes for ptrace() argument parsing.
* process.c: Add parsing of PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG,
PTRACE_GETSIGINFO, PTRACE_SETSIGINFO.
* strace.c (handle_stopped_tcbs): Make PTRACE_SETOPTIONS
define check more robust.
* defs.h: Declare several "extern const struct xlat" arrays here.
* desc.c: Remove open_mode_flags[] and open_access_modes[]
extern declarations.
* net.c: Remove open_mode_flags[] extern declaration.
* sock.c: Remove addrfams[] extern declaration.
* util.c: Remove struct_user_offsets[] extern declaration.
* signal.c: Remove open_mode_flags[] extern declaration.
/external/strace/defs.h
215cc2703763894faea05899642ea5dfd5fc5c95 09-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * defs.h: Add new struct tcb fields: wait_status, next_need_service.
make flags field wider (ints are easier to work with on many CPUs).
* strace.c (trace): Split this function into two:
collect_stopped_tcbs() and handle_stopped_tcbs().
Now we collect *all* waitable tasks, then handle them all,
then repeat.
Fixes RH#478419 "Some threads stop when strace with -f option
is executed on a multi-thread process"
* test/many_looping_threads.c: example program which cna't be straced
successfully without this fix.
/external/strace/defs.h
ef2fbf856cf775981b52278c80ce2a74a44019f4 06-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> Output format fixes, improving the situation after recent
change which added better handling of processes suddenly
disappearing. Now we often do not finish last line
before exiting in those cases.
The only change affecting something other than output
is change in umovestr where we were calling
abort() on ptrace error.

* strace.c (trace): If trace_syscall() failed with ESRCH,
finish current output line with " <unfinished ...>".
(mp_ioctl): While we are at it, fix gross style mismatch
in this function definition. No code chages.
* syscall.c (trace_syscall): If decode fails on syscall exit,
finish current output line with "= ? <unavailable>".
* util.c (umoven): Do not complain if error is ESRCH.
(umovestr): Do not complain and do not abort() if error is ESRCH.
* defs.h: Remove unused tcp parameter from printtrailer().
* process.c: Adjust printtrailer() calls accordingly.
* strace.c: Adjust printtrailer() calls accordingly.
* syscall.c: Adjust printtrailer() calls accordingly.
/external/strace/defs.h
bc161ecae6dc18cef8739e6c066eb91ba8bf2634 02-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick,
and what syscall_fixup() is expected to do. Comments only, no code changes.
/external/strace/defs.h
8ba1cd7d122b5323f9a1ac8be494ddbc1352d5cd 30-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> Patch by Kirill A. Shutemov:
Fix some warnings on ARM build.
* defs.h: include <sys/ptrace.h> on arm too.
* syscall.c: EABI arm does not need decode_subcall(), ifdef it out.
/external/strace/defs.h
96d5a76109b4f1d1f4c9c76641e6ec896108083d 29-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> * defs.h: Remove sigtrap80 field from struct tcb.
* strace.c: Add ptrace_stop_sig static variable
and use it in place of tcp->sigtrap80.
Add ptrace_opts_set static flag variable.
(trace): Set ptrace options once, not per-process.
If unexpected SIGTRAP is later received,
revert back to using SIGTRAP
(assume old, broken kernel).
/external/strace/defs.h
1e3ce32a4fadb58230bca4f16baf8152579dd3d0 22-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> Make strace correctly handle SIGTRAP produced by e.g.
kill(2) and by trapping instruction.
* defs.h: Add sigtrap80 field to struct tcb.
* strace.c (alloc_tcb): Initialize it to SIGTRAP.
(detach): Use tcp->sigtrap80 instead of SIGTRAP constant.
(trace): Attempt to set PTRACE_O_TRACESYSGOOD and
PTRACE_O_TRACEEXEC options on each newly attached process,
distinquish between SIGTRAP and (SIGTRAP | 0x80) stops.
Fixes RH#162774 "strace ignores int3 SIGTRAP".
/external/strace/defs.h
732d1bf4d4aaff68eff1c41d8900264637a57dfe 17-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> Make strace somewhat resilient against process disappearing
under its claws. Prime example is sudden SIGKILL.
Fixes RH#472053
/external/strace/defs.h
932fc7d4fc1a29e8b8bcea5685db3f6c2e212e36 16-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> This patch does not change any logic.

It merely passes tcp pointer to upeek instead of pid.
This is needed if one wants to check or change
some tcp fields.

I have patches which require this. I can imagine someone else
eventually needing to look at tcp for completely orthogonal reasons.
/external/strace/defs.h
87ea1f4fe68c6110a96a76f8601b3e204200082d 10-Nov-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-10-23 Mike Frysinger <vapier@gentoo.org>

Port strace to the Blackfin architecture.
* configure.ac: Add bfin to supported architectures.
* process.c: Skip u_fpvalid/u_fpstate for Blackfin architecture.
(change_syscall): Support Blackfin architecture.
* syscall.c: Declare r0 for Blackfin architecture.
(get_scno): Decode Blackfin syscall number.
(syscall_fixup): Extract Blackfin return value.
(get_error): Decode Blackfin return value.
(force_result): Poke Blackfin return value.
(syscall_enter): Extract Blackfin syscall arguments.
* defs.h: Define TCB_WAITEXECVE for Blackfin architecture.
* linux/syscall.h (sys_sram_alloc): Declare for Blackfin
architecture.
* system.c (sys_sram_alloc): Decode Blackfin sram_alloc() syscall.
* util.c (getpc): Handle PC on Blackfin architecture.
(printcall): Likewise.
* linux/bfin/ioctlent.h, linux/bfin/syscallent.h: New Blackfin
headers.
* Makefile.am (EXTRA_DIST): Add linux/bfin/ioctlent.h and
linux/bfin/syscallent.h.
/external/strace/defs.h
2e55ff4562e87f8361f0c1db5a42ee6e9ac0cc56 03-Sep-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>

* syscall.c (is_restart_error): New function.
* defs.h (is_restart_error): Declare it.

* linux/dummy.h (sys_nanosleep): Uncouple from sys_adjtime().
* time.c (sys_nanosleep): New function, based on is_restart_error().
/external/strace/defs.h
639658b75493e752b2bccfa4c03c411a860a8912 01-Aug-2008 Roland McGrath <roland@redhat.com> 2008-07-31 Roland McGrath <roland@redhat.com>

* configure.ac: Add AC_HEADER_STDBOOL.
* defs.h [HAVE_STDBOOL_H]: #include <stdbool.h>.
Fixes Debian##492774.
/external/strace/defs.h
c07538a2da61e1ed1b70706442b7de99a3b852de 22-Jul-2008 Roland McGrath <roland@redhat.com> 2008-07-21 Roland McGrath <roland@redhat.com>

* defs.h [LINUXSPARC]: Don't #include <linux/a.out.h>.
/external/strace/defs.h
41c48227a86a176da333f713d5047240885f25cc 18-Jul-2008 Roland McGrath <roland@redhat.com> 2008-07-03 Jan Kratochvil <jan.kratochvil@redhat.com>

Trace even VFORK on -f on all the platforms.
* strace.1 <-f>: Describe Linux catches new children immediately.
<-F>: Make the option obsolete. Move the SunOS VFORK comment to the
`-f' option description.
* defs.h (followvfork): Declaration removed.
* strace.c (followvfork): Variable removed.
(main) <-F>: Merge with the `-f' option.
(trace): Make !FOLLOWVFORK unconditional.
* process.c (internal_fork): Make !FOLLOWVFORK unconditional.
/external/strace/defs.h
5670331bf1ffb36fa815ddb817064e7f08dd2d97 20-May-2008 Roland McGrath <roland@redhat.com> 2008-01-25 Bruna Moreira <bruna.moreira@indt.org>

* defs.h [ARM]: Define SUPPORTED_PERSONALITIES to 2.
* syscall.c (get_scno) [ARM]: Add support for architecture specific
syscalls.
* linux/arm/syscallent.h: Update network syscalls list.
* linux/arm/syscallent1.h: New file. Add new architecture specific
syscalls.
* linux/arm/errnoent1.h: New file.
* linux/arm/ioctlent1.h: New file.
* linux/arm/signalent1.h: New file.
Fixes Debian#441000.
/external/strace/defs.h
542c2c6fe2b93ae73221dd5c5c8ed95a73b676e4 20-May-2008 Roland McGrath <roland@redhat.com> 2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>

* defs.h [MIPS]: Include <sgidefs.h>.
(MAX_QUALS): Update for MIPS.
(LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define.
(struct tcb): Add ext_arg for MIPS N32.
(TCB_WAITEXECVE): Define for MIPS.
(ALIGN64): Use LINUX_MIPSO32.
* file.c (sys_lseek): Use ext_arg for MIPS N32.
(sys_readahead, sys_fadvise64_64): Likewise.
* io.c (sys_pread64, sys_pwrite64): Likewise.
* mem.c (print_mmap): Take OFFSET argument.
(sys_old_mmap): Update call to print_mmap.
(sys_mmap): Use ext_arg for MIPS N32.
* process.c (struct_user_offsets): Add MIPS registers.
* signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64. Correct
MIPS O32 call to sprintsigmask.
* syscall.c (internal_syscall): Handle MIPS N32. Check for
TCB_WAITEXECVE on MIPS.
(force_result): Add a comment about MIPS N32.
(syscall_enter): Handle MIPS N32 and MIPS N64.
* linux/syscall.h (sys_pread64, sys_pwrite64): Declare.
* linux/mips/syscallent.h: Include "dummy.h". Handle alternate
MIPS ABIs.
/external/strace/defs.h
6bc09daaf6b249b35dec4283b165b1f39e6d6a0d 01-Nov-2007 Roland McGrath <roland@redhat.com> 2007-09-22 Dmitry V. Levin <ldv@altlinux.org>

* time.c (print_timespec, sprint_timespec): New functions.
* defs.h (print_timespec, sprint_timespec): Declare them.
* desc.c (sys_io_getevents): Use print_timespec.
* stream.c (sys_ppoll): Likewise.
(decode_poll): Use sprint_timespec.
/external/strace/defs.h
a6c0d8c90a1cc3117f70281968d9efe6de755d83 01-Nov-2007 Roland McGrath <roland@redhat.com> 2007-09-22 Dmitry V. Levin <ldv@altlinux.org>

* desc.c (sprintflags): Remove static qualifier, add "prefix"
argument, move function to ...
* util.c (sprintflags): ... here.
* defs.h (sprintflags): Declare it.
/external/strace/defs.h
5aa0434fe990c2137f6e16fb69ff6279832ab393 12-Sep-2007 Roland McGrath <roland@redhat.com> 2007-09-11 Roland McGrath <roland@redhat.com>

* defs.h [LINUXSPARC]: Use asm/psrcompat.h for [SPARC64], not asm/psr.h.
From Jakub Bogusz <qboosh@pld-linux.org>.
/external/strace/defs.h
6afc5659acc3df3d2e446ba4aa3a76bdd7264e1b 24-Jul-2007 Roland McGrath <roland@redhat.com> 2007-07-23 Ulrich Drepper <drepper@redhat.com>

* defs.h: Add new parameter to printtv_bitness prototype.
(printttv): Pass zero for the new parameter.
(printtv_special): New macro.
* desc.c (decode_select): Pass zero for the new parameter of
printtv_bitness.
* file.c (utimensatflags): New macro.
(sys_osf_utimes): Pass zero for the new parameter of
printtv_bitness.
(sys_utimes): Likewise.
(sys_futimesat): Likewise.
(decode_utimes): Add new parameter. Pass it to the
printtv_bitness calls. Fix printing of time values.
(sys_utimensat): New function.
* time.c (UTIME_NOW, UTIME_OMIT): Define if not already
happened.
(printtv_bitness): Add new parameter. Print special UTIME_*
values as strings if set.
(sys_osf_gettimeofday): Pass zero for the new parameter of
printtv_bitness.
(sys_osf_settimeofday): Likewise.
* linux/syscall.h: Declare sys_utimensat.
* linux/syscallent.h: Add utimensat entry.
* linux/x86_64/syscallent.h: Likewise.
/external/strace/defs.h
b011af5ef077fcfc2ad967579dcb1e5ed9b3193e 30-Jun-2007 Dmitry V. Levin <ldv@altlinux.org> 2007-03-29 Vladimir Nadvornik <nadvornik@suse.cz>
Dmitry V. Levin <ldv@altlinux.org>

Trace linux SG_IO ioctl arguments and results.
* scsi.c: New file.
* Makefile.am (strace_SOURCES): Add scsi.c
* defs.h (scsi_ioctl): New function.
* ioctl.c (ioctl_decode): Use scsi_ioctl().
/external/strace/defs.h
9b5b67eb43bf90e83834126dfde4472e5a721080 12-Jan-2007 Dmitry V. Levin <ldv@altlinux.org> 2007-01-11 Dmitry V. Levin <ldv@altlinux.org>

Fix open(2) flags parser.
* defs.h (tprint_open_modes): New function.
* desc.c (sprint_open_modes): New function.
(sys_fcntl): Use tprint_open_modes() and sprint_open_modes().
* file.c (openmodes): Split xlat into open_access_modes and
open_mode_flags.
(tprint_open_modes): New function.
(decode_open): Use it.
* ipc.c (sys_mq_open, printmqattr): Likewise.
Fixes RH#222385.
/external/strace/defs.h
ab9008bc085848e6c898cd38b7415baa161c5890 11-Jan-2007 Dmitry V. Levin <ldv@altlinux.org> 2006-12-27 Dmitry V. Levin <ldv@altlinux.org>

Add const qualifier to xlookup() return value

* defs.h (xlookup): Add const qualifier to return value.
* desc.c (sprintflags): Likewise.
* process.c (printpriv): Update xlookup() use.
* signal.c (sprintsigmask): Add const qualifier to first argument and return value.
* util.c (xlookup): Add const qualifier to return value.
(printxval): Update xlookup() use.
/external/strace/defs.h
7d61ff1dbf7226ed35a35c12b8b642bd5fc9a0a9 21-Dec-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-12-21 Dmitry V. Levin <ldv@altlinux.org>

Move counts code to separate file.
* count.c: New file.
* Makefile.am (strace_SOURCES): Add count.c.
* syscall.c (call_counts, countv, counts, shortest, time_cmp,
syscall_cmp, count_cmp, sortfun, overhead, set_sortby,
set_overhead, call_summary_pers, call_summary): Move to count.c
* count.c (count_syscall): New function.
* defs.h (count_syscall): Declare it.
* syscall.c (trace_syscall): Use it.
/external/strace/defs.h
10de62bb052b541af3d0566f05f3f870cce0e028 13-Dec-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-12-12 Dmitry V. Levin <ldv@altlinux.org>

Fix -ff -o behaviour. Fix piping trace output.
* defs.h (newoutf): Remove.
(alloctcb): Rename to alloc_tcb. Add alloctcb() macro wrapper
around alloc_tcb().
* process.c [!USE_PROCFS] (internal_clone, internal_fork):
Remove newoutf() call.
* strace.c (set_cloexec_flag, strace_fopen, strace_popen,
swap_uid): New functions.
(popen_pid): New variable.
(newoutf): Make static, use strace_fopen().
(main): Use strace_fopen() and strace_popen(), remove uids
swapping. Do not open outfname when followfork > 1.
Reinitialize tcp->outf properly.
(alloctcb): Rename to alloc_tcb. Use newoutf().
(trace): Check popen_pid. Remove newoutf() call.
[USE_PROCFS] (proc_open, proc_poll_open): Use set_cloexec_flag().
Fixes RH#204950, RH#218435.
/external/strace/defs.h
a7945a3d4e144674a8dd1d885e7086bc274e391b 13-Dec-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>

Add biarch support for "struct timeval".
* defs.h (bitness_t): New enum type.
(printtv_bitness, sprinttv): New function prototypes.
(printtv): Convert to macro wrapper around printtv_bitness().
(printtv32): Remove.
* desc.c (decode_select): Use printtv_bitness() and sprinttv().
(sys_oldselect, sys_osf_select, sys_select, sys_pselect6):
Update decode_select() use.
* file.c [ALPHA] (sys_osf_utimes): Use printtv_bitness().
* time.c (printtv_bitness, sprinttv): New functions.
(printtv, printtv32): Remove.
[ALPHA] (sys_osf_settimeofday, sys_osf_settimeofday):
Use printtv_bitness().
Fixes RH#171626, RH#173050.
/external/strace/defs.h
4ebb4e3d312bb8215f4eea9130cce6bb8bdb972f 13-Dec-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>

Add biarch support for "struct iovec".
* defs.h (personality_wordsize): Add.
* io.c [HAVE_SYS_UIO_H] (tprint_iov): [LINUX &&
SUPPORTED_PERSONALITIES > 1] Handle 32-bit personality.
* util.c [HAVE_SYS_UIO_H] (dumpiov): [LINUX &&
SUPPORTED_PERSONALITIES > 1] Likewise.
Patch from Jakub Jelinek.
Fixes RH#218433.
/external/strace/defs.h
b9fe011cdfb0a3014e68a6e82007b6c2703a340b 13-Dec-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-12-10 Dmitry V. Levin <ldv@altlinux.org>

Make several global variables static.
#ifdef definitions of rarely unused functions.
* defs.h (rflag, tflag, outfname): Remove.
* strace.c (iflag, interactive, pflag_seen, rflag, tflag,
outfname, username): Make static.
* desc.c (sys_getdtablesize): Define only for
ALPHA || FREEBSD || SUNOS4.
* file.c (sys_fchroot): Define only for SUNOS4 || SVR4.
(sys_mkfifo): Define only for FREEBSD.
* mem.c (sys_sbrk): Define only for FREEBSD || SUNOS4.
(sys_getpagesize): Define only for
ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4.
* net.c (sys_so_socket): Define only for SVR4.
* process.c (sys_gethostid): Define only for
FREEBSD || SUNOS4 || SVR4.
(sys_gethostname): Define only for
ALPHA || FREEBSD || SUNOS4 || SVR4.
(sys_setpgrp): Define only for ALPHA || SUNOS4 || SVR4.
(sys_execv): Define only for SPARC || SPARC64 || SUNOS4.
* signal.c (sys_sigblock): Define only for FREEBSD || SUNOS4.
(sys_sighold, sys_sigwait): Define only for SVR4.
(sys_killpg): Define only for FREEBSD || SUNOS4.
* stream.c (sys_getmsg): Define only for
SPARC || SPARC64 || SUNOS4 || SVR4.
* syscall.c (sys_indir): Define only for SUNOS4.
/external/strace/defs.h
95ebf5abfc1f3ed8b451b7816aa51b93a49e3ef7 13-Oct-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-10-13 Ulrich Drepper <drepper@redhat.com>
Bernhard Kaindl <bk@suse.de>
Dmitry V. Levin <ldv@altlinux.org>
Michael Holzheu <holzheu@de.ibm.com>

Add hooks for new syscalls. Add decoders for *at, inotify*,
pselect6, ppoll and unshare syscalls.

* defs.h: Declare print_sigset.
* desc.c (sys_pselect6): New function.
* file.c (decode_open, decode_access, decode_mkdir,
decode_readlink, decode_chmod, decode_utimes, decode_mknod):
New functions.
(sys_open, sys_access, sys_mkdir, sys_readlink, sys_chmod,
sys_utimes, sys_mknod): Use them.
[LINUX] (fstatatflags, unlinkatflags, inotify_modes): New
variables.
[LINUX] (print_dirfd, sys_openat, sys_faccessat,
sys_newfstatat, sys_mkdirat, sys_linkat, sys_unlinkat,
sys_symlinkat, sys_readlinkat, sys_renameat, sys_fchownat,
sys_fchmodat, sys_futimesat, sys_mknodat, sys_inotify_add_watch,
sys_inotify_rm_watch): New functions.
* process.c [LINUX] (sys_unshare): New function.
* signal.c (print_sigset): New function.
(sys_sigprocmask): Use it.
* stream.c (decode_poll): New function.
(sys_poll): Use it.
[LINUX] (sys_ppoll): New function.
* linux/syscall.h: Delcare new syscall handlers.
* linux/syscallent.h: Hook up new syscalls.
* linux/alpha/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
Fixes RH#178633.
/external/strace/defs.h
aca9a74264bb2460f014fb0b2935c25a03e79646 12-Oct-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-04-21 Dmitry V. Levin <ldv@altlinux.org>

* defs.h [LINUX && X86_64 && !__NR_exit_group]: Define
__NR_exit_group.
/external/strace/defs.h
4b2dccaf943adf4ff2b6e15c1f51a59652f8da36 12-Jan-2006 Roland McGrath <roland@redhat.com> 2006-01-12 Roland McGrath <roland@redhat.com>

* defs.h [LINUXSPARC] (PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE):
New macros.
[SPARC64] (PERSONALITY2_WORDSIZE): New macro.
[X86_64] (PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE): New macros.
* syscall.c (PERSONALITY0_WORDSIZE): New macro if undefined.
(personality_wordsize): New variable.
(decode_subcall): Use it for size of argument words.
Fixes RH#174354.
/external/strace/defs.h
138c6a334fd9949d6147c63ada02cf55472e02c0 12-Jan-2006 Roland McGrath <roland@redhat.com> 2005-11-17 Dmitry V. Levin <ldv@altlinux.org>

Implement qual_flags support for each personality.
* strace.c (main): Move qualify calls after set_personality call.
* syscall.c (qual_flags0): New variable..
[SUPPORTED_PERSONALITIES >= 2] (qual_flags1): New variable.
[SUPPORTED_PERSONALITIES >= 3] (qual_flags2): New variable.
(qual_flags): Change variable definition from array to pointer.
(set_personality): Initialize qual_flags variable.
(qualify_one): Add "pers" argument to specify personality.
[SUPPORTED_PERSONALITIES >= 2]: Set qual_flags1 if requested.
[SUPPORTED_PERSONALITIES >= 3]: Set qual_flags2 if requested.
(qual_syscall): Pass personality to qualify_one.
[SUPPORTED_PERSONALITIES >= 2]: Look for syscall also in sysent1
table.
[SUPPORTED_PERSONALITIES >= 3]: Look for syscall also in sysent2
table.
(qual_signal): Pass personality to qualify_one.
(qual_desc): Likewise.
(qualify): Use qualify_one instead of manual qual_flags
manipulations.
[SUPPORTED_PERSONALITIES >= 2]: Look for syscall also in sysent1
table.
[SUPPORTED_PERSONALITIES >= 3]: Look for syscall also in sysent2
table.
* defs.h: Update qual_flags declaration.
Fixes RH#173986.
/external/strace/defs.h
165155a9c63b7076e60a74a44c86f8d8b308c9c4 19-Jul-2005 Roland McGrath <roland@redhat.com> 2005-07-19 Roland McGrath <roland@redhat.com>

* defs.h [LINUX] [M68K] (__NR_exit_group): Define it if missing.
Fixes Debian#315500.
/external/strace/defs.h
2fe7b13b2f893f7647408af98576affe2b9b123d 05-Jul-2005 Roland McGrath <roland@redhat.com> 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>

Introduce "-e trace=desc".
* defs.h (TRACE_DESC): New flag.
* syscall.c: Define TD macro before include of syscallent files
and undefine it afterwards.
(lookup_class): Recognize "desc" keyword.
* strace.1: Document "-e trace=desc".
* freebsd/i386/syscallent.h: Mark those syscalls which take a
file descriptor as an argument or return a file descriptor with
TD flag.
* linux/alpha/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent2.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* sunos4/syscallent.h: Likewise.
* svr4/syscallent.h: Likewise.
Fixes RH#159400.
/external/strace/defs.h
9814a94bd10aea81b8bcb29e2ba167b09d70cedb 05-Jul-2005 Roland McGrath <roland@redhat.com> 2005-07-04 Roland McGrath <roland@redhat.com>

* util.c (printnum_int): New function, printnum with s/long/int/.
* defs.h: Declare it.
* net.c (printsockopt): Use it for int-sized option.
Fixes RH#162449.
/external/strace/defs.h
a4d4853f679014799a6608cc8114e6ce7f37ae89 08-Jun-2005 Roland McGrath <roland@redhat.com> 2005-06-08 Dmitry V. Levin <ldv@altlinux.org>

Minor namespace cleanup.
* defs.h (string_quote): Remove declaration.
* file.c (openmodessol) [LINUXSPARC]: Make static.
(fileflags): Likewise.
(aclcmds, aclipc) [HAVE_SYS_ACL_H]: Likewise.
(direnttypes) [FREEBSD || LINUX]: Likewise.
(xattrflags): Likewise.
* process.c (unalignctl_string): Make static.
(setarg): Disable.
* syscall.c (subcalls_table): Make static.
(socket_map) [!(LINUX && (ALPHA || MIPS))]: Likewise.
(sparc_socket_decode): Make static, define for [SPARC || SPARC64] only.
(decode_subcall): Make static.
(syscall_fixup): Likewise.
(get_error): Likewise.
(syscall_enter): Likewise.
* util.c (tv_tv): Disable.
(getpc): Likewise.
(string_quote): Make static.
Fixes RH#159688.
/external/strace/defs.h
76989d7a16cb9683d0a75a6261f18ced66d0c04a 08-Jun-2005 Roland McGrath <roland@redhat.com> 2005-06-06 Roland McGrath <roland@redhat.com>

* defs.h (struct sysent): New member `native_scno'.
(known_scno): Declare new function.
* linux/syscallent.h: Add new final field to interesting syscalls.
* syscall.c (known_scno): New function.
(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
* process.c (internal_fork, internal_exit): Likewise.
[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
* strace.c (proc_open): Likewise.
* util.c [LINUX] (setbpt): Likewise.
* linux/syscall.h: Remove [!defined(X86_64)] from conditional
for defining SYS_socket_subcall et al.
* linux/syscallent.h: Likewise for #error check.
* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
Fixes RH#158934.
/external/strace/defs.h
aa524c88c49814863cb7f19e5c8a8eeca6ce22fe 01-Jun-2005 Roland McGrath <roland@redhat.com> 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>

Deal with memory management issues.
* defs.h (tprint_iov): Update prototype.
* desc.c (sys_epoll_wait) [HAVE_SYS_EPOLL_H]: Do not allocate
epoll_event array of arbitrary size on the stack, to avoid
stack overflow.
* file.c (print_xattr_val): Check for integer overflow during
malloc size calculation, to avoid heap corruption.
* io.c (tprint_iov) [HAVE_SYS_UIO_H]: Check for integer overflow
during malloc size calculation, to avoid heap corruption.
Change iovec array handling to avoid heap memory allocation.
* mem.c (get_nodes) [LINUX]: Check for integer overflow during
size calculation and do not allocate array of arbitrary size on
the stack, to avoid stack overflow.
* net.c (printcmsghdr) [HAVE_SENDMSG]: Do not allocate array of
arbitrary size on the stack, to avoid stack overflow. Do not
trust cmsg.cmsg_len to avoid read beyond the end of allocated
object.
(printmsghdr) [HAVE_SENDMSG]: Update tprint_iov() usage.
* process.c (sys_setgroups): Check for integer overflow during
malloc size calculation, to avoid heap corruption. Change gid_t
array handling to avoid heap memory allocation.
(sys_getgroups): Likewise.
(sys_setgroups32) [LINUX]: Likewise.
(sys_getgroups32) [LINUX]: Likewise.
* stream.c (sys_poll) [HAVE_SYS_POLL_H]: Check for integer
overflow during malloc size calculation, to avoid heap corruption.
Change pollfd array handling to avoid heap memory allocation.
* system.c (sys_sysctl) [LINUX]: Check for integer overflow
during malloc size calculation, to avoid heap corruption.
* util.c (dumpiov) [HAVE_SYS_UIO_H]: Check for integer overflow
during malloc size calculation, to avoid heap corruption.
Fixes RH#159196.
/external/strace/defs.h
b2dee13345a62c80a677f3342cd525d611fbc632 01-Jun-2005 Roland McGrath <roland@redhat.com> 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>

* util.c (printxval): Change third argument from "char *" to
"const char *".
(printflags): Add third argument, "const char *", with similar
meaning to the third argument of printxval().
* defs.h (printxval): Change third argument from "char *" to
"const char *".
(printflags): Add third argument.
* bjm.c (sys_query_module) [LINUX]: Pass third argument to
printflags().
* desc.c (sys_fcntl): Likewise.
(sys_flock) [LOCK_SH]: Likewise.
(print_epoll_event) [HAVE_SYS_EPOLL_H]: Likewise.
* file.c (sys_open): Likewise.
(solaris_open) [LINUXSPARC]: Likewise.
(sys_access): Likewise.
(sys_chflags, sys_fchflags) [FREEBSD]: Likewise.
(realprintstat) [HAVE_LONG_LONG_OFF_T &&
HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
(printstat64) [HAVE_STAT64 &&
HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
(sys_setxattr, sys_fsetxattr): Likewise.
* ipc.c (sys_msgget, sys_msgsnd, sys_msgrcv, sys_semget,
sys_shmget, sys_shmat) [LINUX || SUNOS4 || FREEBSD]: Likewise.
(sys_mq_open) [LINUX]: Likewise.
(printmqattr) [HAVE_MQUEUE_H]: Likewise.
* mem.c (print_mmap) [!HAVE_LONG_LONG_OFF_T]: Likewise.
(sys_mmap64) [_LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T]: Likewise.
(sys_mprotect): Likewise.
(sys_mremap, sys_madvise, sys_mlockall) [LINUX]: Likewise.
(sys_msync) [MS_ASYNC]: Likewise.
(sys_mctl) [MC_SYNC]: Likewise.
(sys_remap_file_pages, sys_mbind, sys_get_mempolicy) [LINUX]:
Likewise.
* net.c (printmsghdr) [HAVE_STRUCT_MSGHDR_MSG_CONTROL]: Likewise.
(sys_send, sys_sendto): Likewise.
(sys_sendmsg) [HAVE_SENDMSG]: Likewise.
(sys_recv, sys_recvfrom): Likewise.
(sys_recvmsg) [HAVE_SENDMSG]: Likewise.
(printicmpfilter) [ICMP_FILTER]: Likewise.
* proc.c (proc_ioctl) [SVR4 && !HAVE_MP_PROCFS || FREEBSD]: Likewise.
* process.c (sys_clone) [LINUX]: Likewise.
(printwaitn): Likewise.
(sys_waitid) [SVR4 || LINUX]: Likewise.
* signal.c (sys_sigvec) [SUNOS4 || FREEBSD]: Likewise.
(sys_sigaction): Likewise.
(printcontext) [SVR4]: Likewise.
(print_stack_t) [LINUX) || FREEBSD]: Likewise.
(sys_rt_sigaction) [LINUX]: Likewise.
* sock.c (sock_ioctl) [LINUX]: Likewise.
* stream.c (sys_putmsg, sys_getmsg): Likewise.
(sys_putpmsg) [SYS_putpmsg]: Likewise.
(sys_getpmsg) [SYS_getpmsg]: Likewise.
(sys_poll): Likewise.
(print_transport_message) [TI_BIND]: Likewise.
(stream_ioctl): Likewise.
* system.c (sys_mount, sys_reboot): Likewise.
(sys_cacheflush) [LINUX && M68K]: Likewise.
(sys_capget, sys_capset) [SYS_capget]: Likewise.
* term.c (term_ioctl) [TIOCMGET]: Likewise.
* time.c (sys_clock_nanosleep, sys_timer_settime) [LINUX]:
Likewise.
Fixes RH#159310.
/external/strace/defs.h
15dca8e307086cb2a53045046fe4791dc7afe378 06-Feb-2005 Roland McGrath <roland@redhat.com> 2004-12-19 Dmitry V. Levin <ldv@altlinux.org>

* strace.c (main) [!USE_PROCFS]: In child process, raise SIGSTOP
right before execv() call. Remove fake_execve() call.
* defs.h (fake_execve): Remove unused declaration.
* process.c (fake_execve): Remove unused function.
Fixes RH#143365.
/external/strace/defs.h
795edb11488dd47c4598e2228e3b5431de7ed46d 02-Feb-2005 Roland McGrath <roland@redhat.com> 2004-12-20 Dmitry V. Levin <ldv@altlinux.org>

* configure.ac: Use AC_GNU_SOURCE macro instead of changing CFLAGS.
* defs.h [HAVE_CONFIG_H]: Include config.h first.
* strace.c: Include "defs.h" first.
Fixes RH#143370.
/external/strace/defs.h
d83c50b8e44db2a2e19d048ab7d1e1caf1fa1996 07-Oct-2004 Roland McGrath <roland@redhat.com> 2004-09-13 Ulrich Drepper <drepper@redhat.com>, Dmitry V. Levin <ldv@altlinux.org>

* time.c [LINUX] (print_rtc): New function, for printing rtc_time
structure.
[LINUX] (rtc_ioctl): New function, for parsing RTC_* ioctls.
* ioctl.c [LINUX] (ioctl_decode): Call rtc_ioctl.
* defs.h [LINUX]: Declare rtc_ioctl.
Fixes RH#58606.
/external/strace/defs.h
51d1ebc33a514719ed4fc3a18b70cc9967e752d3 07-Sep-2004 Michal Ludvig <mludvig@suse.cz> 2004-09-07 Michal Ludvig <mludvig@suse.cz>

* defs.h (nioctlents1, nsignals2): Fix typos in decls.
/external/strace/defs.h
ee36ce19e03e08f4b692570090ee58b72d2f0f50 04-Sep-2004 Roland McGrath <roland@redhat.com> 2004-09-03 Roland McGrath <roland@redhat.com>

* syscall.c (sysent0, sysent1, sysent2, sysent): Add const to defn.
(nsyscalls0, nsyscalls1, nsyscalls2): Likewise.
(errnoent0, errnoent1, errnoent2, errnoent): Likewise.
(nerrnos0, nerrnos1, nerrnos2): Likewise.
* signal.c (signalent0, signalent1, signalent2): Likewise.
(nsignals0, nsignals1, nsignals2): Likewise.
(signame): LIkewise.
* ioctl.c (ioctlent0, ioctlent1, ioctlent2): Likewise.
(nioctlents0, nioctlents1, nioctlents2): Likewise.
(ioctl_lookup, ioctl_next_match): Likewise.
* defs.h: Update decls.
* io.c (sys_ioctl): Update users.
/external/strace/defs.h
d9f816f60457930af27349fac3d23b3b78338036 04-Sep-2004 Roland McGrath <roland@redhat.com> 2004-09-03 Roland McGrath <roland@redhat.com>

* util.c (xlookup, printxval, addflags, printflags): Use const for
struct xlat * argument.
* defs.h (xlookup, printxval, addflags, printflags): Update decls.
* bjm.c: Add const to all struct xlat defns.
* desc.c: Likewise.
* file.c: Likewise.
* ipc.c: Likewise.
* mem.c: Likewise.
* net.c: Likewise.
* proc.c: Likewise.
* process.c: Likewise.
* resource.c: Likewise.
* signal.c: Likewise.
* sock.c: Likewise.
* stream.c: Likewise.
* system.c: Likewise.
* term.c: Likewise.
* time.c: Likewise.
* util.c: Likewise.
/external/strace/defs.h
c74c0b732b66139d59e616210718950f2853f3aa 01-Sep-2004 Roland McGrath <roland@redhat.com> 2004-09-01 Roland McGrath <roland@redhat.com>

* process.c (internal_wait): Take second arg giving index of flags
argument.
* defs.h: Update prototype.
* syscall.c (internal_syscall): Update caller.
Also use internal_wait for SYS_waitid.
* process.c (sys_waitid): Define for [LINUX] as well.
Don't tweak TCB_SUSPENDED--internal_wait does that.
(waitid_types): Conditionalize use of nonstandard P_* macros.
/external/strace/defs.h
6d1a65c759c6c650e47ce5045a26380a4acbdffa 12-Jul-2004 Roland McGrath <roland@redhat.com> 2004-07-07 David S. Miller <davem@nuts.davemloft.net>

* linux/sparc/syscallent.h: Sync with reality.
* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
sys_removexattr, sys_lremovexattr, sys_fremovexattr,
sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
sys_timer_settime, sys_timer_gettime): New declarations.
* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
linux/sparc64/signalent.h, linux/sparc64/signalent.h,
linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
linux/sparc64/syscallent1.h: New files.
* defs.h (LINUXSPARC): Define also when SPARC64.
(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
Define possibly missing __NR_exit_group. Declare getrval2.
* configure.ac (sparc64): New architecture case.
* config.h.in (SPARC64): New define.
* file.c (stat_sparc64): New structure.
(printstat_sparc64): New output routine for that.
(printstat): Call it, if personality is 2.
(printstat64): Likewise.
* util.c: Conditionalize ptrace defines on LINUXSPARC
not LINUX && SPARC.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(_hack_syscall5): Correct trap number when SPARC64.
(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
(getpc): Handle SPARC64 && LINUX.
(printcall): Likewise.
(arg fetching/setting): Use same code for SPARC64 LINUX
as for SPARC.
(setbpt): Handle SPARC64 && LINUX.
(clearbpt): Likewise.
* signal.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(m_siginfo): Use same definition on SPARC64 as SPARC.
(sys_sigreturn): Handle LINUX && SPARC64.
* syscall.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(getscno): Use same static state on SPARC64 as SPARC,
and add SPARC64 handling.
(get_error): Handle LINUX && SPARC64.
(force_result): Likewise.
(syscall_enter): Likewise.
(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
just like SPARC.
(getrval2): Handle LINUX && SPARC64.
* process.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(change_syscall): Handle LINUX && SPARC64.
(struct_user_offsets): Ifdef out those which do not exist
on SPARC64.
* net.c (sys_pipe): Handle LINUX && SPARC64.
* ioctl.c: Fix initializer typo for nioctlents2, was
nioctlents1 by accident.
/external/strace/defs.h
7b54a7ae61d0eda798575f77d898a24dda7a0952 04-Jun-2004 Roland McGrath <roland@redhat.com> 2004-06-03 Roland McGrath <roland@redhat.com>

* strace.c (main) [LINUX]: Expand TCBTAB as necessary for threads
attached. Attach threads only under -f. Set TCB_FOLLOWFORK in them.
(expand_tcbtab): New function, broken out of ...
* process.c (fork_tcb): ... here, call that.
* defs.h: Declare expand_tcbtab.
/external/strace/defs.h
b4ce17690f176b972a8cb5cbdd1005bbd4aecf15 01-Mar-2004 Roland McGrath <roland@redhat.com> 2004-02-26 Andreas Schwab <schwab@suse.de>

* defs.h [LINUX && IA64]: Declare getrval2 also on IA64.
* net.c (sys_pipe) [LINUX && IA64]: For IA64 use the two return values.
* syscall.c (getrval2) [LINUX && IA64]: Implement for IA64.
/external/strace/defs.h
2843a4e1d2fca851be6e47e7ff2413b45903ac9a 14-Nov-2003 Roland McGrath <roland@redhat.com> 2003-09-06 Dmitry V. Levin <ldv@altlinux.org>

* defs.h (ioctl_lookup): Prototype change.
* ioctl.c (ioctl_next_match): New function.
* defs.h: Declare it.
* io.c (sys_ioctl): Use it, to display all possible ioctl names
when there's more than one match.
* ioctl.c (ioctl_lookup): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
Patch from Solar Designer <solar@openwall.com>.
/external/strace/defs.h
6bc1220fe3f10e16919f182ad394c35619fe2e7f 13-Nov-2003 Roland McGrath <roland@redhat.com> 2003-09-06 Dmitry V. Levin <ldv@altlinux.org>

* util.c (printuid): New function.
* defs.h: Declare it.
* file.c (sys_chown): Use it.
* file.c (sys_fchown): Likewise.
* process.c (sys_setreuid, sys_setregid, sys_setresuid,
sys_setresgid): Likewise.
/external/strace/defs.h
c0f8bbda62139da801bb761d8c66724e12638087 21-Aug-2003 Roland McGrath <roland@redhat.com> 2003-07-28 Daniel Jacobowitz <drow@mvista.com>

* defs.h (ALIGN64): Define for MIPS.
* io.c (PREAD_OFFSET_ARG): Define.
(sys_pread, sys_pwrite): Use it.
* process.c (struct_user_offsets) [SH]: Check whether REG_XDREG0
is defined.
* linux/sh/syscallent.h (pread, pwrite): Take six arguments.
(truncate64, ftruncate64): Pretty-print.
* linux/mips/syscallent.h (pread, pwrite): Take six arguments.
(truncate64, ftruncate64): Take four arguments.
/external/strace/defs.h
f5a477788ed49d3c15e2080c03d30d4beaeefee3 27-Jun-2003 Roland McGrath <roland@redhat.com> 2003-06-26 Roland McGrath <roland@redhat.com>

* configure.ac: SHMEDIA -> SH64
* defs.h: Likewise.
* mem.c: Likewise.
* process.c: Likewise.
* sock.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.
* linux/shmedia/syscallent.h: Moved to ...
* linux/sh64/syscallent.h: ... here.
/external/strace/defs.h
0f87c4972f20f102149e3ec84073c0e9d53e146d 04-Jun-2003 Roland McGrath <roland@redhat.com> 2003-06-03 Roland McGrath <roland@redhat.com>

Linux/ARM improvements from Russell King <rmk@arm.linux.org.uk>:
* defs.h [LINUX] (TCB_WAITEXECVE): Define for [ARM] too.
* process.c (struct_user_offsets) [LINUX] [ARM]: Add ARM registers.
* signal.c [LINUX] (sys_sigreturn) [ARM]: New case.
* syscall.c (get_scno, syscall_fixup) [LINUX] [ARM]: Case rewritten.
(get_error) [LINUX] [ARM]: Update.
(syscall_enter) [LINUX] [ARM]: New case.
* util.c (printcall) [LINUX] [ARM]: New case.
/external/strace/defs.h
e1e584b8fa0d97caad461f82a5427cd37d6327f3 02-Jun-2003 Roland McGrath <roland@redhat.com> 2003-06-02 Roland McGrath <roland@redhat.com>

* configure.ac, defs.h, mem.c, process.c, sock.c, syscall.c, util.c:
Merged in SHmedia port from Stephen Thomas <stephen.thomas@superh.com>.
/external/strace/defs.h
0962345a5775e0eea75c3ec408fb4807e851e7f0 23-May-2003 Roland McGrath <roland@redhat.com> 2003-05-22 Roland McGrath <roland@redhat.com>

* defs.h (struct tcb): New member `nzombies'.
* strace.c (alloctcb): Initialize it.
(droptcb): Increment our parent's zombie count.
* process.c (internal_wait): Don't go into TCB_SUSPENDED if the
process has zombies it can reap. On the way out, if we reaped
an untraced process, decrement the zombie count.
/external/strace/defs.h
96dc5148ff0d74a44853431f4eb6b6143de3f71c 20-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-20 Roland McGrath <roland@redhat.com>

* defs.h [LINUX] [S390 || S390X] (TCB_WAITEXECVE): Define it.
* syscall.c (get_scno, syscall_fixup) [LINUX] [S390 || S390X]: Handle
TCB_WAITEXECVE state with special kludges.
/external/strace/defs.h
e6d3a2957c2bae7bde8ecd638892adc89aac1346 14-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-14 Roland McGrath <roland@redhat.com>

* defs.h (ALIGN64): Fix defn for PPC, same as FreeBSD one.
* defs.h [_LARGEFILE64_SOURCE] (_LFS64_LARGEFILE): Define it.
* linux/syscallent.h: Use sys_getdents64, sys_truncate64,
sys_ftruncate64, instead of printargs, for those syscalls.
/external/strace/defs.h
f5c450d3c5353a74b0370b27594c70d3ad74ef47 14-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-13 Roland McGrath <roland@redhat.com>

* defs.h [POWERPC] (UESP, EIP, EAX, ORIG_EAX): Remove this cruft.
[LINUX && POWERPC && !__powerpc64__] (ALIGN64): New macro.
* io.c (sys_pread, sys_pwrite): Use ALIGN64.
From Anton Blanchard <anton@samba.org>.
/external/strace/defs.h
923f75011953091f1e0c5b734f7ff98f71f9791b 09-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-08 Roland McGrath <roland@redhat.com>

Support for new Linux 2.5 thread features.
* defs.h [LINUX]: Define __NR_exit_group if not defined.
(struct tcb): New members nclone_threads, nclone_detached,
and nclone_waiting.
(TCB_CLONE_DETACHED, TCB_CLONE_THREAD, TCB_GROUP_EXITING): New macros.
(waiting_parent): Macro removed.
(pid2tcb): Declare it.
* process.c (internal_clone) [TCB_CLONE_THREAD]: Reparent the new
child to our parent if we are a CLONE_THREAD child ourselves.
Maintain TCB_CLONE_THREAD and TCB_CLONE_DETACHED flags and counts.
(internal_wait) [TCB_CLONE_THREAD]: Factor out detached children when
determining if we have any. If TCB_CLONE_THREAD is set, check
parent's children instead of our own, and bump nclone_waiting count.
(internal_exit) [__NR_exit_group]: Set the TCB_GROUP_EXITING flag if
the syscall was exit_group.
* syscall.c (internal_syscall): Use internal_exit for exit_group.
* strace.c (pid2tcb): No longer static.
(alloctcb) [TCB_CLONE_THREAD]: Initialize new fields.
(droptcb) [TCB_CLONE_THREAD]: Maintain new fields.
If we have thread children, set TCB_EXITING and don't clear the TCB.
(resume) [TCB_CLONE_THREAD]: Decrement parent's nclone_waiting.
(detach) [TCB_CLONE_THREAD]: When calling resume, check all thread
children of our parent that might be waiting for us too.
[TCB_GROUP_EXITING] (handle_group_exit): New function.
(trace) [TCB_GROUP_EXITING]: Use that in place of detach or droptcb.
/external/strace/defs.h
63d0146e83740af65b49b301772084c53c7d4598 30-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-26 Roland McGrath <roland@redhat.com>

* defs.h [LINUX && MIPS] (MAX_QUALS): Set to 5000, not 4999.
From Daniel Jacobowitz <drow@false.org>.
/external/strace/defs.h
ee9d435275fd7abf736992f84b5053ee16ec4fc7 18-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-17 Roland McGrath <roland@redhat.com>

* strace.c (tcbtab): Make this a pointer to pointers, not an array.
(tcbtabsize): New variable.
(main): Initialize them using dynamic allocation.
(alloctcb, main): Use tcbtabsize in place of MAX_PROCS; indirect.
(pid2tcb, cleanup): Likewise.
[USE_PROCFS] (pollv): Make this a pointer, not an array; make static.
(rebuild_pollv): Dynamically allocate the vector.
* defs.h (tcbtab): Update decls.
(MAX_PROCS): Macro removed, no more static limit on this.
* process.c (fork_tcb): New function.
(internal_clone, internal_fork): Use it instead of checking nprocs.
/external/strace/defs.h
17f8fb3484e94976882f65b7a3aaffc6f24cd75d 06-Nov-2002 Michal Ludvig <mludvig@suse.cz> Added switch for printing only succeeding syscalls.
/external/strace/defs.h
0e035502d28ef981636abde3139247e6fb2bfcce 23-Sep-2002 Michal Ludvig <mludvig@suse.cz> 2002-09-23 Michal Ludvig <mludvig@suse.cz>
Merged x86-64 port by Andi Kleen <ak@suse.de>
and Michal Ludvig <mludvig@suse.cz>
* Makefile.in: New target 'headers'. Failure ignored.
* acconfig.h: New defines for x86-64.
* configure.in: Ditto.
* defs.h: Ditto.
* file.c: Ditto.
* signal.c: Ditto.
* process.c: Added support for x86-64.
* util.c: Ditto.
* syscall.c: Ditto + added automatic personality switching.
* linux/syscall.h: Ditto.
* linux/x86_64: New directory.
* linux/x86_64/Makefile.in: New file.
* linux/x86_64/gentab.pl: Ditto.
* linux/x86_64/i386-headers.diff: Ditto.
* linux/x86_64/makeheaders.sh: Ditto.
* linux/x86_64/syscallent.h: Ditto.
* mem.c (print_mmap): Always print arg[4] as int.
/external/strace/defs.h
38ae88d332acd9f86a30d58158e306d795d98977 23-May-2002 John Hughes <john@Calva.COM> Improve tracing of timod ioctls
/external/strace/defs.h
ccef63782c10d9ce9da77ef7530861a3d14b1300 01-May-2002 Wichert Akkerman <wichert@deephackmode.org> Merge patch from Greg Banks for Linux/SuperH support
/external/strace/defs.h
7ab47b63e3d58dfbe32ba909b222c1bc2a88c5c0 31-Mar-2002 Wichert Akkerman <wichert@deephackmode.org> Fix signed/unsigned problems
/external/strace/defs.h
5826589d8e210c2d34c8ce496d5b7a0f54188ef0 18-Oct-2001 John Hughes <john@Calva.COM> Merge SVR4/Linux printsiginfo
/external/strace/defs.h
7b3346be42d6a1f539e95d385ee498f8b3c529f8 10-Oct-2001 Wichert Akkerman <wichert@deephackmode.org> Import lots of ia64 related changes from David Mosberger
/external/strace/defs.h
1d08dcf46dd4b2cfe3e27723c05b0aec9955c591 10-Jul-2001 John Hughes <john@Calva.COM> Merge iov fixes from Richard Kettlewell
/external/strace/defs.h
b8a85a49ae738655cec81bd9e7bcb0bd6f5c9442 28-Mar-2001 John Hughes <john@Calva.COM> Check for endianness of long long
/external/strace/defs.h
c1652e2095fcd9ac62cf2669ef6aec5fd0052851 27-Mar-2001 Wichert Akkerman <wichert@deephackmode.org> Add Linux/hppa port, patch from Richard Hirst
/external/strace/defs.h
0c79e01d74a05476f90eb4815882181fecabe3f5 08-Mar-2001 John Hughes <john@Calva.COM> replace wimpy get64 by powerful LONG_LONG :-)
/external/strace/defs.h
5a826b8427383232940249ca16f543178fbeeba4 07-Mar-2001 John Hughes <john@Calva.COM> Fix off_t args on FreeBSD
/external/strace/defs.h
bdf48f55f264a9cd2eb1b3cac8f1f87c1acad008 06-Mar-2001 John Hughes <john@Calva.COM> Merge Harald B�hme's solaris patches
/external/strace/defs.h
252997128dcb73565fc95d6a22b60079c11005c6 06-Mar-2001 John Hughes <john@Calva.COM> Use pr_syscall on UW
/external/strace/defs.h
8c7122c9519dfd46ea7c8c026eab6f7aed74cf21 16-Feb-2001 Wichert Akkerman <wichert@deephackmode.org> Test for netinet/tcp.h and udp.h and use those
/external/strace/defs.h
2e4ffe59b588159eb80e236f068278ba47735932 04-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> more FreeBSD updates
/external/strace/defs.h
bf79f2e16b090ffe59cd1e1820935680a2da7b78 01-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> Add FreeBSD support
/external/strace/defs.h
16a03d2e97415afe6cf34172a0aea97a95a0b160 10-Aug-2000 Wichert Akkerman <wichert@deephackmode.org> test/clone.c: minor fixup
Another bunch of patches from John Hughes merged:
signal.c:
+ SVR4 printcontext(): sigset_t != sigset_t*
+ getcontext returns a value, so print on exit of syscall
+ add UC_FP to ucontext_flags for OS writers that can't spell
+ sys_signal(): special case SIG_{ERR,DFL,IGN}
+ decode_subcall(): only do subcall range checking when needed
bunch of UnixWare updates
aclocal.m4, acconfig.h, configure.in: add test for long long type
/external/strace/defs.h
43a7482edbc7142b91e95d7aedeb9d121fc4880f 27-Jun-2000 Wichert Akkerman <wichert@deephackmode.org> Merge changes from Ulrich
/external/strace/defs.h
5ae21ead9f83597452f9a0517e8a51fa4823f921 01-May-2000 Wichert Akkerman <wichert@deephackmode.org> The `too much stuff, just check the ChangeLog' update
/external/strace/defs.h
fd89ced0fcea2bce54d477fa528375c2c75e4b3d 13-Apr-2000 Wichert Akkerman <wichert@deephackmode.org> Linux/MIPS uses syscalls up to >4k, so set MAX_QUALS to 4999
/external/strace/defs.h
faf722234dc8af97776f94fdda7e100fb60650a2 20-Feb-2000 Wichert Akkerman <wichert@deephackmode.org> test/vfork.c: new file to test vfork traces
test/.cvsignore: new file
defs.h: Up maximum number of traced processed to 64
strace.c: Disable some debugging code from davidm
implement setarg for more architectures
implement change_syscall
/external/strace/defs.h
8b1b40cd8b49151374d0ac2a5b1a4b459f9e0ae5 03-Feb-2000 Wichert Akkerman <wichert@deephackmode.org> Merge Trillian patches (Linux ia64)
/external/strace/defs.h
7a0b649aeace5c1e1efe4a1d7b1ae6e3a87e0d44 23-Dec-1999 Wichert Akkerman <wichert@deephackmode.org> Begin work on supporting clone
/external/strace/defs.h
ea78f0f77185f7d6d0b2055805139d96e1be816c 29-Nov-1999 Wichert Akkerman <wichert@deephackmode.org> Add UnixWare support to configure
/external/strace/defs.h
221f54f721a2f74e629bb70e34888205f68e95cc 18-Nov-1999 Wichert Akkerman <wichert@deephackmode.org> Now it builds on alpha again...
/external/strace/defs.h
f5eeabb156641482abd504fb98b039e1aae4ae87 18-Nov-1999 Wichert Akkerman <wichert@deephackmode.org> Start merging linux-ip-routing fork
/external/strace/defs.h
f90da01fd19a7779d6ed9ad66605367ae43bb2fd 31-Oct-1999 Wichert Akkerman <wichert@deephackmode.org> Add Linux MIPS support
/external/strace/defs.h
9ce1a63eb20b069607c06f9645ac5a17b418a5f3 30-Aug-1999 Wichert Akkerman <wichert@deephackmode.org> Catching up on my mail-backlog, see ChangeLog for details
/external/strace/defs.h
b859bea10a0945681ecc66a1aa06ae4cc5845af8 19-Apr-1999 Wichert Akkerman <wichert@deephackmode.org> Change number of personalities for Linux sparc to 2
Minor other fixes
/external/strace/defs.h
ce780fc9e6067b15b65ca2904c698c77503bf635 30-Mar-1999 Nate Sammons <nate@users.sourceforge.net> Add new function `signame', which returns name (SIGXXX) of numeric
signal, and replace lookups in signalent[] with calls to it.
/external/strace/defs.h
76baf7c9f6dd61a15524ad43c1b690c252cf5b7c 19-Feb-1999 Wichert Akkerman <wichert@deephackmode.org> Initial revision
/external/strace/defs.h