How does strace connect to an already running process?
问题 I do know that strace uses ptrace to do the job, but it needs to run the target process with TRACE_ME on, which don't apply for the case of an already running process. how does it work on an already running process? 回答1: strace -p <PID> ----> To attach a process to strace . "-p" option is for PID of the process. strace -e trace=read,write -p <PID> --> By this you can also trace a process/program for an event, like read and write (in this example). So here it will print all such events that