Go to file
Denys Vlasenko 44f87efc67 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>
2011-08-17 15:18:21 +02:00
debian Prepare for 4.6 release 2011-03-14 15:39:36 +00:00
freebsd Remove obsolete .cvsignore files 2011-02-25 16:53:50 +00:00
linux Fix MIPS syscall entries 2011-06-09 15:16:01 +00:00
m4 Fix off_t/rlim_t size checks when cross-compiling 2010-09-15 15:36:00 +00:00
sunos4 Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
svr4 Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
test Add fflush after printf in test/sigkill_rain.c 2011-06-08 16:07:03 +02:00
tests tests: finish ptrace_setoptions_* merge 2011-06-21 15:03:17 +00:00
.gitignore linux/ioctlent: unify them all 2011-03-14 15:32:38 +00:00
.mailmap Generate much of the CREDITS file from git log 2011-02-24 01:51:15 +00:00
AUTHORS 2002-12-22 Roland McGrath <roland@redhat.com> 2002-12-30 00:51:30 +00:00
bjm.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
block.c Fix compilation on 2.4.20 kernel based system 2011-08-15 11:36:09 +02:00
ChangeLog-CVS Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
configure.ac Check for additional PTRACE_* constants 2011-07-19 22:13:11 +00:00
COPYRIGHT update copyright 2002-03-31 18:43:00 +00:00
count.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
CREDITS.in * CREDITS.in: Fix typo. 2011-03-15 15:46:52 +00:00
defs.h Remove tcp->parent and TCB_CLONE_THREAD. 2011-08-17 15:18:21 +02:00
desc.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
errnoent.sh Mark shell scripts as executable 2009-09-18 12:07:03 +00:00
file.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
git-set-file-times * git-set-file-times: Import from rsync. 2009-10-09 23:07:28 +00:00
gitlog-to-changelog Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
HACKING-scripts HACKING-scripts: new doc file by Mike Frysinger 2009-02-23 07:56:01 +00:00
INSTALL Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
io.c Add argument to tprint_iov() specifying whether to decode each iovec 2011-06-13 22:58:44 +00:00
ioctl.c Introduce ARRAY_SIZE() macro 2011-06-13 21:58:43 +00:00
ioctlsort.c Fix const-correctness issues uncovered by gcc -Wwrite-strings 2010-09-07 00:59:18 +00:00
ipc.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
make-dist Generate an xz tar archive of the distribution 2011-02-27 14:05:58 +00:00
Makefile.am Add ability to print file descriptor paths and filter by those paths 2011-04-08 20:47:56 +00:00
mem.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
net.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
NEWS Prepare for 4.6 release 2011-03-14 15:39:36 +00:00
pathtrace.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
PORTING Initial revision 1999-02-19 00:21:36 +00:00
proc.c "Modernize" all old-style function parameter declarations 2011-05-30 14:00:14 +02:00
process.c Remove tcp->parent and TCB_CLONE_THREAD. 2011-08-17 15:18:21 +02:00
quota.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
README More cleanups from Mike Frysingler: 2009-02-23 08:07:45 +00:00
README-freebsd trailing whitespace removal, no code changes 2009-01-02 13:03:44 +00:00
README-hacking Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
README-linux Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
README-sunos4 Initial revision 1999-02-19 00:21:36 +00:00
README-svr4 Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
resource.c Handle biarch get/setrlimit 2010-07-17 17:46:28 +02:00
scsi.c 2007-03-29 Vladimir Nadvornik <nadvornik@suse.cz> 2007-06-30 11:37:09 +00:00
signal.c Do not detach when we think tracee is going to die. 2011-08-17 10:45:32 +02:00
signalent.sh Mark shell scripts as executable 2009-09-18 12:07:03 +00:00
sock.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
strace-graph Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
strace.1 Add ability to print file descriptor paths and filter by those paths 2011-04-08 20:47:56 +00:00
strace.c Remove tcp->parent and TCB_CLONE_THREAD. 2011-08-17 15:18:21 +02:00
strace.spec Prepare for 4.6 release 2011-03-14 15:39:36 +00:00
stream.c Whitespace cleanups. no code changes. 2011-06-07 12:13:24 +02:00
syscall.c Do not detach when we think tracee is going to die. 2011-08-17 10:45:32 +02:00
syscallent.sh Mark shell scripts as executable 2009-09-18 12:07:03 +00:00
system.c * system.c (sys_capget, sys_capset): Fix pointer arithmetics 2011-06-23 13:25:09 +00:00
term.c Remove dead code 2010-02-04 22:40:57 +00:00
time.c Whitespace cleanups. No code changes. 2011-06-22 14:32:43 +02:00
TODO Merge iov fixes from Richard Kettlewell 2001-07-10 13:48:44 +00:00
util.c Untangle a particularly badly obfuscated bit of code. No logic changes. 2011-06-23 21:57:54 +02:00
xlate.el Initial revision 1999-02-19 00:21:36 +00:00

This is strace 4.0, a system call tracer for SunOS 4.x, Linux, System
V release 4, Solaris 2.x and Irix 5.x.  strace is released under a
Berkeley-style license at the request of Paul Kranenburg; see the file
COPYRIGHT for details.

Read the INSTALL file for generic instructions on how to install
strace.  If configure cannot guess your system configuration, you can
specify it on the command line after the other options like this:

	./configure --prefix=/usr i486-linux

A single sunos4.1 binary should work on all the sun4, sun4c and sun4m
kernel architectures.  Let me know if sun4d doesn't work.  Other
i486-*-sysv4 systems may work with little or no tweaking.

See the file NEWS for information on what has changed in recent
versions.

See the file PORTING if you like strace but it doesn't work on an
operating system you use frequently.

See the file CREDITS to see who has contributed to strace.

See the file TODO if you feel like helping out.

You can get the latest version of strace from its homepage at
http://sourceforge.net/projects/strace/ .

Please send bug reports and enhancements to the strace
mailinglist at strace-devel@lists.sourceforge.net, or directly to
Wichert Akkerman <wakkerma@debian.org>