Enh Req: Make SIGUSR1 stop tracing

Jim Avera jima at cadence.com
Wed Jan 31 19:51:25 UTC 2007


Hello strace maintainer(s),
 
Strace is very useful to investigate what large, complicated programs
are doing (i.e., why they take so long).
 
One frustration is that when I monitor strace output and see
"suspicious" repeated system calls, I can't
attach a debugger to track down where they come from because the process
is already being traced.  
If there were some way to make strace stop tracing the process, I could
then attach gdb.  
 
Granted, the process might leave the "suspicious" code loop before gdb
started, but often the process
would still be in an informative context.
 
PROPOSED ENHANCEMENT:
  1. Make SIGUSR1 tell strace to stop tracing the child process,
allowing it to run free.
      (presumably strace would thereupon wait() for the child to exit
before exiting itself).
 
  2. (fancier version) Make SIGUSR1 tell strace to take a pre-determined
action, specified in
      advance via command line args.  The possible actions would
include:
        a) stop tracing and let the process run free
        b) send SIGSUSP to the process, wait for it to get the signal,
then stop tracing
            (the user could then attach gdb and send the process SIGCONT
to resume)
        c) Like (b) but automatically launch gdb on the child process
        d) ???
 
I imagine that strace -f/F pose extra difficulties.  Ideally, SIGUSR1
would make strace stop tracing
all the processes in a transparent manner.
 
I don't know if any of this is possible, but it would be a neat trick if
so.
 
Thanks for listening,
-Jim Avera
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20070131/7c51daa7/attachment.html>


More information about the Strace-devel mailing list