Timeline for Why doesn't strace report that the parent shell fork() a child process before execve() a command?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 3, 2016 at 3:36 | comment | added | Michael Homer | Otherwise the shell may just decide to exec itself out of existence if it's not going to have to do anything more after running the program. | |
| Mar 3, 2016 at 3:17 | comment | added | Tim | @Michael: Thanks. I see. Why do you add echo after /usr/bin/time? | |
| Mar 3, 2016 at 2:07 | vote | accept | Tim | ||
| Mar 3, 2016 at 0:47 | answer | added | Kenster | timeline score: 10 | |
| Mar 2, 2016 at 23:49 | answer | added | Barefoot IO | timeline score: 4 | |
| Mar 2, 2016 at 23:48 | comment | added | Michael Homer | Then the output of strace starts at the beginning of its child. If you want to trace a shell, you have to strace the shell. strace -f -e trace=process sh -c '/usr/bin/time ; echo' or something. | |
| Mar 2, 2016 at 23:47 | comment | added | Michael Homer | The subprocess will exec the specified command strace. | |
| Mar 2, 2016 at 23:44 | comment | added | Tim | Not sure what you mean. The bash shell where I run the command will first fork a sub process which is a copy of itself, and then the sub process will execve the specified command time. | |
| Mar 2, 2016 at 23:39 | comment | added | Michael Homer | Where is the shell in this example? | |
| Mar 2, 2016 at 23:26 | history | asked | Tim | CC BY-SA 3.0 |