<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.3790.2759" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>Hello strace
maintainer(s),</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>Strace is very
useful to investigate what large, complicated programs are doing (i.e., why they
take so long).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>One frustration is
that when I monitor strace output and see "suspicious" repeated system calls, I
can't</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>attach a debugger to
track down where they come from because the process is already being
traced. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>If there were some
way to make strace </SPAN></FONT><FONT face=Arial size=2><SPAN
class=639143419-31012007>stop tracing the process, I could then attach
gdb. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>Granted, the process
might leave the "suspicious" code </SPAN></FONT><FONT face=Arial size=2><SPAN
class=639143419-31012007>loop before gdb started, but often the
process</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>would still
</SPAN></FONT><FONT face=Arial size=2><SPAN class=639143419-31012007>be in an
informative context.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>PROPOSED
ENHANCEMENT:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007> 1. Make
SIGUSR1 tell strace to stop tracing the child process, allowing it to run
free.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> (presumably strace would
thereupon wait() for the child to exit before exiting
itself).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007> 2. (fancier
version) Make SIGUSR1 tell strace to take a pre-determined action, specified
in</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> advance via command line
args. The possible actions would include:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> a) stop
tracing and let the process run free</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> b) send
SIGSUSP to the process, wait for it to get the signal, then stop
tracing</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007>
(the user could then attach gdb and send the process SIGCONT to
resume)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> c) Like (b)
but automatically launch gdb on the child process</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007> d)
???</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>I imagine that
strace -f/F pose extra difficulties. Ideally, SIGUSR1 would
</SPAN></FONT><FONT face=Arial size=2><SPAN class=639143419-31012007>make strace
stop tracing</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>all the processes in
a transparent manner.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>I don't know if any
of this is possible, but it would be a neat trick if so.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=639143419-31012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>Thanks for
listening,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=639143419-31012007>-Jim
Avera</SPAN></FONT></DIV></BODY></HTML>