History log of /external/strace/process.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
57fac759ca0945f5608ed6a2228c697f8fb67cd6 18-Jun-2014 Max Filippov <jcmvbkbc@gmail.com> xtensa: sort values in struct_user_offsets

Otherwise ptrace syscall argument decoding is wrong:
ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x4048eb]) = 0
ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x3fa6cd30]) = 0
ptrace(PTRACE_PEEKUSER, 296, syscall_nr, [0x8040676d]) = 0
instead of
ptrace(PTRACE_PEEKUSER, 296, pc, [0x4048eb]) = 0
ptrace(PTRACE_PEEKUSER, 296, a1, [0x3fa6cd30]) = 0
ptrace(PTRACE_PEEKUSER, 296, a0, [0x8040676d]) = 0

* process.c (struct_user_offsets) [XTENSA]: Sort values.
/external/strace/process.c
ed69fc2dc3da87d337ddd02f9153a82a46196cdf 16-Apr-2014 Masatake YAMATO <yamato@redhat.com> unwind: move stacktrace capturing and mmap cache invalidating to trace_syscall_entering

Instead of handling stacktrace capturing and mmap cache invalidating in
sys_* functions, handle them uniformly in trace_syscall_entering using
new flags introduced by previous two commits.

The patch is simpler than its older version(v3). The value of
hide_log_until_execve is just ignored. I found the value is nothing
to do with this patch. unwind_cache_invalidate is mentioned only
once in trace_syscall_exiting.
Both are suggested by Dmitry Levin.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
d35bdcad13caac3e167735e1f0fc50355b2f9523 26-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> Compress blank lines

