Is strace itself impact the running application?

Roland McGrath roland at redhat.com
Mon Feb 10 15:46:01 UTC 2003


> We are trying to use strace mechnanism to monitor and report system call
> usage of a application. We want to know first, how strace itself impact
> the execution time? Is it an expensive overhead to trace those system
> calls and signals? 

Indeed it is.  Every time the traced program would run a system call or
take a signal, it stops, strace wakes up and examines the stopped process,
and resumes it.  For system calls there is one such stop before performing
the syscall and one after.  In terms of interprocess and kernel overhead,
this is comparable to running the program under a debugger and stopping at
breakpoints for each syscall.

> In short, what appoximately the execution time difference for an
> application if we use strace and if we not use it?

The way to find that out is to time your application.





More information about the Strace-devel mailing list