Re: strace only one child process



phil-news-nospam@xxxxxxxx wrote:
On Fri, 20 Oct 2006 12:26:58 -0700 John Reiser <jreiser@xxxxxxxxxxxx> wrote:
| phil-news-nospam@xxxxxxxx wrote:
|> |> Knows someone any trick to trace only one (or a few ones) childs?
|> |
|> | Attach to the desired child after it has been created.
|> | See the documentation for "strace -p <pid>".
|>
|> He might be wanting to see what the child does with the incoming connection
|> right when it forks. The child may only live long enough to do something
|> and then exit. I have a daemon that, upon TCP connection, spits out a file
|> to whatever connects, then exits. If it's a short file, the child is gone
|> in quite a hurry.
|
| The suggestion to attach after the child exists does help in some
| cases. In some others, the child can be modified to wait long enough.
|
| When both of those fail, what did _you_ suggest that works?

Filtering the strace output. Or modifying strace.



Hello,

Thanks for your answers,

Execution time is less than one second. No time to "ps" and "strace
-p".

The problem is the overload if all childs are traced. The overload in
"strace" seems the same independent of the "-e" options.

About modify "strace", it is a posibility. I should evaluate the
necessary effort. The idea will be add to the "-f" option an optional
numerical argument: maximum number of childs to follow.

Kind regards.

.



Relevant Pages

  • Re: BUG: NTPL: waitpid() doesnt return?
    ... The strace case I'm more than willing to pass off as a strace problem. ... I find it quite common that strace doesn't detach from processes, ... So I assumed that the particular trace ... "CLONE_DETACHED" child, and then you expect to be able to wait for it. ...
    (Linux-Kernel)
  • Re: How to trace a process with ptrace when it forks a new process ?
    ... |> to trace its child too, if the process forks a child, ... What is the knowledge basis on which the strace utility was developed? ... When I recommend people to look at the source code of how something else ...
    (comp.os.linux.development.system)
  • strace -f regression, bisected to tracehook
    ... I have just hit a problem with strace when following forks, ... I have bisected the problem to commit 09a05394 (tracehook: ... and traces them only after the child has run for some time. ... strace uses a trick to set the CLONE_PTRACE flag on clonesyscalls ...
    (Linux-Kernel)
  • Re: using exec in xinetd process
    ... OK I made some progress thanks to your strace:) ... makes the child inherit ... in that the exec manpage mentions the sharing ... descriptors 0 and 2 get passed to the child. ...
    (comp.lang.tcl)
  • Re: strace one child process
    ... I like to "strace" one of these child process. ... "-f" option traces all childs, ...
    (comp.os.linux.misc)