Suppress empty lines left after automated xlat conversion.
/external/strace/process.c
0ed617bd66624cec6138102545d73b2e2346f1f6 26-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> Generate xlat/*.in files

Automatically convert xlat structures from *.c files to xlat/*.in files
using "./generate_xlat_in.sh *.c" command.
/external/strace/process.c
3a3b71c7d8b4d6ca2d6703008bd77b507271c0b9 28-May-2014 Dmitry V. Levin <ldv@altlinux.org> Use printstr for sethostname, setdomainname, and gethostname decoding

The argument passed to sethostname and setdomainname syscalls, as well
as the string returned by gethostname syscall, is not a pathname, so
printpathn is not the right method for its decoding.

* process.c (sys_sethostname, sys_setdomainname): Decode 1st argument
using printstr instead of printpathn.
[ALPHA] (sys_gethostname): Likewise.
/external/strace/process.c
b2ede14797b729659b0397431b28f34e57b5c4e7 13-May-2014 Masatake YAMATO <yamato@redhat.com> Enhance setns syscall decoding

* process.c (sys_setns): New function.
Decode the 2nd syscall argument using clone_flags.
* linux/syscall.h (sys_setns): New prototype.
* linux/dummy.h (sys_setns): Remove.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/process.c
6556315493082df9a24dbce9dadea4d6673e9965 12-May-2014 Dmitry V. Levin <ldv@altlinux.org> Alias sys_vfork to sys_fork

* process.c (sys_vfork): Remove.
* linux/syscall.h (sys_vfork): Likewise.
* linux/dummy.h (sys_vfork): Alias to sys_fork.
* linux/alpha/syscallent.h: Fix vfork entry.
* util.c (setbpt): Do not check for sys_vfork.
* syscall.c (syscall_fixup_for_fork_exec): Likewise.
/external/strace/process.c
99a0544f010cfaade3f42d08656285555bec60db 10-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> Refactor LDT decoding

* configure.ac (AC_CHECK_TYPES): Remove struct user_desc.
* ldt.c: New file.
* Makefile.am (strace_SOURCES): Add ldt.c.
* mem.c: Do not include <asm/ldt.h>.
(print_ldt_entry): Remove.
(sys_modify_ldt, sys_set_thread_area, sys_get_thread_area): Move...
* ldt.c: ... here.
* process.c: Do not include <asm/ldt.h>.
(sys_clone) [I386 || X86_64 || X32]: Use print_user_desc.
/external/strace/process.c
f94e84780e96221a4b3e8eb39bfa2d227d367f69 09-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> x32: decode clone LDT user_desc entries for x86 processes

* mem.c [X32]: Include asm/ldt.h.
[X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
sys_get_thread_area): Define.
* process.c [X32]: Include asm/ldt.h.
(sys_clone) [X32]: Decode LDT entry if current_personality == 1.
/external/strace/process.c
44655a451e84c518878b4ff19319ad5cfc666a82 05-Apr-2014 Elliott Hughes <enh@google.com> x86-64: decode clone LDT user_desc entries for x86 processes

* mem.c [X86_64]: Include asm/ldt.h.
[X86_64] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
sys_get_thread_area): Define.
* process.c [X86_64]: Include asm/ldt.h.
(sys_clone) [X86_64]: Decode LDT entry if current_personality == 1.

Signed-off-by: Elliott Hughes <enh@google.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/process.c
2c4fb257663ad108d17a60afafd9ace181e397d4 09-Apr-2014 Dmitry V. Levin <ldv@altlinux.org> x32: fix clone(2) argument order for x86 processes

Apply the same fix that was made for x86_64.

* process.c [X32] (ARG_CTID, ARG_TLS): Take current
personality into account.
/external/strace/process.c
b563325f0a5497b6134f24bea03a86b21272960f 05-Apr-2014 Elliott Hughes <enh@google.com> x86-64: fix clone(2) argument order for x86 processes

Without this patch, strace claims that parent_tidptr == tls, which is
clearly wrong. It is expected that parent_tidptr == child_tidptr.

* process.c [X86_64] (ARG_CTID, ARG_TLS): Take current
personality into account.

Signed-off-by: Elliott Hughes <enh@google.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/process.c
594527353359d9a6aad516992e09c393e11f3bd2 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Use XLAT_END macro

Automatically update all xlat structures using the following sed regexp:
s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/
/external/strace/process.c
9f56d87cc42eec3226477bdf26bfb094bc66f66a 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Convert futexops to XLAT form

* process.c: Define FUTEX_*_PRIVATE macros.
(futexops): Convert to XLAT form.
/external/strace/process.c
bce0cc6a2d103e1da4c15a4c5396fdc5676294f7 05-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Use XLAT macro

Automatically convert all xlat structures to XLAT form
using the following sed regexp:
s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/
/external/strace/process.c
94e246ac57b52346144fece3549820ed04b13058 31-Dec-2013 Mike Frysinger <vapier@gentoo.org> Delete old PTRACE_{PEEK,POKE}USR logic

The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has
logic in defs.h to make sure it's set sanely. Delete this old logic as
the defs.h takes care of it now.

* process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines.
* signal.c: Likewise.
* syscall.c: Delete PTRACE_PEEKUSR define.
* util.c: Likewise.
/external/strace/process.c
e19a712aae9a851a81a6bc31c411ad31f1a20a93 12-Nov-2013 Dmitry V. Levin <ldv@altlinux.org> Use standard names of sched_param structure members

* process.c (sys_sched_setscheduler, sys_sched_getparam,
sys_sched_setparam): Use portable struct sched_param member name
sched_priority instead of glibc specific __sched_priority.

Reported by John Spencer.
/external/strace/process.c
0b4060f61f1bb101b5d8d084714b7d2feacdb199 24-Sep-2013 Ali Polatel <alip@exherbo.org> Work around conflict between <sys/ptrace.h> and <linux/ptrace.h>

Since glibc-2.18~39 <sys/ptrace.h> defines ptrace_peeksiginfo_args
which collides with <linux/ptrace.h>.

* configure.ac: Check for `struct ptrace_peeksiginfo_args' in
<sys/ptrace.h>.
* process.c: Work around potential conflict between <sys/ptrace.h>
and <linux/ptrace.h> by redefining ptrace_peeksiginfo_args.
* signal.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.

Signed-off-by: Ali Polatel <alip@exherbo.org>
/external/strace/process.c
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/process.c
d083016e03e8511c808e8f65305726a523c03e9a 28-Jun-2013 Denys Vlasenko <dvlasenk@redhat.com> sys_clone: add a comment about CLONE_PTRACE and CLONE_UNTRACED

No code changes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
f782201adf96878141d6e9abe064a896ec11463b 18-May-2013 Dmitry V. Levin <ldv@altlinux.org> Update PTRACE_O_* constants

* process.c (ptrace_setoptions_flags): Sync with Linux 3.9.
/external/strace/process.c
7a0fb3838629aa53fa4c6b21a1cc11f67a1090df 13-May-2013 Dmitry V. Levin <ldv@altlinux.org> Update PR_* constants

* process.c (prctl_options): Add PR_SET_PTRACER.
/external/strace/process.c
b6593deac457290e1c20954e07ad02987ec78764 27-Mar-2013 Dmitry V. Levin <ldv@altlinux.org> Update PR_* constants

* process.c (prctl_options): Add more PR_* constants from linux/prctl.h.
/external/strace/process.c
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/process.c
c41808bcd6c311391ab6b40880aa428d4730f0a4 18-Mar-2013 Dmitry V. Levin <ldv@altlinux.org> ptrace: decode note segment descriptor types

* configure.ac (AC_CHECK_HEADERS): Add elf.h.
* process.c: Include elf.h.
(nt_descriptor_types): New xlat structure.
(sys_ptrace): Use it.
/external/strace/process.c
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/process.c
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/process.c
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/process.c
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/process.c
be99497d39a0ccc59cde4d21bbd307767ab3860c 13-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Decode struct iov in PTRACE_GET/SETREGSET

* process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
873e5a5a5c93a6e7b9b34311818f6f04031a1dd2 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Unify representations of struct user fields for subarchitectures

* process.c: Unify MIPS and LINUX_MIPSN32, and SH and SH64 parts of
struct_user_offsets[].

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
74307a695337e3c5b7b87e790246d83a033a2992 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Add start_code and start_data members of struct user

* process.c: Add start_code and start_data members of struct user
in struct_user_offsets[], where appropriate.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
729e18dffd4d5bebeb3670d58574dbb442d0a973 12-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Deobfuscate definitions of struct user offsets

The maze of ifdefs/ifndefs was scaring new contributors.
Format it so that every arch has its own ifdef block.

* process.c: Deobfuscate definitions of struct user offsets.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
ea22e9753d577aed0b5564d083a6dac18a51eccd 01-May-2012 Dmitry V. Levin <ldv@altlinux.org> Make printing of utsname.domainname more portable

* configure.ac: Check for struct utsname.domainname field.
* process.c (sys_uname): Print utsname.domainname when the field is
available.
/external/strace/process.c
3efa7c7f1be0f54e0656de5cb4a5f4c39db10150 28-Apr-2012 Denys Vlasenko <vda.linux@googlemail.com> Enable printing of uts.domainname in uname syscall

* process.c (sys_uname): Enable printing of uts.domainname

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
b7a6dae9fb15cd9f71d72861097c6c0e8608e88e 20-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Trivial tweaks. No logic changes

* process.c (sys_ptrace): Remove unneeded line wrapping.
* syscall.c (trace_syscall_entering): Use tprints() instead of tprintf().

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
3e3490acf776124a52c0315a113cb2e364d1bc40 17-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Indentation and whitespace fixes. No code changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
1ff463d15412de77fcf5b8ca1cf43c63dce1dbe1 12-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Implement sched_rr_get_interval syscall decoder

* linux/dummy.h (sys_sched_rr_get_interval): Remove.
* linux/syscall.h (sys_sched_rr_get_interval): New prototype.
* process.c (sys_sched_rr_get_interval): New function.
/external/strace/process.c
1b0bae2969abe21c388144761bc52e3ae9d1a043 11-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Implement get_robust_list syscall decoder

* linux/dummy.h (sys_get_robust_list): Remove.
* linux/syscall.h (sys_get_robust_list): New prototype.
* process.c (sys_get_robust_list): New function.
/external/strace/process.c
039521051e566420b48dc9f2e01691973ec39c02 10-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Implement process_vm_writev decoder

* process.c (sys_process_vm_writev): New function.
* linux/syscall.h (sys_process_vm_writev): New prototype.
/external/strace/process.c
0bfd74436d3945e915d373364bbed1f08d3d3c38 10-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Output iovec length in vmsplice and process_vm_readv decoders

* io.c (sys_vmsplice): Output iovec length.
* process.c (sys_process_vm_readv): Likewise.
/external/strace/process.c
1945ccc3fbd5b56008c4a6b0cdd4611616201675 27-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Assorted trivial optimizations

text data bss dec hex filename
236448 672 19044 256164 3e8a4 strace.before
236360 672 19044 256076 3e84c strace

* file.c (sprintmode): Use smaller static buffer, eliminate strlen call.
(sprinttime): Use smaller static buffer.
(printstat_sparc64): Coalesce two printing calls into one.
(printstat_powerpc32): Likewise.
(printcompat_statfs6): Likewise.
(sys_utime): Do not fetch personality_wordsize[current_personality]
repeatedly - cache it in local variable instead.
* process.c (printargv): Likewise.
* resource.c (sprintrlim): Return const char*, not char*. This allows
to eliminate sprintf(buf, "RLIM_INFINITY"). Use smaller static buffer.
(sprintrlim64): Likewise.
* strace.c (strerror): Use smaller static buffer.
(strsignal): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
b237b1b20da4ff40efb919f9d4a6458a05f375ca 27-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Style fixes, no code changes

* desc.c (sys_io_getevents): Indentation fix.
* file.c (sys_xstat): Remove space after function name.
(decode_mknod): Indentation fix.
* net.c (printsockopt): Indentation fix.
* process.c (unalignctl_string): Indentation fix.
(sys_sched_getscheduler): Remove space after ! operator.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
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/process.c
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/process.c
3af224c5cd8a64a6af3f875549ff821e2b5cb211 28-Jan-2012 Denys Vlasenko <vda.linux@googlemail.com> Use process_vm_readv instead of PTRACE_PEEKDATA to read data blocks

Currently, we use PTRACE_PEEKDATA to read things like filenames and
data passed by I/O syscalls.
PTRACE_PEEKDATA gets one word per syscall. This is VERY expensive.
For example, in order to print fstat syscall, we need to perform
more than twenty trips into kernel to fetch one struct stat!

Kernel 3.2 got a new syscall, process_vm_readv(), which can be used to
copy data blocks out of process' address space.

This change uses it in umoven() and umovestr() functions if possible,
with fallback to old method if process_vm_readv() fails.
If it returns ENOSYS, we don't try to use it anymore, eliminating
overhead of trying it on older kernels.

Result of "time strace -oLOG ls -l /usr/lib >/dev/null":
before patch: 0.372s
After patch: 0.262s

* util.c (process_vm_readv): Wrapper to call process_vm_readv syscall.
(umoven): Use process_vm_readv for block reads of tracee memory.
(umovestr): Likewise.
* linux/syscall.h: Declare new function sys_process_vm_readv.
* process.c (sys_process_vm_readv): Decoder for new syscall.
* linux/i386/syscallent.h: Add process_vm_readv, process_vm_writev syscalls.
* linux/x86_64/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/process.c
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/process.c
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/process.c
381dbc22929428579f50d9b0b39193feba93dcfd 05-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Set TCB_STARTUP only _after_ we attached.

This fixes logic in detach() which thinks that TCB_STARTUP
means that we are already attached, but did not see SIGSTOP yet.
This also allows to get rid of TCB_ATTACH_DONE flag.

* process.c (internal_fork): Set TCB_STARTUP after attach.
* strace.c (startup_attach): Likewise.
(startup_child): Likewise.
(alloc_tcb): Do not set TCB_STARTUP on tcb allocation - we are
not attached yet.
(trace): Set TCB_STARTUP when we detech an auto-attached child.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
60fe8c139c6f2febefe595781812ddf0864a6ab8 01-Sep-2011 Denys Vlasenko <dvlasenk@redhat.com> Use tprints with literal strings, it may be faster than tprintf

* bjm.c: Replace tprintf("str") with tprints("str").
* block.c: Likewise.
* desc.c: Likewise.
* file.c: Likewise.
* io.c: Likewise.
* ipc.c: Likewise.
* mem.c: Likewise.
* net.c: Likewise.
* proc.c: Likewise.
* process.c: Likewise.
* quota.c: Likewise.
* resource.c: Likewise.
* scsi.c: Likewise.
* signal.c: Likewise.
* sock.c: Likewise.
* strace.c: Likewise.
* stream.c: Likewise.
* syscall.c: Likewise.
* system.c: Likewise.
* term.c: Likewise.
* time.c: Likewise.
* util.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
61526c6b1ee40442943b245eeb5d0c5f13821131 25-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove stray commas in struct initializers. No code changes

* process.c: Remove stray commas in struct initializers.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
a7949748d14a21aa9698311413f2b84342d14e0e 21-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Conditionally optimize out unused code

* syscall.c (internal_syscall): Call internal_exec only if
SUNOS4 || (LINUX && TCB_WAITEXECVE).
* process.c (internal_exec): Define this function only if
SUNOS4 || (LINUX && TCB_WAITEXECVE).
(printwaitn): Don't check wordsize if SUPPORTED_PERSONALITIES == 1.
* signal.c (sys_kill): Likewise.
* syscall.c (is_negated_errno): Likewise.
(trace_syscall_exiting): Fold a tprintf into tprintfs which follow it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
47247865eb108e5f5c9cb1f0c3f40fd97cdb0978 23-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Remove dead "ifndef CLONE_PTRACE" branch

process.c defines CLONE_PTRACE for Linux, so it can't be undefined.
Therefore ifndef CLONE_PTRACE code is dead (since at least 2004).
This patch removes it.

* process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not
the code inside) and entire ifndef CLONE_PTRACE/endif block.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
7b609d5ba0852e6c56ba311350ebd4412361777b 22-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Whitespace cleanups. No code changes.

* count.c: Place opening curly brace after if (),
not on the next line. Almost all strace code alredy
uses this style.
* desc.c: Likewise.
* file.c: Likewise.
* net.c: Likewise.
* pathtrace.c: Likewise.
* process.c: Likewise.
* quota.c: Likewise.
* signal.c: Likewise.
* strace.c: Likewise.
* syscall.c: Likewise.
* time.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
e7c9024acf94101ceb17006102629f14e0f25553 22-Jun-2011 Denys Vlasenko <dvlasenk@redhat.com> Trivial fixes

* process.c (internal_fork): Remove conditionals which make no difference
(we return 0 on both branches of these ifs).
* util.c: Fix indentation of an ifdef.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
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/process.c
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/process.c
1201426dd43f5b4e12dfe520e2a9c5027d33dc11 30-May-2011 Denys Vlasenko <dvlasenk@redhat.com> "Modernize" all old-style function parameter declarations

* bjm.c: Convert all remaining old-style C function definitions
to a "modern" form. This does not change any actual code.
* io.c: Likewise
* ioctl.c: Likewise
* net.c: Likewise
* proc.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* syscall.c: Likewise
* system.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/process.c
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/process.c
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/process.c
bb668a57b41f717e7b2c8664997c979de1079c23 14-Mar-2011 Dmitry V. Levin <ldv@altlinux.org> Update PTRACE_* constants

* process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET.
/external/strace/process.c
d9a4b0ab00e9262411d2420f33f067d484431520 23-Feb-2011 Dmitry V. Levin <ldv@altlinux.org> Fix compilation warning reported by gcc -Wunused-but-set-variable

* process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable.
/external/strace/process.c
fde119c792f3e2de1f0580c9040f36e2a9fbc5d0 19-Feb-2011 Dmitry V. Levin <ldv@altlinux.org> * process.c (internal_exit) [IA64]: Remove redundant check.
/external/strace/process.c
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/process.c
e3d4b68a7ba7498eb37f8b3739155aabdfa3e63a 03-Dec-2010 Dmitry V. Levin <ldv@altlinux.org> Recognize more clone flags

* process.c (CLONE_*): Define more flags from linux v2.6.25.
(clone_flags): Add entries for them.
Proposed by <zhangyanfei@cn.fujitsu.com>.
/external/strace/process.c
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/process.c
e636c8516567642ed1ef0b281739f90650a6e109 16-Sep-2010 Wang Chao <wang.chao@cn.fujitsu.com> Do not trace children cloned with CLONE_UNTRACED flag

If clone is called with flag CLONE_UNTRACED, to be consistent with
option PTRACE_O_TRACECLONE, we should not set CLONE_PTRACE flag on
its arguments.

* process.c [LINUX] (internal_fork): Check the syscall and arguments.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/process.c
3eb94916738e4c4ba783ea3ef0ca62e2b0c73da7 10-Sep-2010 Dmitry V. Levin <ldv@altlinux.org> * process.c (sys_waitid): Remove unused variable.
/external/strace/process.c
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/process.c
cbdd1900a16016343c172db09fc48a83e7fa22ac 02-Sep-2010 Wang Chao <wang.chao@cn.fujitsu.com> Fix printing clone flags

When we trace clone() syscall with only exit signal as clone
flags, strace would print an unnecessary OR operator.

* process.c (sys_clone): Fix this.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/process.c
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/process.c
5a22b31a60e9defa39df2672c89768fa85543276 05-Aug-2010 Wang Chao <wang.chao@cn.fujitsu.com> Handle CLONE_PARENT flag

* process.c (internal_fork): The parent of new cloned process is the
same of the calling process when CLONE_PARENT is set.
/external/strace/process.c
304ea5f06779a9fd998e7e03d860469853370921 05-Aug-2010 Wang Chao <wang.chao@cn.fujitsu.com> Fix error when judging if process has children

* process.c (internal_wait): Processes counted in tcp->nclone_threads
are tcp's threads, rather than tcp's children.

Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
/external/strace/process.c
939caba68e93a51e537f29c3bd778dea1f081157 06-Jul-2010 Edgar E. Iglesias <edgar.iglesias@gmail.com> Add support for the MicroBlaze architecture

* configure.ac: Recognize MicroBlaze.
* linux/microblaze/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add linux/microblaze/syscallent.h
* process.c (change_syscall, struct_user_offsets): Add MicroBlaze
support.
* signal.c (sys_sigreturn): Likewise.
* syscall.c (internal_syscall, get_scno, syscall_fixup, get_error,
syscall_enter): Likewise.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
/external/strace/process.c
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/process.c
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/process.c
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/process.c
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/process.c
62e0596dbda6831f7f7a976c183373d5ff7a7584 03-Nov-2009 Dmitry V. Levin <ldv@altlinux.org> Check umove() return code

* bjm.c (sys_query_module): Print input parameters when entering
syscall. Fix handling of syscall error. Handle unlikely umove()
failures.
* ipc.c (tprint_msgrcv): New function. Move part of msgrcv parser code
here, add check umove() return code.
(sys_msgsnd): Print msqid parameter as int instead of long.
(sys_msgrcv): Likewise. Use tprint_msgrcv().
* process.c (print_affinitylist): Check umove() return code.
* sock.c (sock_ioctl): Handle unlikely umove() failure in the
SIOCGIFCONF parser.
/external/strace/process.c
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/process.c
7674006eed0a3c4de34fac89fc3592520c728637 18-Sep-2009 Dmitry V. Levin <ldv@altlinux.org> Fix follow fork/vfork on Linux ARM OABI

__NR_SYSCALL_BASE eis 0 for EABI and is 0x900000 for OABI.
* process (change_syscall) [LINUX && ARM]: Mask off the high order bits
when changing syscall.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
/external/strace/process.c
99c85693a54e3da6c0e45127e25331766c071c2a 28-Aug-2009 Andreas Schwab <schwab@redhat.com> Zero-extend 32-bit addresses when printing argv array.

(printargv): Zero-extend 32-bit addresses.
Fixes RH#519480 "64-bit strace is lazy on execve of 32-bit
process".
/external/strace/process.c
85f583229fdc670c54a6c8a2f7b2f05bb0d57ab7 12-Aug-2009 Andreas Schwab <schwab@redhat.com> Add more futex decoding.

* process.c (FUTEX_WAIT_REQUEUE_PI, FUTEX_CMP_REQUEUE_PI)
(FUTEX_PRIVATE_FLAG, FUTEX_CLOCK_REALTIME): Define.
(futexops): Add entries for them.
(sys_futex): Decode FUTEX_CMP_REQUEUE_PI and
FUTEX_WAIT_REQUEUE_PI.
/external/strace/process.c
eb9e2e8904ce85a6c7390be25bb873c6db88c4d3 03-Jun-2009 Roland McGrath <roland@redhat.com> Revert unapproved commits.
/external/strace/process.c
4bcd5ef92281106dc479ef79623353d59c7101ee 01-Jun-2009 Dmitry V. Levin <ldv@altlinux.org> * bjm.c (sys_query_module): Fix format warning reported by
gcc -Wformat-security.
* file.c (tprint_open_modes): Likewise.
* process.c (printargv): Likewise.
* signal.c (printsignal): Likewise.
/external/strace/process.c
e740fd31d2dd4720de2c39f10b5096e9eac40484 16-Apr-2009 Denys Vlasenko <dvlasenk@redhat.com> * file.c (print_dirfd): Use int for file descriptor, not a long.
* process.c (printwaitn): Use int for PID, not a long.
/external/strace/process.c
1d632468c09756d3382d1a92f99a8413636e75d3 14-Apr-2009 Denys Vlasenko <dvlasenk@redhat.com> * signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto.
* time.c: Ditto.
* process.c: Ditto.
* resource.c: Ditto.
/external/strace/process.c
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/process.c
ea0e6e80260d2b1b7ad40282012b0e47869bcddf 25-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> CRIS support by Hinko Kocevar (hinko.kocevar AT cetrtapot.si)
* configure.ac: Make it recognize cris.
* process.c: Define ARG_xxx constants for cris.
(change_syscall): Add support for cris.
(struct_user_offsets): Add cris-specific data.
* signal.c (sys_sigreturn): Add support for cris.
* syscall.c (get_scno): Add support for cris.
(syscall_fixup): Add support for cris.
(get_error): Add support for cris.
(syscall_enter): Add support for cris.
(force_result): While at it, fix cpp directives indentation.
* util.c (printcall): Add support for cris.
/external/strace/process.c
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/process.c
c7e837154dae4db1cdf78e6251eb103cde2e3465 24-Feb-2009 Denys Vlasenko <dvlasenk@redhat.com> * process.c: Indent preprocessor directives so that nesting
can be figured out. Add PTRACE_SET_SYSCALL to ptrace_cmds[].
/external/strace/process.c
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/process.c
7e0615f3aecc023e2756a83bdf113c5ceaac431d 28-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * process.c (internal_clone): Check and complain if pid value
looks insane.
* strace.c (alloc_tcb): Clear *all* fields in reused tcb.
(main): Query and remember uname() info on startup.
(handle_stopped_tcbs): Do not use PTRACE_SETOPTIONS on Linux < 2.6.29.
(printleader): Correct printing of "<unavailable>" markers.
/external/strace/process.c
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/process.c
db78f76e968f426ced5901cbda452b1827535a3a 26-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> fix fallout from recent tcb table expansion error handling change
/external/strace/process.c
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/process.c
f9a7e63a1ad57a87c1e6be10b7a6b49282ed1203 17-Jan-2009 Denys Vlasenko <dvlasenk@redhat.com> * process.c: Add a comment. No code changes.
* strace.c (collect_stopped_tcbs): Stop reversing list of stopped
tcp's. I'm not totally convinced it is crucial, but this is surely
fits the concept of "least surprise".
Do not collect TCB_SUSPENDED tcp's (this is closer to how
it was before).
(handle_stopped_tcbs): Remove the code to reject TCB_SUSPENDED tcp's,
it's done earlier now. In an unobvious way, this was causing
SIGSTOPs from freshly attached children to be misinterpreted.
/external/strace/process.c
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/process.c
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/process.c
adedb510197209e7077310f9e9f67e3d51fb8617 30-Dec-2008 Denys Vlasenko <dvlasenk@redhat.com> Fixing many instances of broken indentation with spaces instead of tabs.
No code changes.
/external/strace/process.c
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/process.c
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/process.c
8dd31ddfcc5ee11c4876cdcc8e17fd1d1bd17631 11-Nov-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-11-09 Dmitry V. Levin <ldv@altlinux.org>

* process.c (prctl_options): Update constants from linux 2.6.27.
/external/strace/process.c
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/process.c
21a75347451b5178a0eb85a48042b8db0e45b318 03-Sep-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>

* desc.c (sys_fcntl): Do not initialize auxstr for failed syscall.
* process.c (sys_fork, sys_rfork) [USE_PROCFS]: Likewise.
* signal.c (sys_signal): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
* time.c (sys_adjtimex): Likewise.
* syscall.c (trace_syscall): If RVAL_STR is set, then
print auxstr for failed syscall as well.
/external/strace/process.c
50f6013c15bd5103cd1fe4e518f177f0eec74660 03-Sep-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>

* process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
Fix PR_GET_UNALIGN decoder.
/external/strace/process.c
f02cf214d9d411c074a2d8a64f84e0db2035024d 03-Sep-2008 Dmitry V. Levin <ldv@altlinux.org> 2008-04-19 Dmitry V. Levin <ldv@altlinux.org>

* process.c (prctl_options): Add more constants.
/external/strace/process.c
5b63d963ac98fb1ea1233a3d4886f65c9b0515e3 18-Jul-2008 Roland McGrath <roland@redhat.com> 2008-07-17 Roland McGrath <roland@redhat.com>

* process.c (printwaitn): When current personality's wordsize is
smaller than native, sign-extend the PID argument from 32 bits.
/external/strace/process.c
1aeaf74640dd091a4cab85aafba49e8dfd5b0fb0 18-Jul-2008 Roland McGrath <roland@redhat.com> 2008-07-17 Roland McGrath <roland@redhat.com>

* process.c (futexops): Update table.
(sys_futex): Handle FUTEX_WAIT_BITSET correctly.
From Ulrich Drepper <drepper@redhat.com>.
Fixes RH#448628.
/external/strace/process.c
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/process.c
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/process.c
1e868064d14f47de62bdf5006efb6246aae8d478 19-Nov-2007 Roland McGrath <roland@redhat.com> 2007-11-19 Andreas Schwab <schwab@suse.de>

* process.c (sys_ptrace) [IA64]: For PTRACE_PEEKDATA,
PTRACE_PEEKTEXT and PTRACE_PEEKUSER the data is returned directly.
/external/strace/process.c
e5039fb74e0794ddd4f46dce32a1c7e010d1a658 04-Nov-2007 Roland McGrath <roland@redhat.com> 2007-11-03 Roland McGrath <roland@redhat.com>

* process.c (prctl_options): Add numerous constants.
From Sami Farin <safari@u.safari.iki.fi>.
Fixes RH#364401.
/external/strace/process.c
85a3bc4a0473de8d770d5543fc3c22c53b3e958e 02-Aug-2007 Roland McGrath <roland@redhat.com> 2007-08-01 Roland McGrath <roland@redhat.com>

* process.c (printargv): Handle boundary cases correctly.
Handle biarch fetching correctly.
/external/strace/process.c
db8319f2fa34065b73248e7074a3ebb5d1acd117 02-Aug-2007 Roland McGrath <roland@redhat.com> 2007-07-23 Ulrich Drepper <drepper@redhat.com>

* process.c (sys_getcpu): New function.
* linux/syscall.h: Declare sys_getcpu.
* linux/syscallent.h: Add entry for getcpu.
/external/strace/process.c
51942a9f14ab9f01919c6251183783e7dc4dbd42 05-Jul-2007 Roland McGrath <roland@redhat.com> 2007-07-05 Roland McGrath <roland@frob.com>

* process.c [LINUX] (futexops): Add many new values.
[LINUX] (futexwakeops, futexwakecmps): New tables.
[LINUX] (sys_futex): Use them.
From Ulrich Drepper <drepper@redhat.com>.
Fixes RH#241467.
/external/strace/process.c
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/process.c
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/process.c
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/process.c
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/process.c
76860f60d73bbdcc98725b6f8d7997ad0746cac2 12-Oct-2006 Dmitry V. Levin <ldv@altlinux.org> 2006-03-29 Dmitry V. Levin <ldv@altlinux.org>

Fix race conditions in tcb allocation.
* process.c (fork_tcb): Return error code as documented. Do not
print "tcb table full" error message.
[USE_PROCFS] (internal_fork): Do not print "tcb table full"
error message.
[SYS_clone || SYS_clone2] (internal_clone, internal_fork): Call
fork_tcb() before alloctcb(). Do not print "tcb table full"
error message.
* strace.c (main): Do not print "tcb table full" error message.
(expand_tcbtab): Print error message in case of memory allocation
failure.
(alloctcb): Print error message when tcb table is full.
(trace): Expand tcb table if necessary prior to allocating
entry there. Do not print "tcb table full" error message.
Fixes RH#180293.
/external/strace/process.c
f691bd2a4f0a915f998e4127b108869b57db4213 25-Apr-2006 Roland McGrath <roland@redhat.com> 2006-03-30 Daniel Jacobowitz <dan@codesourcery.com>

* process.c (change_syscall): Add ARM support.
* syscall.c (get_scno): Handle ARM EABI.
Fixes Debian#360152.
/external/strace/process.c
d56a656ec871341edb73358f63ee96b7d56a819a 03-Aug-2005 Roland McGrath <roland@redhat.com> 2005-08-03 Roland McGrath <roland@redhat.com>

* process.c (internal_wait): Don't suspend when known child is known
to be exiting already.
/external/strace/process.c
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/process.c
a4f9f2da0790e75de1e64b6b169d29c14c5bab53 08-Jun-2005 Roland McGrath <roland@redhat.com> 2005-06-06 Roland McGrath <roland@redhat.com>

* process.c (struct_user_offsets) [X86_64]: Reorder elements so
matching works right.
Fixes RH#159787.
* 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/process.c
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/process.c
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/process.c
f04bb48240da2eeccbc12f00281c5b9bb172b4da 09-May-2005 Roland McGrath <roland@redhat.com> 2005-05-05 Anton Blanchard <anton@samba.org>

* process.c (ptrace_cmds): Add PTRACE_GETVRREGS and PTRACE_SETVRREGS
if defined.
/external/strace/process.c
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/process.c
c2d5eb082dfc2779d4758ea9736c7027dca58ba1 02-Feb-2005 Roland McGrath <roland@redhat.com> 2005-02-01 Roland McGrath <roland@redhat.com>

* process.c [LINUX] [X86_64] (sys_arch_prctl): New function.
* linux/syscall.h: Declare it.
* linux/x86_64/syscallent.h: Use it.
Part of RH#142667.
* process.c (sys_sched_setscheduler): Use %#lx format for bad pointer.
(sys_sched_getparam, sys_sched_setparam): Likewise.
Part of RH#142667.
/external/strace/process.c
5e02a5793d981265072d606fcb2293d80e73824f 20-Oct-2004 Roland McGrath <roland@redhat.com> 2004-10-19 Roland McGrath <roland@redhat.com>

* process.c (WCOREFLAG): Define if not defined.
(W_STOPCODE, W_EXITCODE): Likewise.
Reported by Marty Leisner <mleisner@eng.mc.xerox.com>.
/external/strace/process.c
39426a359feab31845270005d61372d4b8fe9462 07-Oct-2004 Roland McGrath <roland@redhat.com> 2004-09-15 Roland McGrath <roland@redhat.com>

* linux/syscallent.h: waitid takes 5 arguments, and is in TP category.
* process.c (sys_waitid): Handle fifth argument (struct rusage *).
/external/strace/process.c
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/process.c
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/process.c
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/process.c
fdb097f63721acd7eeae8a7224dfe934b8e1a4a2 12-Jul-2004 Roland McGrath <roland@redhat.com> 2004-06-28 Andreas Schwab <schwab@suse.de>

* process.c (internal_exec): Move TCB_WAITEXECVE handling here.
(sys_execve): Remove it here.
/external/strace/process.c
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/process.c
f8cc83c9efc0f33e721ec7f05eacc20c729da757 04-Jun-2004 Roland McGrath <roland@redhat.com> 2004-04-19 Roland McGrath <roland@redhat.com>

* process.c (printstatus): Add a space before | in output.
/external/strace/process.c
79fbda596afb380a1e6f49254efbf5bba148cab1 14-Apr-2004 Roland McGrath <roland@redhat.com> 2004-04-13 Roland McGrath <roland@redhat.com>

* process.c (printstatus): Mask out bits presented symbolically, and
print "| 0xnnn" if the remaining bits are not all zero.
Fixes Debian bug #240062.
* process.c (print_affinitylist): Rewritten to handle indirect values.
(sys_sched_setaffinity, sys_sched_getaffinity): Update callers.
From Ulrich Drepper <drepper@redhat.com>.
Fixes RH#118685.
/external/strace/process.c
7decfb229850118aace9e0cb6019036f64a18821 01-Mar-2004 Roland McGrath <roland@redhat.com> 2004-03-01 Roland McGrath <roland@redhat.com>

* configure.ac: Check for `struct user_desc' in <asm/ldt.h>.
* process.c [HAVE_STRUCT_USER_DESC]: Use struct user_desc in place of
struct modify_ldt_ldt_s.
* mem.c [HAVE_STRUCT_USER_DESC]: Likewise.
/external/strace/process.c
b09e33a286635e68a77a7ad19e88bc35db693f7d 01-Mar-2004 Roland McGrath <roland@redhat.com> 2004-03-01 Roland McGrath <roland@redhat.com>

* process.c (sys_execve): Clear instead of set TCB_WAITEXECVE on
erring syscall.
/external/strace/process.c
fb1bc073769268ea6daa35fdff4dc639e487b2b1 01-Mar-2004 Roland McGrath <roland@redhat.com> 2004-03-01 Roland McGrath <roland@redhat.com>

* process.c (struct_user_offsets) [LINUX && IA64]: Conditionalize
PT_AR_CSD and PT_AR_SSD uses in case of older kernel headers.
* configure.ac: Check for `struct pt_all_user_regs'
and `struct ia64_fpreg' in <sys/ptrace.h>.
* util.c, process.c, syscall.c: Work around conflicts between
<sys/ptrace.h> and <linux/ptrace.h> for defining those types.
/external/strace/process.c
279d378b14e9f7283b0e0dc09509343f19b37b19 01-Mar-2004 Roland McGrath <roland@redhat.com> 2004-03-01 Roland McGrath <roland@redhat.com>

* linux/dummy.h (sys_sched_getscheduler, sys_sched_setparam,
sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler,
sys_sched_get_priority_max, sys_sched_get_priority_min): Remove macros.
* process.c [LINUX] (sys_sched_getscheduler, sys_sched_setparam,
sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler,
sys_sched_get_priority_min): New functions.
From Ulrich Drepper <drepper@redhat.com>.
/external/strace/process.c
08267b8d6703c23332e39b1296e10e327196acb3 20-Feb-2004 Roland McGrath <roland@redhat.com> 2003-12-31 David Mosberger <davidm@hpl.hp.com>

* process.c (internal_exit): For ia64, also recognize IA-32 252
as exit_group().
(change_syscall): For IA64, also support changing IA-32 syscalls.
* syscall.c (internal_syscall): For IA64, also recognize IA-32
syscall 252 (exit_group) as an internal_exit() syscall.
* util.c (SYS_fork): For IA64, define them to the IA-32 syscall
number.
(SYS_vfork): Likewise.
(arg_setup): For IA64 version, also support IA-32 syscalls.
(get_arg0): Likewise.
(get_arg1): Likewise.
(set_arg0): Likewise.
(set_arg1): Likewise.
/external/strace/process.c
5ef24abf005145b7e30e475e23c0fa2e8b0f4e13 20-Feb-2004 Roland McGrath <roland@redhat.com> Revert jhughes commits.
/external/strace/process.c
ae259337730f2d7a2b47bfbfb33aad1db0b65fba 29-Jan-2004 John Hughes <john@Calva.COM> port SSI clustering mods to OpenSSI on Linux
/external/strace/process.c
ca4e10c0600b3a59dcb5cf96f2f952b1d1b64c37 13-Jan-2004 Roland McGrath <roland@redhat.com> 2003-12-31 David Mosberger <davidm@hpl.hp.com>

* process.c (struct_user_offsets) [IA64]: Fix up register name list.
/external/strace/process.c
83bd47a91ea40e0623b3bad51d7c12c732a8d994 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.
* linux/syscallent.h: Better handle getgid32, geteuid32, getegid32,
setreuid32, setregid32, getgroups32, setgroups32, fchown32,
setresuid32, getresuid32, setresgid32, getresgid32, chown32,
setuid32, setgid32, setfsuid32, setfsgid32.
* process.c [LINUX]: Define GETGROUPS32_T.
* process.c [LINUX] (sys_setgroups32, sys_getgroups32):
New functions.
* linux/syscall.h (sys_setgroups32, sys_getgroups32):
Declare them.
/external/strace/process.c
fccfb94863038be3e4a45d61983b9449fbcca03d 01-Oct-2003 Roland McGrath <roland@redhat.com> 2003-10-01 Roland McGrath <roland@redhat.com>

* process.c (internal_clone): Don't suspend parent when call requested
a specific PID that is not a traced child.
/external/strace/process.c
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/process.c
9c555e71d22a9aa3baf02a49a989ee184a7b09be 09-Jul-2003 Roland McGrath <roland@redhat.com> 2003-07-05 Richard Henderson <rth@twiddle.net>

* process.c (sys_clone): Order arguments for alpha the same as x86_64.
* syscall.c (ERESTART_RESTARTBLOCK): New.
(trace_syscall): Print it.
* linux/alpha/syscallent.h (osf_syscall): Name properly.
(osf_set_program_attributes): Fix typo.
(osf_nfssvc): Likewise.
(osf_sigsendset): Likewise.
(getdents64, gettid, readahead, tkill, setxattr, lsetxattr, fsetxattr,
getxattr, lgetxattr, fgetxattr, listxattr, llistxattr, flistxattr,
removexattr, lremovexattr, fremovexattr, futex, sched_setaffinity,
sched_getaffinity, tuxcall, io_setup, io_destroy, io_getevents,
io_submit, io_cancel, exit_group, lookup_dcookie, epoll_create,
epoll_ctl, epoll_wait, remap_file_pages, set_tid_address,
restart_syscall, fadvise, timer_create, timer_settime, timer_gettime,
timer_getoverrun, timer_delete, clock_settime, clock_gettime,
clock_getres, clock_nanosleep, semtimedop): New.
/external/strace/process.c
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/process.c
88812d685d7d24a68841ee0435aab6296f273787 27-Jun-2003 Roland McGrath <roland@redhat.com> 2003-06-26 Roland McGrath <roland@redhat.com>

* process.c [LINUX] (sys_futex): Grok FUTEX_REQUEUE and print 5th arg.
* linux/syscallent.h: sys_futex argument count is now 5, not 4.
* linux/ia64/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
From Jakub Jelinek <jakub@redhat.com>.
/external/strace/process.c
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/process.c
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/process.c
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/process.c
984154d2468b7e8bfcccff3e5d584baf3b8fffa4 23-May-2003 Roland McGrath <roland@redhat.com> 2003-05-22 Roland McGrath <roland@redhat.com>

* process.c (sys_clone): Mask CSIGNAL out of flags and print that
separately using signame.
* process.c (internal_clone) [TCB_CLONE_THREAD]: Use ARG_FLAGS instead
of literal 0 for index. Consult the right flags without clobbering
anything when we reparent the new child to the caller's parent thread.
/external/strace/process.c
fe5fdb23def92008d615bf5dbeec647da452a30c 23-May-2003 Roland McGrath <roland@redhat.com> 2003-05-22 Roland McGrath <roland@redhat.com>

* process.c [LINUX] [S390 || S390X] (ARG_CTID, ARG_TLS): Fix swapped
indices. Reported by Jakub Jelinek <jakub@redhat.com>.
/external/strace/process.c
a2f3496d745f19405343650dfe7aadf661108011 23-May-2003 Roland McGrath <roland@redhat.com> 2003-05-22 Roland McGrath <roland@redhat.com>

* process.c (print_affinitylist): Fix loop condition.
Reported by Ian Wienand <ianw@gelato.unsw.edu.au>.
/external/strace/process.c
ac971c27278e1d45bf12c1ba522c7507ba778144 31-Mar-2003 Roland McGrath <roland@redhat.com> 2003-02-26 Stuart Menefy <stuart.menefy@st.com>

Various fixes for SuperH [SH]:
* mem.c(sys_old_mmap): mmap() parameters passed in registers
* net.c(sys_pipe), syscall.c(getrval2): pipe() results returned
in registers
* process.c (change_syscall): Fixed register which holds system
call number
* util.c (arg0_offset, arg1_offset): provide definition
* Makefile.am: Added new files in linux/sh
* linux/sh/{syscallent,errnoent,ioctlent,signalent}.h: New files
/external/strace/process.c
6f67a984426c77aabf7627dddd06cd71b2c3dcc0 21-Mar-2003 Roland McGrath <roland@redhat.com> 2003-03-18 Roland McGrath <roland@redhat.com>

* process.c [LINUX] (sys_clone): Don't dereference parent_tid argument.
/external/strace/process.c
361aac5193045db0ff0d2d0a7a19964793ab1ab7 18-Mar-2003 Roland McGrath <roland@redhat.com> 2003-03-17 Roland McGrath <roland@redhat.com>

* linux/x86_64/syscallent.h: clone takes 5 args.
* process.c [LINUX] (sys_clone) [X86_64]: Fix argument order.
/external/strace/process.c
c03981d0ea2d910c5caf621bceadc9a792fd4576 14-Mar-2003 Roland McGrath <roland@redhat.com> 2003-03-14 Roland McGrath <roland@redhat.com>

* linux/ia64/syscallent.h: clone takes 5 arguments.
* process.c [LINUX && IA64] (ARG_*): Update for 2.5 clone calls.
/external/strace/process.c
178d3b46cbd60c979ee7a16b8e48323a14de4c4a 12-Mar-2003 Roland McGrath <roland@redhat.com> tweak last change
/external/strace/process.c
43f2c84d50a1a41efff017abecbc7ebc8f23fd97 12-Mar-2003 Roland McGrath <roland@redhat.com> tweak last change
/external/strace/process.c
9677b3a2805e346ca5e61820391095ea3e571c3f 12-Mar-2003 Roland McGrath <roland@redhat.com> 2003-03-12 Roland McGrath <roland@redhat.com>

* linux/ia64/syscallent.h: Fix arg counts for clone and clone2.
Use sys_clone for clone2.
* linux/syscall.h: Don't declare sys_clone2.
* process.c (sys_clone): Rewritten to handle both flavors,
print all extra args depending on flag bits.
(sys_clone2): Function removed.
/external/strace/process.c
8dfa04a17460d82bce243b978b3e98cb830b2f5c 05-Mar-2003 Roland McGrath <roland@redhat.com> 2003-03-04 Ulrich Drepper <drepper@redhat.com>

* process.c [LINUX] (sys_futex): Omit final if op is not FUTEX_WAIT.
/external/strace/process.c
d245092e7fa8a72ab419542d85fab50554e6f9a7 24-Feb-2003 Roland McGrath <roland@redhat.com> 2003-02-24 Roland McGrath <roland@redhat.com>

* process.c (sys_getresgid): Fix typos in argument access.
/external/strace/process.c
9bd6b4234b8dadc2ea4165594dcf6ec612c5abca 24-Feb-2003 Roland McGrath <roland@redhat.com> 2003-02-23 Roland McGrath <roland@redhat.com>

* process.c (sys_getresuid): Fix typos in argument access.
Reported by Anton Blanchard <anton@samba.org>.
/external/strace/process.c
f3a0e1bb56176d1f41aa92be3c7128f0ad1b1543 20-Feb-2003 Roland McGrath <roland@redhat.com> 2003-02-19 Roland McGrath <roland@redhat.com>

FreeBSD rfork support changes from Russ Cox <rsc@plan9.bell-labs.com>:
* syscall.c (internal_syscall): Handle SYS_rfork with internal_fork.
* process.c (internal_fork) [SYS_rfork]: Bail if RFPROC flag not set.
/external/strace/process.c
5bd7cf8545631b1e249b6a0ec80e7a5925a3c584 24-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-23 Roland McGrath <roland@redhat.com>

* process.c: Reorder includes to put sys/reg.h before linux/ptrace.h,
since they can conflict.
/external/strace/process.c
b4968becdcf43529e5d29eb85c1372f4649e58a2 20-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-20 Roland McGrath <roland@redhat.com>

* process.c [LINUX] (sys_clone) [S390 || S390X]: Argument order is
reversed from other architectures.
* process.c (sys_execve) [LINUX]: Make setting TCB_WAITEXECVE flag
conditional on [TCB_WAITEXECVE] instead of list of processors.
/external/strace/process.c
eb285359906700f46b22cf4f9911695034313736 14-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-14 Roland McGrath <roland@redhat.com>

* configure.ac: Match powerpc* (includes powerpc64), and don't match
ppc (never comes out of config.sub).
* process.c (sys_ptrace): Use #lx format for address argument.
[POWERPC]: Use sizeof(unsigned long) in place of 4 for multipliers.
* process.c [POWERPC]: Likewise.
* signal.c (sys_sigreturn) [POWERPC]: Likewise.
* syscall.c (get_scno) [POWERPC]: Likewise.
* util.c [POWERPC]: Likewise.
(printnum): Use long for NUM.
From Anton Blanchard <anton@samba.org>.
/external/strace/process.c
bf621d40c5ba196abc89fa7445f86a75791b4f1a 14-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-14 Roland McGrath <roland@redhat.com>

* process.c: Use <linux/ptrace.h> regardless of <sys/reg.h>.
(sys_ptrace): Use printxval.
(ptrace_cmds): Make PTRACE_GETREGS et al conditional on #ifdef PTRACE_*
instead of only #ifdef SUNOS4. Add PTRACE_[GS]ETFPXREGS.
/external/strace/process.c
43b286f8cb8586acef62da1cbfa5e00d0ea4d427 10-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-10 Roland McGrath <roland@redhat.com>

* process.c (change_syscall) [POWERPC]: Add missing return.
* util.c [POWERPC] (arg0_offset): Set to 4*PT_R3, not 4*PT_ORIG_R3.
/external/strace/process.c
e85bbfe9ab55854cc3a6227d2f9001587fe64996 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.
Revamp -f support for Linux.
* util.c [LINUX] (setbpt, clearbpt): New implementations that tweak
the system call to be clone with CLONE_PTRACE set. Various new static
helper functions.
* process.c (internal_clone): Define also #ifdef SYS_clone2.
Initialize TCPCHILD->parent field.
[CLONE_PTRACE]: Don't do PTRACE_ATTACH here, because it's preattached.
Check in case the new child is in the tcb already.
(internal_fork) [LINUX]: Just call internal_clone.
* strace.c (trace) [LINUX]: Under -f/-F, grok an unknown pid
reporting to wait, put it in the TCB with TCB_ATTACHED|TCB_SUSPENDED.
/external/strace/process.c
909875ba26c1ed466aa9b46d14a339500617690c 22-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-21 Roland McGrath <roland@redhat.com>

* linux/syscallent.h: Add some new 2.5 syscall names.
Now clone takes 5 args.
* process.c [LINUX] (clone_flags): Update with 2.5 flag bits.
[LINUX] (sys_clone): Print new args.
* mem.c (print_ldt_entry): Make global.
/external/strace/process.c
b69f81b8e552ab9ecdc5605887458adb0cb9542a 22-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-21 Roland McGrath <roland@redhat.com>

* syscall.c (force_result): New function.
* process.c (internal_wait): Handle ECHILD exit from wait call with
WNOHANG flag set; force the return value to 0 in the inferior when it
has live children we are tracing.
/external/strace/process.c
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/process.c
7ec1d3584b4caafd6c3634f0a41f90e85f25d42b 17-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-16 Roland McGrath <roland@redhat.com>

* process.c [LINUX] (wait4_options): Fix __WCLONE value. Add
__WNOTHREAD and __WALL.
/external/strace/process.c
3bb9c3d3585bb08f0afb061839e0ea3792bfb41a 16-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-15 Roland McGrath <roland@redhat.com>

* process.c (setarg) [POWERPC]: Support it.
/external/strace/process.c
5a223477e3f6d1badab5925e3da9dc6a2f20d949 16-Dec-2002 Roland McGrath <roland@redhat.com> 2002-12-15 Roland McGrath <roland@redhat.com>

* syscall.c (syscall_enter) [LINUX && POWERPC]: Define PT_ORIG_R3 if
not defined, since <asm/ptrace.h> defines it only #ifdef __KERNEL__.
* process.c: Likewise.
* configure.in: Check for linux/xattr.h and linux/futex.h headers.
* linux/syscall.h: Add sys_* decls for new syscalls getpmsg, putpmsg,
readahead, sendfile64, setxattr, fsetxattr, getxattr, fgetxattr, int
listxattr, flistxattr, removexattr, fremovexattr, sched_setaffinity,
sched_getaffinity, futex.
* linux/syscallent.h: Update the table.
* io.c: Add sys_sendfile64.
* file.c: Add sys_readahead, sys_*xattr.
* process.c: Add sys_futex, sys_*affinity.
/external/strace/process.c
10a88d09ebe283d0dd2ba5deccfe50dc20ea5821 07-Oct-2002 Michal Ludvig <mludvig@suse.cz> 2002-10-07 Michal Ludvig <mludvig@suse.cz>

Merged s390x port by Heiko Carstens <Heiko.Carstens@de.ibm.com>
and bugfixes to s390 by D.J. Barrow.
/external/strace/process.c
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/process.c
c61eb3dce2a87f8220c64404e9c2309f877da455 17-May-2002 John Hughes <john@Calva.COM> handle svr4 procpriv call
/external/strace/process.c
ccef63782c10d9ce9da77ef7530861a3d14b1300 01-May-2002 Wichert Akkerman <wichert@deephackmode.org> Merge patch from Greg Banks for Linux/SuperH support
/external/strace/process.c
5826589d8e210c2d34c8ce496d5b7a0f54188ef0 18-Oct-2001 John Hughes <john@Calva.COM> Merge SVR4/Linux printsiginfo
/external/strace/process.c
7b3346be42d6a1f539e95d385ee498f8b3c529f8 10-Oct-2001 Wichert Akkerman <wichert@deephackmode.org> Import lots of ia64 related changes from David Mosberger
/external/strace/process.c
a2278146b07066567521617158c5284a585668c9 28-Sep-2001 John Hughes <john@Calva.COM> fix display of ptrace args on FreeBSD
/external/strace/process.c
82b162ee2d375dffaa2f0d663706c62d1ebda4f6 03-Aug-2001 Wichert Akkerman <wichert@deephackmode.org> seems Linux/IA64 changed register names on us, switch to using new names
/external/strace/process.c
4e36a8151bccaba338bf8513a367d287d193f524 18-Apr-2001 John Hughes <john@Calva.COM> Handle fork1/forkall on uw, handle rfork1,rforkall,rexecve and ssisys on uw non-stop-clusters
/external/strace/process.c
5c4c69bc80874a0340d290b562db73d755e39129 12-Apr-2001 Wichert Akkerman <wichert@deephackmode.org> Fix wrong cast in powerpc code
/external/strace/process.c
00a82eed2b1b7989a8659390c23b8a87425f235d 28-Mar-2001 Wichert Akkerman <wichert@deephackmode.org> several Linux/sparc fixes
/external/strace/process.c
c1652e2095fcd9ac62cf2669ef6aec5fd0052851 27-Mar-2001 Wichert Akkerman <wichert@deephackmode.org> Add Linux/hppa port, patch from Richard Hirst
/external/strace/process.c
2e4ffe59b588159eb80e236f068278ba47735932 04-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> more FreeBSD updates
/external/strace/process.c
9b0c31d663e51a98383f83521f4b6081986ee47c 03-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> process.c: perform bpt trick for clone as well so we can get the pid of the child before it starts doing something
file.c: rename dirent64 struct to kernel_dirent64 so things compile again with newer libcs
/external/strace/process.c
bf79f2e16b090ffe59cd1e1820935680a2da7b78 01-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> Add FreeBSD support
/external/strace/process.c
e381610a008714838053fdb9ca9b6b9bdeeaa8e4 01-Aug-2000 Ralf Baechle <ralf@linux-mips.org> Implement setargs for MIPS.
/external/strace/process.c
5ae21ead9f83597452f9a0517e8a51fa4823f921 01-May-2000 Wichert Akkerman <wichert@deephackmode.org> The `too much stuff, just check the ChangeLog' update
/external/strace/process.c
c792698a99b640e7d256e8692c992bd967f0c5b2 11-Apr-2000 Wichert Akkerman <wichert@deephackmode.org> README-linux: updated to note that strace might not compile
with development kernels
bjm.c: sys_query_module: check if malloc succeeds
system.c: sys_cap[gs]et(): check if malloc succeeds, only malloc once
linux/syscallent.h: updated for 2.3.99pre3
linux/alpha/syscallent.h: updated for 2.3.99pre3, add all osf syscalls
even though Linux doesn't implement them
syscall.c: add global variables for MIPS registers as well
syscall.c: move global variables to before get_scno since that uses them
util.c: oops, misspelled defined
process.c: fix ptrace calls in change_syscall
mem.c: decode sys_madvise
Merge patch from Topi Miettinen <Topi.Miettinen@nic.fi>
+ add support for quotactl, fdatasync, mlock, mlockall, munlockall & acct
+ small fix for RLIMIT_* and RUSAGE_BOTH
+ enhace support for capget and capset
/external/strace/process.c
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/process.c
12f75d1a388cd2eaf1edb7b73daea243210c4ea0 14-Feb-2000 Wichert Akkerman <wichert@deephackmode.org> S390 updates
/external/strace/process.c
8b1b40cd8b49151374d0ac2a5b1a4b459f9e0ae5 03-Feb-2000 Wichert Akkerman <wichert@deephackmode.org> Merge Trillian patches (Linux ia64)
/external/strace/process.c
9a9f10b4fcbbf102149ca61660805a4a2297e17a 01-Feb-2000 Pavel Machek <pavel@ucw.cz> Wrap changing of syscall into nice function.

Warn instead of infinite loop in case of error.
/external/strace/process.c
90512f033269020a6fe60d9f8891f1a6ec99f4ac 24-Dec-1999 Ulrich Drepper <drepper@redhat.com> (internal_clone): Fix a few typos and add definitions to make it at
least compile.
/external/strace/process.c
7a0b649aeace5c1e1efe4a1d7b1ae6e3a87e0d44 23-Dec-1999 Wichert Akkerman <wichert@deephackmode.org> Begin work on supporting clone
/external/strace/process.c
4dc8a2aec63e4fb5ee2688544c4de323ed5de3ef 23-Dec-1999 Wichert Akkerman <wichert@deephackmode.org> Bunch of stuff
/external/strace/process.c
f5eeabb156641482abd504fb98b039e1aae4ae87 18-Nov-1999 Wichert Akkerman <wichert@deephackmode.org> Start merging linux-ip-routing fork
/external/strace/process.c
f90da01fd19a7779d6ed9ad66605367ae43bb2fd 31-Oct-1999 Wichert Akkerman <wichert@deephackmode.org> Add Linux MIPS support
/external/strace/process.c
15dea97f8a05b2b67f5752137fe93e3cc20db6ec 06-Oct-1999 Wichert Akkerman <wichert@deephackmode.org> Compilation updates
/external/strace/process.c
36915a19e4806339b76209b20fdbd1091c126115 13-Jul-1999 Wichert Akkerman <wichert@deephackmode.org> Add test for sys/reg.h and use that instead of asm/ptrace.h
This should fix building problems on glibc2.0 systems
/external/strace/process.c
8829a55dc2b13a00be7402f4bf644178a12e9f74 11-Jun-1999 Wichert Akkerman <wichert@deephackmode.org> Various fixes, see ChangeLog for details
/external/strace/process.c
2e2553a534f532a1546ea2b2f3dc3cd2276d020d 09-May-1999 Wichert Akkerman <wichert@deephackmode.org> Merged in a bunch of patches that I got as reaction to the 3.99 release.
See the ChangeLog for details
/external/strace/process.c
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/process.c
38508fdf0c25cd9227a5f6e4085f3c94bd70eb0c 30-Mar-1999 Nate Sammons <nate@users.sourceforge.net> Don't try to follow clone, until special handling for all of its
possible modes has been implemented.
/external/strace/process.c
ccd8f216267cea2f56567b8a44929475105b8298 30-Mar-1999 Nate Sammons <nate@users.sourceforge.net> Add capability for Linux to change a vfork call into plain fork, which
can be followed. (Requires a kernel patch for now.) Also document it.
/external/strace/process.c
39c761997d9e1dbef06d29088814e62955eaced1 29-Mar-1999 Nate Sammons <nate@users.sourceforge.net> Change EXEC_vfork to SYS_vfork; broke compilation on at least
glibc2.1.
/external/strace/process.c
9047076564d0a097897f165a1311f35f8a2b116b 17-Mar-1999 Wichert Akkerman <wichert@deephackmode.org> sys/reg apparently only exists on i386 and m68k, so fix the test in
a couple of files
/external/strace/process.c
5daa028ca314e4c36c1f38e0149834d9a0520128 15-Mar-1999 Wichert Akkerman <wichert@deephackmode.org> Simply bugfixes, see patch to debian/changelog for details
/external/strace/process.c
76baf7c9f6dd61a15524ad43c1b690c252cf5b7c 19-Feb-1999 Wichert Akkerman <wichert@deephackmode.org> Initial revision
/external/strace/process.c