12

If I run strace on a program and that program spawns a subprocess (e.g. perl's system() call), will strace report the system calls for the child process as well?

Ross Rogers
  • 4,427
  • 8
  • 32
  • 43

1 Answers1

16

Yes, but you need to add the -f flag to trace the child processes.

codeforester
  • 154
  • 1
  • 1
  • 8
baumgart
  • 1,416
  • 9
  • 14
  • It's worth noting that if you are attaching strace to an already running process any _existing_ child processes are not traced even with `-f` – sparrowt May 25 '23 at 08:51